aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_extract_lambda.py
diff options
context:
space:
mode:
authorAlex Schofield <git@ajschof.me>2024-08-22 12:05:30 +0100
committerAlex Schofield <git@ajschof.me>2024-08-22 12:05:30 +0100
commit6cfe607e1e1d25784a3ca0f54a76647efa9f4bd8 (patch)
tree6c69c7ed5b4002437f306d7ddc362aa1f5770c9d /tests/test_extract_lambda.py
parent82a835363953538e506f91eb3199d835f0624975 (diff)
downloadde-project-bentley-6cfe607e1e1d25784a3ca0f54a76647efa9f4bd8.tar.gz
de-project-bentley-6cfe607e1e1d25784a3ca0f54a76647efa9f4bd8.zip
fix: mock aws services before importing src functions
Diffstat (limited to 'tests/test_extract_lambda.py')
-rw-r--r--tests/test_extract_lambda.py20
1 files changed, 11 insertions, 9 deletions
diff --git a/tests/test_extract_lambda.py b/tests/test_extract_lambda.py
index ee677bd..1266cbb 100644
--- a/tests/test_extract_lambda.py
+++ b/tests/test_extract_lambda.py
@@ -8,15 +8,6 @@ from unittest import TestCase
import os
import logging
import json
-from src.extract_lambda import (
- list_existing_s3_files,
- connect_to_database,
- DBConnectionException,
- lambda_handler,
- process_and_upload_tables,
- retrieve_secrets,
- extract_bucket,
-)
from pg8000.native import InterfaceError
@@ -73,6 +64,17 @@ def s3_mock_bucket(s3_client):
return bucket
+from src.extract_lambda import ( # noqa: E402
+ list_existing_s3_files,
+ connect_to_database,
+ DBConnectionException,
+ lambda_handler,
+ process_and_upload_tables,
+ retrieve_secrets,
+ extract_bucket,
+)
+
+
class TestLambdaHandler:
def test_files_processed_and_uploaded_successfully(self, mocker):
mock_db = MagicMock()
git.ajschof.me — hosted by ajschofield — powered by cgit