File tree Expand file tree Collapse file tree 3 files changed +20
-9
lines changed
Expand file tree Collapse file tree 3 files changed +20
-9
lines changed Original file line number Diff line number Diff line change @@ -14,4 +14,7 @@ click==8.0.4 # black is affected by https://github.com/pallets/click/issues/222
1414psutil>=5,<6
1515# used only under slack_sdk/*_store
1616boto3<=2
17- moto>=3,<4 # For AWS tests
17+ # For AWS tests
18+ moto==4.0.13; python_version=="3.6"
19+ moto<5; python_version=="3.7"
20+ moto<6
Original file line number Diff line number Diff line change 11import unittest
22
33import boto3
4- from moto import mock_s3
4+
5+ try :
6+ from moto import mock_aws
7+ except ImportError :
8+ from moto import mock_s3 as mock_aws
59from slack_sdk .oauth .installation_store import Installation
610from slack_sdk .oauth .installation_store .amazon_s3 import AmazonS3InstallationStore
711
812
913class TestAmazonS3 (unittest .TestCase ):
10- mock_s3 = mock_s3 ()
14+ mock_aws = mock_aws ()
1115 bucket_name = "test-bucket"
1216
1317 def setUp (self ):
14- self .mock_s3 .start ()
18+ self .mock_aws .start ()
1519 s3 = boto3 .resource ("s3" )
1620 bucket = s3 .Bucket (self .bucket_name )
1721 bucket .create (CreateBucketConfiguration = {"LocationConstraint" : "af-south-1" })
1822
1923 def tearDown (self ):
20- self .mock_s3 .stop ()
24+ self .mock_aws .stop ()
2125
2226 def build_store (self ) -> AmazonS3InstallationStore :
2327 return AmazonS3InstallationStore (
Original file line number Diff line number Diff line change 11import unittest
22
33import boto3
4- from moto import mock_s3
4+
5+ try :
6+ from moto import mock_aws
7+ except ImportError :
8+ from moto import mock_s3 as mock_aws
59from slack_sdk .oauth .state_store .amazon_s3 import AmazonS3OAuthStateStore
610
711
812class TestAmazonS3 (unittest .TestCase ):
9- mock_s3 = mock_s3 ()
13+ mock_aws = mock_aws ()
1014 bucket_name = "test-bucket"
1115
1216 def setUp (self ):
13- self .mock_s3 .start ()
17+ self .mock_aws .start ()
1418 s3 = boto3 .resource ("s3" )
1519 bucket = s3 .Bucket (self .bucket_name )
1620 bucket .create (CreateBucketConfiguration = {"LocationConstraint" : "af-south-1" })
1721
1822 def tearDown (self ):
19- self .mock_s3 .stop ()
23+ self .mock_aws .stop ()
2024
2125 def test_instance (self ):
2226 store = AmazonS3OAuthStateStore (
You can’t perform that action at this time.
0 commit comments