From f1e10e1a2f573c152b19a630577a71ce9aff2bb4 Mon Sep 17 00:00:00 2001 From: lian-manonog Date: Fri, 23 Aug 2024 16:35:55 +0100 Subject: wip: writing more tests for the helper functions --- tests/test_transform_lambda.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tests/test_transform_lambda.py b/tests/test_transform_lambda.py index 06235f7..00f3d83 100644 --- a/tests/test_transform_lambda.py +++ b/tests/test_transform_lambda.py @@ -1,4 +1,4 @@ -from src.transform_lambda import read_from_s3_subfolder_to_df, list_existing_s3_files +from src.transform_lambda import read_from_s3_subfolder_to_df, list_existing_s3_files, bucket_name from moto import mock_aws import pytest import pandas as pd @@ -120,4 +120,14 @@ class TestListExistingFiles: result = list_existing_s3_files('mock_bucket', client=s3_client) assert result == ["dummy.txt"] - \ No newline at end of file +class TestBucketName: + def test_functions_retrieves_bucket(self, s3_client): + s3_client.create_bucket( + Bucket='mock_bucket', + CreateBucketConfiguration={"LocationConstraint": "eu-west-2"} + ) + + bucket = bucket_name('mock_bucket', s3_client) + assert bucket == 'mock_bucket' + + # def test_ \ No newline at end of file -- cgit v1.2.3