Skip to content

Commit e29c577

Browse files
committed
test: finish fixing the mocks in the pypi_cache
Work towards #3759
1 parent ed05762 commit e29c577

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

tests/pypi/pypi_cache/pypi_cache_tests.bzl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ _tests.append(_test_pypi_cache_reads_from_facts)
270270

271271
def _test_pypi_cache_reads_from_facts_drops_unaccessed_dists(env):
272272
"""Verifies that dists for unaccessed versions are dropped from computed facts."""
273-
mock_ctx = mocks.mctx(facts = {
273+
mock_ctx = struct(facts = {
274274
"dist_hashes": {
275275
"https://{PYPI_INDEX_URL}": {
276276
"pkg": {
@@ -363,7 +363,7 @@ _tests.append(_test_memory_cache_index_urls)
363363

364364
def _test_pypi_cache_writes_index_urls_to_facts(env):
365365
"""Verifies that setting index_urls in the cache also populates the facts store."""
366-
mock_ctx = mocks.mctx(facts = {})
366+
mock_ctx = struct(facts = {})
367367
cache = _cache(env, mctx = mock_ctx)
368368

369369
fake_result = {
@@ -401,7 +401,7 @@ _tests.append(_test_pypi_cache_writes_index_urls_to_facts)
401401

402402
def _test_pypi_cache_reads_index_urls_from_facts(env):
403403
"""Verifies that reading index_urls from facts works correctly."""
404-
mock_ctx = mocks.mctx(facts = {
404+
mock_ctx = struct(facts = {
405405
"fact_version": "v1",
406406
"index_urls": {
407407
"https://pypi.org/simple/": {
@@ -432,7 +432,7 @@ _tests.append(_test_pypi_cache_reads_index_urls_from_facts)
432432

433433
def _test_pypi_cache_reads_index_urls_from_facts_incomplete(env):
434434
"""Verifies that incomplete index_urls facts returns None (forces fresh download)."""
435-
mock_ctx = mocks.mctx(facts = {
435+
mock_ctx = struct(facts = {
436436
"fact_version": "v1",
437437
"index_urls": {
438438
"https://pypi.org/simple/": {
@@ -455,7 +455,7 @@ def _test_pypi_cache_reads_index_urls_from_facts_drops_unaccessed(env):
455455
appear in computed_facts. This ensures stale facts (from packages
456456
removed from all requirements files) get cleaned up from the lockfile.
457457
"""
458-
mock_ctx = mocks.mctx(facts = {
458+
mock_ctx = struct(facts = {
459459
"fact_version": "v1",
460460
"index_urls": {
461461
"https://pypi.org/simple/": {

0 commit comments

Comments
 (0)