diff --git a/analytics/tests/integrations/extracts/test_load_opportunity_data.py b/analytics/tests/integrations/extracts/test_load_opportunity_data.py index 6e7c8fb52..1fa5c1690 100644 --- a/analytics/tests/integrations/extracts/test_load_opportunity_data.py +++ b/analytics/tests/integrations/extracts/test_load_opportunity_data.py @@ -55,12 +55,29 @@ def test_extract_copy_opportunity_data( # Verify that the data was inserted into the database with conn.begin(): - - result = conn.execute( - text("SELECT opportunity_id FROM test_schema.opportunity ;"), + lk_opp_sts_result = conn.execute( + text("SELECT COUNT(*) FROM test_schema.lk_opportunity_status ;"), + ) + lk_opp_ctgry_result = conn.execute( + text("SELECT COUNT(*) FROM test_schema.lk_opportunity_category ;"), + ) + opp_result = conn.execute( + text("SELECT COUNT(*) FROM test_schema.opportunity ;"), + ) + opp_smry_result = conn.execute( + text("SELECT COUNT(*) FROM test_schema.opportunity_summary ;"), ) - rows = result.fetchall() + curr_opp_smry_result = conn.execute( + text("SELECT COUNT(*) FROM test_schema.current_opportunity_summary ;"), + ) + # test all test_files were upload to mocks3 bucket assert upload_opportunity_tables_s3 == 5 - assert len(rows) == 37 + + # test table records were inserted for each table + assert lk_opp_sts_result.fetchone()[0] == 4 + assert lk_opp_ctgry_result.fetchone()[0] == 5 + assert opp_result.fetchone()[0] == 37 + assert opp_smry_result.fetchone()[0] == 32 + assert curr_opp_smry_result.fetchone()[0] == 32 diff --git a/api/src/constants/schema.py b/api/src/constants/schema.py index 3a1f5935a..01d0ce2e4 100644 --- a/api/src/constants/schema.py +++ b/api/src/constants/schema.py @@ -4,4 +4,4 @@ class Schemas(StrEnum): API = "api" LEGACY = "legacy" - STAGING = "staging" \ No newline at end of file + STAGING = "staging"