aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_extract_lambda.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_extract_lambda.py')
-rw-r--r--tests/test_extract_lambda.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/test_extract_lambda.py b/tests/test_extract_lambda.py
index bba433c..8fa0e88 100644
--- a/tests/test_extract_lambda.py
+++ b/tests/test_extract_lambda.py
@@ -195,8 +195,14 @@ class TestListExistingS3Files:
logger.info("Testing now.")
caplog.set_level(logging.ERROR)
- with pytest.raises(ValueError, match="No extract_bucket found"):
- list_existing_s3_files(client=s3_client)
+ # Mock the extract_bucket function to raise a ValueError!
+ with patch(
+ "src.extract_lambda.extract_bucket",
+ side_effect=ValueError("No extract_bucket found"),
+ ):
+ with pytest.raises(ValueError, match="No extract_bucket found"):
+ list_existing_s3_files(client=s3_client)
+
assert "Error listing S3 objects" in caplog.text
def test_error_if_bucket_is_empty(self, s3_client, caplog, s3_mock_bucket):
git.ajschof.me — hosted by ajschofield — powered by cgit