From 9f81d6897953ec2b599968563becad0a5319556b Mon Sep 17 00:00:00 2001 From: Anna Pokorska Date: Tue, 3 Dec 2024 14:54:45 +0000 Subject: [PATCH] Fix unit test --- tests/conftest.py | 2 +- tests/non_search/routers/lookups/test_config.py | 4 ++-- tests/unit/app/core/test_organisation.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index cc51f1fd..9780caf8 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -165,7 +165,7 @@ def app_token_factory(monkeypatch): def mock_return(_, __, ___): return True - def _app_token(allowed_corpora_ids): + def _app_token(allowed_corpora_ids: list[str]): subject = "CCLW" audience = "localhost" input_str = f"{allowed_corpora_ids};{subject};{audience}" diff --git a/tests/non_search/routers/lookups/test_config.py b/tests/non_search/routers/lookups/test_config.py index 774157d1..40578901 100644 --- a/tests/non_search/routers/lookups/test_config.py +++ b/tests/non_search/routers/lookups/test_config.py @@ -210,8 +210,8 @@ def test_config_endpoint_cclw_stats(data_client, data_db, valid_token): @pytest.mark.parametrize( "allowed_corpora_ids, expected_organisation, other_organisation", [ - ("UNFCCC.corpus.i00000001.n0000", "UNFCCC", "CCLW"), - ("CCLW.corpus.i00000001.n0000", "CCLW", "UNFCCC"), + (["UNFCCC.corpus.i00000001.n0000"], "UNFCCC", "CCLW"), + (["CCLW.corpus.i00000001.n0000"], "CCLW", "UNFCCC"), ], ) def test_config_endpoint_returns_stats_for_allowed_corpora_only( diff --git a/tests/unit/app/core/test_organisation.py b/tests/unit/app/core/test_organisation.py index c025c4eb..2c6c7718 100644 --- a/tests/unit/app/core/test_organisation.py +++ b/tests/unit/app/core/test_organisation.py @@ -35,7 +35,7 @@ def test_expected_organisations_present(data_db: Session): orgs = get_organisations( - data_db, ["UNFCCC.corpus.i00000001.n0000,CCLW.corpus.i00000001.n0000"] + data_db, ["UNFCCC.corpus.i00000001.n0000", "CCLW.corpus.i00000001.n0000"] ) assert len(orgs) == EXPECTED_NUM_ORGS