Skip to content

Commit

Permalink
Bump moto from 4.2.13 to 5.0.5 (#871)
Browse files Browse the repository at this point in the history
From the 5.0.0 changelog:
* All decorators have been replaced with a single decorator: `mock_aws`

Signed-off-by: SuperQ <[email protected]>
  • Loading branch information
SuperQ authored Apr 11, 2024
1 parent 6c2b340 commit da257b5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion requirements-transitive.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ kombu==5.3.5
lazy-object-proxy==1.4.3
MarkupSafe==2.1.5
mccabe==0.7.0
moto==4.2.13
moto==5.0.5
mypy-extensions==1.0.0
ndg-httpsclient==0.5.1
netifaces==0.11.0
Expand Down
10 changes: 5 additions & 5 deletions tests/unit/sidecars/live_data_watcher_loader_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

from botocore.response import StreamingBody
from botocore.stub import Stubber
from moto import mock_s3
from moto import mock_aws

from baseplate.sidecars.live_data_watcher import _load_from_s3
from baseplate.sidecars.live_data_watcher import _parse_loader_type
Expand All @@ -19,13 +19,13 @@


@pytest.fixture()
def start_mock_s3():
with mock_s3():
def start_mock_aws():
with mock_aws():
yield


@pytest.fixture()
def s3_stub(start_mock_s3):
def s3_stub(start_mock_aws):
s3 = botocore.session.get_session().create_client("s3")
with Stubber(s3) as stubber:
with mock.patch("baseplate.sidecars.live_data_watcher.boto3.client") as client:
Expand Down Expand Up @@ -64,7 +64,7 @@ def test_parse_loader_type(data, return_value):
"sse_key",
),
)
def test_load_from_s3_missing_config(start_mock_s3, missing_config):
def test_load_from_s3_missing_config(start_mock_aws, missing_config):
data = {
"region_name": "some_region",
"bucket_name": "some_bucket",
Expand Down
8 changes: 4 additions & 4 deletions tests/unit/sidecars/live_data_watcher_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import boto3

from moto import mock_s3
from moto import mock_aws

from baseplate.sidecars.live_data_watcher import _generate_sharded_file_key
from baseplate.sidecars.live_data_watcher import NodeWatcher
Expand All @@ -22,10 +22,10 @@


class NodeWatcherTests(unittest.TestCase):
mock_s3 = mock_s3()
mock_aws = mock_aws()

def setUp(self):
self.mock_s3.start()
self.mock_aws.start()
bucket_name = "test_bucket"
s3_data = {"foo_encrypted": "bar_encrypted"}
s3_client = boto3.client(
Expand All @@ -50,7 +50,7 @@ def setUp(self):
)

def tearDown(self):
self.mock_s3.stop()
self.mock_aws.stop()

def run(self, result: unittest.TestResult = None) -> unittest.TestResult:
with tempfile.TemporaryDirectory(prefix=self.id()) as loc:
Expand Down

0 comments on commit da257b5

Please sign in to comment.