Skip to content

Commit

Permalink
Update test_eia923_dependency function to make sure some 860 and 923 …
Browse files Browse the repository at this point in the history
…years overlap but don't need to be the same
  • Loading branch information
aesharpe committed Oct 30, 2023
1 parent b3c11c2 commit 3b35892
Showing 1 changed file with 12 additions and 15 deletions.
27 changes: 12 additions & 15 deletions test/unit/settings_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,21 +132,18 @@ def test_860m(self):
class TestEiaSettings:
"""Test pydantic model that validates EIA datasets."""

# def test_eia923_dependency(self):
# """Test 860 is added if 923 is specified and 860 is not."""
# eia923_settings = Eia923Settings()
# settings = EiaSettings(eia923=eia923_settings)
# data_source = DataSource.from_id("eia860")

# assert settings.eia860

# assert settings.eia860.years == data_source.working_partitions["years"]

# def test_eia860_dependency(self):
# """Test 923 tables are added to eia860 if 923 is not specified."""
# eia860_settings = Eia860Settings()
# settings = EiaSettings(eia860=eia860_settings)
# assert settings.eia923.years == eia860_settings.years
def test_eia923_dependency(self):
"""Test that there is some overlap between EIA860 and EIA923 data."""
settings = EiaSettings()
data_source = DataSource.from_id("eia860")
assert settings.eia860
# assign both EIA form years
eia860_years = settings.eia860.years
eia923_years_partition = data_source.working_partitions["years"]
eia923_years_settings = settings.eia923.years
# assert that there is some overlap between EIA years
assert not set(eia860_years).isdisjoint(eia923_years_partition)
assert not set(eia860_years).isdisjoint(eia923_years_settings)


class TestDatasetsSettings:
Expand Down

0 comments on commit 3b35892

Please sign in to comment.