aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAlex Schofield <git@ajschof.me>2024-08-20 00:10:40 +0100
committerAlex Schofield <git@ajschof.me>2024-08-20 00:10:40 +0100
commit7c77382fdaf236247a35f35810d66a86923156dd (patch)
treeb75f3ff6c7ea916418920496825e0044336cf2c9 /tests
parent3e80acb28eeeb0eaff97c2363124a8c6e95bcb13 (diff)
downloadde-project-bentley-7c77382fdaf236247a35f35810d66a86923156dd.tar.gz
de-project-bentley-7c77382fdaf236247a35f35810d66a86923156dd.zip
fix(): update expected response message
Diffstat (limited to 'tests')
-rw-r--r--tests/test_extract_lambda.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/test_extract_lambda.py b/tests/test_extract_lambda.py
index 3931cfc..9362a6c 100644
--- a/tests/test_extract_lambda.py
+++ b/tests/test_extract_lambda.py
@@ -72,7 +72,11 @@ class TestLambdaHandler:
]
with patch("src.extract_lambda.connect_to_database", return_value=mock_db):
mock_process_and_upload_tables = mocker.patch(
- "src.extract_lambda.process_and_upload_tables", return_value=mock_db
+ "src.extract_lambda.process_and_upload_tables",
+ return_value={
+ "updated": ["Fruits"],
+ "no change": ["Vegetable", "Berry"],
+ },
)
mock_list_existing_s3_files = mocker.patch(
"src.extract_lambda.list_existing_s3_files", return_value={}
@@ -81,9 +85,9 @@ class TestLambdaHandler:
context = {}
response = lambda_handler(event, context)
assert response["statusCode"] == 200
- assert (
- json.loads(response["body"])
- == "CSV files processed and uploaded successfully."
+ assert json.loads(response["body"]) == (
+ "CSV files processed for Fruits and uploaded successfully."
+ "The following tables were not updated: Vegetable, Berry"
)
mock_list_existing_s3_files.assert_called_once()
mock_process_and_upload_tables.assert_called_once_with(mock_db, {})
git.ajschof.me — hosted by ajschofield — powered by cgit