From 8db9afb4fdabf49376e6a73e184c70942cdfc4b6 Mon Sep 17 00:00:00 2001 From: Pete Gadomski Date: Thu, 23 Feb 2023 13:37:17 -0800 Subject: [PATCH] tests, refactor: rename to test_case_1_catalog --- tests/conftest.py | 2 +- tests/test_catalog.py | 18 ++++++++++-------- tests/test_collection.py | 6 ++++-- tests/test_item.py | 6 ++++-- 4 files changed, 19 insertions(+), 13 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index fa525042a..58ad09162 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -25,5 +25,5 @@ def item() -> Item: @pytest.fixture -def label_catalog() -> Catalog: +def test_case_1_catalog() -> Catalog: return TestCases.case_1() diff --git a/tests/test_catalog.py b/tests/test_catalog.py index dfe3d37d1..fb984ba6c 100644 --- a/tests/test_catalog.py +++ b/tests/test_catalog.py @@ -1463,16 +1463,18 @@ def from_dict( @pytest.mark.parametrize("add_canonical", (True, False)) -def test_remove_hierarchical_links(label_catalog: Catalog, add_canonical: bool) -> None: - label_catalog.remove_hierarchical_links(add_canonical=add_canonical) - for link in label_catalog.links: +def test_remove_hierarchical_links( + test_case_1_catalog: Catalog, add_canonical: bool +) -> None: + test_case_1_catalog.remove_hierarchical_links(add_canonical=add_canonical) + for link in test_case_1_catalog.links: assert not link.is_hierarchical() - assert bool(label_catalog.get_single_link("canonical")) == add_canonical + assert bool(test_case_1_catalog.get_single_link("canonical")) == add_canonical -def test_fully_resolve(tmp_path: Path, label_catalog: Catalog) -> None: - label_catalog.save(dest_href=str(tmp_path / "before")) +def test_fully_resolve(tmp_path: Path, test_case_1_catalog: Catalog) -> None: + test_case_1_catalog.save(dest_href=str(tmp_path / "before")) assert len(list((tmp_path / "before").glob("**/*.json"))) == 1 - label_catalog.fully_resolve() - label_catalog.save(dest_href=str(tmp_path / "after")) + test_case_1_catalog.fully_resolve() + test_case_1_catalog.save(dest_href=str(tmp_path / "after")) assert len(list((tmp_path / "after").glob("**/*.json"))) == 15 diff --git a/tests/test_collection.py b/tests/test_collection.py index 8751bcb29..99a0c93f2 100644 --- a/tests/test_collection.py +++ b/tests/test_collection.py @@ -533,8 +533,10 @@ def from_dict( @pytest.mark.parametrize("add_canonical", (True, False)) -def test_remove_hierarchical_links(label_catalog: Catalog, add_canonical: bool) -> None: - collection = list(label_catalog.get_all_collections())[0] +def test_remove_hierarchical_links( + test_case_1_catalog: Catalog, add_canonical: bool +) -> None: + collection = list(test_case_1_catalog.get_all_collections())[0] collection.remove_hierarchical_links(add_canonical=add_canonical) for link in collection.links: assert not link.is_hierarchical() diff --git a/tests/test_item.py b/tests/test_item.py index 2ac7a8d2c..62d24c567 100644 --- a/tests/test_item.py +++ b/tests/test_item.py @@ -458,8 +458,10 @@ def test_item_from_dict_with_missing_type_raises_useful_error() -> None: @pytest.mark.parametrize("add_canonical", (True, False)) -def test_remove_hierarchical_links(label_catalog: Catalog, add_canonical: bool) -> None: - item = list(label_catalog.get_all_items())[0] +def test_remove_hierarchical_links( + test_case_1_catalog: Catalog, add_canonical: bool +) -> None: + item = list(test_case_1_catalog.get_all_items())[0] item.remove_hierarchical_links(add_canonical=add_canonical) for link in item.links: assert not link.is_hierarchical()