Skip to content

Commit 9dd571e

Browse files
committed
set default region for test and import cleanup
1 parent be90c17 commit 9dd571e

File tree

2 files changed

+8
-15
lines changed

2 files changed

+8
-15
lines changed

src/provider_espressif/main.py

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,12 @@
1-
import warnings
2-
with warnings.catch_warnings():
3-
warnings.filterwarnings("ignore",category=DeprecationWarning)
4-
import botocore
5-
from boto3 import resource, client, s3
6-
import botocore
7-
import boto3
8-
from boto3 import resource, client
9-
from moto import mock_aws, settings
10-
from aws_lambda_powertools.utilities.validation import validate
11-
121
import os
132
import io
143
import json
154
import csv
5+
import botocore
6+
from boto3 import resource, client, s3
7+
import botocore
8+
from moto import mock_aws, settings
9+
from aws_lambda_powertools.utilities.validation import validate
1610
from cryptography import x509
1711
from cryptography.hazmat.backends import default_backend
1812
from cryptography.hazmat.primitives import serialization
@@ -21,8 +15,6 @@
2115
from schemas import INPUT_SCHEMA, OUTPUT_SCHEMA
2216
from testable import LambdaSQSClass, LambdaS3Class
2317

24-
25-
2618
# Given a bucket and object, verify its existence and return the resource.
2719
def s3_object_stream(bucket_name: str, object_name: str):
2820
s3 = resource('s3')

test/unit/src/test_provider_espressif.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,18 @@
22
import os
33
import io
44
import pytest
5-
import warnings
65

76
import botocore
7+
88
from boto3 import resource, client
99
from moto import mock_aws, settings
1010
from aws_lambda_powertools.utilities.validation import validate
1111

1212
from unittest import TestCase
1313
from unittest.mock import MagicMock, patch
1414
sys.path.append('./src/provider_espressif')
15-
from src.provider_espressif.main import LambdaS3Class, LambdaSQSClass # pylint: disable=wrong-import-position
15+
os.environ['AWS_REGION'] = "us-east-1"
16+
from src.provider_espressif.testable import LambdaS3Class, LambdaSQSClass # pylint: disable=wrong-import-position
1617
from src.provider_espressif.main import lambda_handler, s3_filebuf_bytes, invoke_export # pylint: disable=wrong-import-position
1718
from src.provider_espressif.main import s3_object_stream
1819
from src.provider_espressif.main import INPUT_SCHEMA # pylint: disable=wrong-import-position

0 commit comments

Comments
 (0)