Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
babebe committed Dec 16, 2024
1 parent ac4f968 commit e312509
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion api/src/constants/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
class Schemas(StrEnum):
API = "api"
LEGACY = "legacy"
STAGING = "staging"
STAGING = "staging"

0 comments on commit e312509

Please sign in to comment.