Skip to content

Commit

Permalink
Simplify class, add test for tract padding (#1848)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattbowen-usds committed Sep 15, 2022
1 parent c74f68d commit 7d41acd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,3 @@ def transform(self) -> None:
)

self.output_df = output_df

def load(self) -> None:
logger.info("Saving DOE Energy Burden CSV")

super().load()
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,13 @@ def test_get_output_file_path(self, mock_etl, mock_paths):
data_path / "dataset" / "doe_energy_burden" / "usa.csv"
)
assert output_file_path == expected_output_file_path

def test_tract_id_lengths(self, mock_etl, mock_paths):
etl = self._setup_etl_instance_and_run_extract(
mock_etl=mock_etl, mock_paths=mock_paths
)
etl.transform()
etl.validate()
etl.load()
df = etl.get_data_frame()
assert (df[etl.GEOID_TRACT_FIELD_NAME].str.len() == 11).all()

0 comments on commit 7d41acd

Please sign in to comment.