Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unpin moto, and support moto 5.0 changes #1463

Merged
merged 1 commit into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion requirements/testing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,7 @@ 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
# For AWS tests
moto==4.0.13; python_version=="3.6"
moto<5; python_version=="3.7"
moto<6
12 changes: 8 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,27 @@
import unittest

import boto3
from moto import mock_s3

try:
from moto import mock_aws
except ImportError:
from moto import mock_s3 as 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
12 changes: 8 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,26 @@
import unittest

import boto3
from moto import mock_s3

try:
from moto import mock_aws
except ImportError:
from moto import mock_s3 as 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
Loading