Skip to content

Commit

Permalink
Test pysquirrel integration
Browse files Browse the repository at this point in the history
  • Loading branch information
dc-almeida committed Sep 18, 2024
1 parent a031018 commit b14e24a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/data/general-config-only-nuts/nomenclature.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
dimensions:
- region
definitions:
region:
nuts:
nuts-1: [ AT ]
nuts-2: [ BE ]
nuts-3: [ CZ ]
11 changes: 11 additions & 0 deletions tests/test_definition.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,17 @@ def test_definition_general_config_country_only():
assert all(region in obs.region for region in ("Austria", "Bolivia", "Kosovo"))


def test_definition_general_config_nuts_only():
"""Check that DataStructureDefinition is properly initialised with NUTS region config only"""
obs = DataStructureDefinition(
TEST_DATA_DIR / "general-config-only-nuts" / "definitions"
)
assert all(region[:2] in ("AT", "BE", "CZ") for region in obs.region)
assert len([region for region in obs.region if region.startswith("AT")]) == 4
assert len([region for region in obs.region if region.startswith("BE")]) == 12
assert len([region for region in obs.region if region.startswith("CZ")]) == 15


def test_to_excel(simple_definition, tmpdir):
"""Check writing a DataStructureDefinition to file"""
file = tmpdir / "testing_export.xlsx"
Expand Down

0 comments on commit b14e24a

Please sign in to comment.