Skip to content

Commit

Permalink
Two full test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
devinmatte committed Nov 26, 2024
1 parent 0e72939 commit c56ebd8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions mbta-performance/chalicelib/lamp/tests/test_ingest.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ def test_fetch_pq_file_from_remote(self):
],
)

def test_ingest_pq_file(self):
# Before December 2023, LAMP will include trips both revenue and not.
# We should expect to see a few non-revenue trips in the output, and filter them out.
def test_ingest_pq_file_nonrevenue(self):
pq_df_before = pd.read_parquet(
io.BytesIO(self.data),
columns=constants.LAMP_COLUMNS,
Expand All @@ -104,7 +106,9 @@ def test_ingest_pq_file(self):
self.assertEqual(pq_df_after.shape, (16700, 17))
self.assertEqual(set(pq_df_after["service_date"].unique()), {"2023-10-07"})

def test_ingest_pq_file_nonrev(self):
# After December 2023, LAMP will only include trips that are properly revenue.
# Anything labeled as NONREV- or ADDED- after December 2023 are actually considered revenue
def test_ingest_pq_file_revenue(self):
pq_df_before = pd.read_parquet(
io.BytesIO(self.data),
columns=constants.LAMP_COLUMNS,
Expand Down

0 comments on commit c56ebd8

Please sign in to comment.