Skip to content

Commit

Permalink
add tests for is_solvability_check needed (1/2)
Browse files Browse the repository at this point in the history
  • Loading branch information
ytausch committed Jul 28, 2024
1 parent 3470486 commit dd16af9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
15 changes: 15 additions & 0 deletions tests/fake_lazy_json.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from types import TracebackType
from typing import Self


class FakeLazyJson(dict):
def __enter__(self) -> Self:
return self

def __exit__(
self,
exc_type: type[BaseException] | None,
exc_val: BaseException | None,
exc_tb: TracebackType | None,
) -> None:
pass
8 changes: 4 additions & 4 deletions tests/test_auto_tick.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
GitPlatformBackend,
RepositoryNotFoundError,
)
from conda_forge_tick.lazy_json_backends import LazyJson
from conda_forge_tick.migrators_types import AttrsTypedDict
from tests.fake_lazy_json import FakeLazyJson

demo_attrs = AttrsTypedDict(
{"conda-forge.yml": {"provider": {"default_branch": "main"}}}
{"conda-forge.yml": {"provider": {"default_branch": "main"}, "bot": {}}}
)


Expand Down Expand Up @@ -63,8 +63,8 @@ def test_prepare_feedstock_repository_repository_not_found(caplog):

demo_attrs_copy = copy.deepcopy(demo_attrs)

attrs = LazyJson(str(tmpdir / "test-attrs-1337.json"))
pr_info = LazyJson(str(tmpdir / "test-pr-info-1337.json"))
attrs = FakeLazyJson()
pr_info = FakeLazyJson()

with attrs:
for key, value in demo_attrs_copy.items():
Expand Down

0 comments on commit dd16af9

Please sign in to comment.