Skip to content

Commit

Permalink
Unpin moto, and support moto 5.0 changes
Browse files Browse the repository at this point in the history
To stop testing with old versions of moto, unpin it from version 3, to
the latest, and also change the test cases to cope with the new
changes.
  • Loading branch information
s-t-e-v-e-n-k committed Feb 19, 2024
1 parent 60b02d6 commit 72460e6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion requirements/testing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ click==8.0.4 # black is affected by https://github.com/pallets/click/issues/222
psutil>=5,<6
# used only under slack_sdk/*_store
boto3<=2
moto>=3,<4 # For AWS tests
moto # For AWS tests
8 changes: 4 additions & 4 deletions tests/slack_sdk/oauth/installation_store/test_amazon_s3.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
import unittest

import boto3
from moto import mock_s3
from moto import mock_aws
from slack_sdk.oauth.installation_store import Installation
from slack_sdk.oauth.installation_store.amazon_s3 import AmazonS3InstallationStore


class TestAmazonS3(unittest.TestCase):
mock_s3 = mock_s3()
mock_aws = mock_aws()
bucket_name = "test-bucket"

def setUp(self):
self.mock_s3.start()
self.mock_aws.start()
s3 = boto3.resource("s3")
bucket = s3.Bucket(self.bucket_name)
bucket.create(CreateBucketConfiguration={"LocationConstraint": "af-south-1"})

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

def build_store(self) -> AmazonS3InstallationStore:
return AmazonS3InstallationStore(
Expand Down
8 changes: 4 additions & 4 deletions tests/slack_sdk/oauth/state_store/test_amazon_s3.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
import unittest

import boto3
from moto import mock_s3
from moto import mock_aws
from slack_sdk.oauth.state_store.amazon_s3 import AmazonS3OAuthStateStore


class TestAmazonS3(unittest.TestCase):
mock_s3 = mock_s3()
mock_aws = mock_aws()
bucket_name = "test-bucket"

def setUp(self):
self.mock_s3.start()
self.mock_aws.start()
s3 = boto3.resource("s3")
bucket = s3.Bucket(self.bucket_name)
bucket.create(CreateBucketConfiguration={"LocationConstraint": "af-south-1"})

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

def test_instance(self):
store = AmazonS3OAuthStateStore(
Expand Down

0 comments on commit 72460e6

Please sign in to comment.