Skip to content

Commit

Permalink
Use fuzzed data in tests of generate_code_lists()
Browse files Browse the repository at this point in the history
  • Loading branch information
khaeru committed Jan 24, 2024
1 parent af871f1 commit 2ac60df
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion message_ix_models/tests/tools/iea/test_web.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def test_load_data(test_context, tmp_path, provider, edition):


@pytest.mark.parametrize("provider, edition", list(FILES.keys()))
def test_generate_code_lists(tmp_path, test_context, provider, edition):
def test_generate_code_lists(tmp_path, provider, edition):
# generate_code_lists() runs
generate_code_lists(provider, edition, tmp_path)

Expand Down
7 changes: 6 additions & 1 deletion message_ix_models/tools/iea/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,13 @@ def generate_code_lists(
register_agency(IEA)

# Read the data
if HAS_MESSAGE_DATA:
path = private_data_path("iea")
else:
path = package_data_path("test", "iea")
log.warning(f"Reading random data from {path}")
data = iea_web_data_for_query(
private_data_path("iea"), *FILES[(provider, edition)], query_expr="TIME > 0"
path, *FILES[(provider, edition)], query_expr="TIME > 0"
)

for concept_id in ("COUNTRY", "FLOW", "PRODUCT"):
Expand Down

0 comments on commit 2ac60df

Please sign in to comment.