Skip to content

Commit

Permalink
BLS_Jolts refresh added test data
Browse files Browse the repository at this point in the history
  • Loading branch information
Girish3320 committed Jan 3, 2025
1 parent 2ba7644 commit 59df02a
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions scripts/us_bls/jolts/bls_jolts_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
if not os.path.exists("./test_data/actual_output_files/"):
os.makedirs("./test_data/actual_output_files/")


class TestPreprocess(unittest.TestCase):
"""
This module is used to test USCensus PEP_Annual_Population data processing.
Expand All @@ -49,9 +50,11 @@ def __init__(self, methodName: str = ...) -> None:

data_file_path = os.path.join(_MODULE_DIR, TEST_DATA_DIR, OUTPUT_DIR)

cleaned_csv_path = os.path.join(data_file_path, "BLSJolts_StatisticalVariables.csv")
mcf_path = os.path.join(data_file_path, "BLSJolts_StatisticalVariables.mcf")

cleaned_csv_path = os.path.join(data_file_path,
"BLSJolts_StatisticalVariables.csv")
mcf_path = os.path.join(data_file_path,
"BLSJolts_StatisticalVariables.mcf")

jolts_df, schema_mapping = generate_cleaned_dataframe(files_dir)
final_columns = ['Date', 'StatisticalVariable', 'Value']
# output_csv_path = os.path.join(OUTPUT_FILES, "BLSJolts_StatisticalVariables.csv")
Expand All @@ -71,8 +74,9 @@ def test_mcf_files(self):
This method tests MCF files generated using process module against
expected results.
"""
expected_mcf_file_path = os.path.join(_MODULE_DIR, TEST_DATA_DIR, OUTPUT_FILES,
"BLSJolts_StatisticalVariables.mcf")
expected_mcf_file_path = os.path.join(
_MODULE_DIR, TEST_DATA_DIR, OUTPUT_FILES,
"BLSJolts_StatisticalVariables.mcf")

with open(expected_mcf_file_path,
encoding="UTF-8") as expected_mcf_file:
Expand All @@ -86,14 +90,15 @@ def test_create_csv(self):
This method tests CSV file generated using process module against
expected CSV result.
"""
expected_csv_file_path = os.path.join(_MODULE_DIR, TEST_DATA_DIR, OUTPUT_FILES,
"BLSJolts_StatisticalVariables.csv")
expected_csv_file_path = os.path.join(
_MODULE_DIR, TEST_DATA_DIR, OUTPUT_FILES,
"BLSJolts_StatisticalVariables.csv")

expected_csv_data = ""
with open(expected_csv_file_path,
encoding="utf-8") as expected_csv_file:
expected_csv_data = expected_csv_file.read()

self.assertEqual(expected_csv_data.strip(),
self._actual_csv_data.strip())

Expand Down

0 comments on commit 59df02a

Please sign in to comment.