aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_load_lambda.py
diff options
context:
space:
mode:
authorEllie <ecsymonds@gmail.com>2024-08-23 13:22:23 +0100
committerEllie <ecsymonds@gmail.com>2024-08-23 13:22:23 +0100
commit0c95b93303dea04e18aefe57e3b6fef7e4127c3c (patch)
tree05a9de053891f713bc486a34b1fc54d55c1b479e /tests/test_load_lambda.py
parent2e85e8f14f35bebb7e96a9dff7bc59ebaefe32f6 (diff)
downloadde-project-bentley-0c95b93303dea04e18aefe57e3b6fef7e4127c3c.tar.gz
de-project-bentley-0c95b93303dea04e18aefe57e3b6fef7e4127c3c.zip
add working completed tests for get transform bucket
Diffstat (limited to 'tests/test_load_lambda.py')
-rw-r--r--tests/test_load_lambda.py18
1 files changed, 13 insertions, 5 deletions
diff --git a/tests/test_load_lambda.py b/tests/test_load_lambda.py
index 7f001df..f1c2b01 100644
--- a/tests/test_load_lambda.py
+++ b/tests/test_load_lambda.py
@@ -29,11 +29,19 @@ class TestConnectToDBAndReturnEngine:
pass
class TestGetTransformBucket:
- def test_get_transform_bucket_raises_error_if_no_buckets(self, mock_s3_client):
+ def test_raises_value_error_if_no_buckets(self, mock_s3_client):
with pytest.raises(ValueError, match="No transform bucket found"):
get_transform_bucket(mock_s3_client)
- def test_get_transform_bucket_returns_transform_bucket_if_one_bucket(self, mock_s3_client):
+ def test_raises_value_error_if_no_transform_bucket(self, mock_s3_client):
+ mock_s3_client.create_bucket(
+ Bucket="extract_bucket",
+ CreateBucketConfiguration={"LocationConstraint": "eu-west-2"},
+ )
+ with pytest.raises(ValueError, match="No transform bucket found"):
+ get_transform_bucket(mock_s3_client)
+
+ def test_returns_transform_bucket_if_one_bucket(self, mock_s3_client):
mock_s3_client.create_bucket(
Bucket="transform_bucket",
CreateBucketConfiguration={"LocationConstraint": "eu-west-2"},
@@ -41,16 +49,16 @@ class TestGetTransformBucket:
result = get_transform_bucket(mock_s3_client)
assert result == "transform_bucket"
- def test_get_transform_bucket_only_returns_transform_bucket_if_several_buckets(self, mock_s3_client):
+ def test_only_returns_transform_bucket_if_several_buckets(self, mock_s3_client):
mock_s3_client.create_bucket(
- Bucket="extract_bucket",
+ Bucket="another_test_bucket",
CreateBucketConfiguration={"LocationConstraint": "eu-west-2"},
)
result = get_transform_bucket(mock_s3_client)
assert result == "transform_bucket"
class TestConvertParquetToDfs:
- pass
+ pass
class TestUploadDfsToDatabase:
pass \ No newline at end of file
git.ajschof.me — hosted by ajschofield — powered by cgit