Skip to content

Commit

Permalink
chore: update db client version (#451)
Browse files Browse the repository at this point in the history
* chore: update db client version

* update to correct version

---------

Co-authored-by: Osneil Drakes <[email protected]>
  • Loading branch information
odrakes-cpr and Osneil Drakes authored Jan 21, 2025
1 parent 9aa0135 commit 6aa72a2
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 11 deletions.
10 changes: 5 additions & 5 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "navigator_backend"
version = "1.23.0"
version = "1.23.1"
description = ""
authors = ["CPR-dev-team <[email protected]>"]
packages = [{ include = "app" }, { include = "tests" }]
Expand Down Expand Up @@ -31,7 +31,7 @@ starlette = "^0.27.0"
tenacity = "^8.0.1"
uvicorn = { extras = ["standard"], version = "^0.20.0" }
botocore = "^1.34.19"
db-client = { git = "https://github.com/climatepolicyradar/navigator-db-client.git", tag = "v3.8.25" }
db-client = { git = "https://github.com/climatepolicyradar/navigator-db-client.git", tag = "v3.8.28" }
urllib3 = "<2"
apscheduler = "^3.10.4"
numpy = "1.26.4"
Expand Down
6 changes: 6 additions & 0 deletions tests/non_search/routers/lookups/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ def test_config_endpoint_content(data_client, data_db, app_token_factory, valid_
"Legislative": 0,
"UNFCCC": 0,
"MCF": 0,
"Reports": 0,
}

assert cclw_corpus["corpus_import_id"] == "CCLW.corpus.i00000001.n0000"
Expand Down Expand Up @@ -254,6 +255,7 @@ def test_config_endpoint_returns_stats_for_all_allowed_corpora(
"Legislative": 0,
"MCF": 0,
"UNFCCC": 0,
"Reports": 0,
}

cclw_corpora = response_json["corpus_types"]["Laws and Policies"]["corpora"]
Expand All @@ -266,6 +268,7 @@ def test_config_endpoint_returns_stats_for_all_allowed_corpora(
"Legislative": 1,
"MCF": 0,
"UNFCCC": 0,
"Reports": 0,
}
second_cclw_corpus = cclw_corpora[0]
assert second_cclw_corpus["total"] == 1
Expand All @@ -274,6 +277,7 @@ def test_config_endpoint_returns_stats_for_all_allowed_corpora(
"Legislative": 1,
"MCF": 0,
"UNFCCC": 0,
"Reports": 0,
}


Expand Down Expand Up @@ -335,6 +339,7 @@ def test_config_endpoint_does_not_return_stats_for_not_allowed_corpora(
"Legislative": 1,
"MCF": 0,
"UNFCCC": 0,
"Reports": 0,
}


Expand Down Expand Up @@ -389,6 +394,7 @@ def test_config_endpoint_returns_stats_for_all_orgs_if_no_allowed_corpora_in_app
"Legislative": 0,
"MCF": 0,
"UNFCCC": 0,
"Reports": 0,
}


Expand Down
27 changes: 23 additions & 4 deletions tests/non_search/routers/summaries/test_geography_summaries.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@
TEST_HOST = "http://localhost:3000/"
GEOGRAPHY_PAGE_ENDPOINT = "/api/v1/summaries/geography"

EXPECTED_NUM_FAMILY_CATEGORIES = 5
EXPECTED_FAMILY_CATEGORIES = {
"Executive",
"Legislative",
"UNFCCC",
"MCF",
"Reports",
}


def _make_request(
client,
Expand All @@ -29,18 +38,23 @@ def test_endpoint_returns_families_ok_with_slug(data_client, valid_token):
"""Test the endpoint returns an empty sets of data"""
resp = _make_request(data_client, valid_token, "moldova")

assert len(resp["family_counts"]) == 4
assert len(resp["top_families"]) == 4
assert len(resp["family_counts"]) == EXPECTED_NUM_FAMILY_CATEGORIES
assert len(resp["top_families"]) == EXPECTED_NUM_FAMILY_CATEGORIES

assert set(resp["family_counts"].keys()) == EXPECTED_FAMILY_CATEGORIES
assert set(resp["top_families"].keys()) == EXPECTED_FAMILY_CATEGORIES

assert resp["family_counts"]["Executive"] == 0
assert resp["family_counts"]["Legislative"] == 0
assert resp["family_counts"]["UNFCCC"] == 0
assert resp["family_counts"]["MCF"] == 0
assert resp["family_counts"]["Reports"] == 0

assert len(resp["top_families"]["Executive"]) == 0
assert len(resp["top_families"]["Legislative"]) == 0
assert len(resp["top_families"]["UNFCCC"]) == 0
assert len(resp["top_families"]["MCF"]) == 0
assert len(resp["top_families"]["Reports"]) == 0

assert len(resp["targets"]) == 0

Expand All @@ -49,18 +63,23 @@ def test_endpoint_returns_families_ok_with_code(data_client, valid_token):
"""Test the endpoint returns an empty sets of data"""
resp = _make_request(data_client, valid_token, "MDA")

assert len(resp["family_counts"]) == 4
assert len(resp["top_families"]) == 4
assert len(resp["family_counts"]) == EXPECTED_NUM_FAMILY_CATEGORIES
assert len(resp["top_families"]) == EXPECTED_NUM_FAMILY_CATEGORIES

assert set(resp["family_counts"].keys()) == EXPECTED_FAMILY_CATEGORIES
assert set(resp["top_families"].keys()) == EXPECTED_FAMILY_CATEGORIES

assert resp["family_counts"]["Executive"] == 0
assert resp["family_counts"]["Legislative"] == 0
assert resp["family_counts"]["UNFCCC"] == 0
assert resp["family_counts"]["MCF"] == 0
assert resp["family_counts"]["Reports"] == 0

assert len(resp["top_families"]["Executive"]) == 0
assert len(resp["top_families"]["Legislative"]) == 0
assert len(resp["top_families"]["UNFCCC"]) == 0
assert len(resp["top_families"]["MCF"]) == 0
assert len(resp["top_families"]["Reports"]) == 0

assert len(resp["targets"]) == 0

Expand Down

0 comments on commit 6aa72a2

Please sign in to comment.