6
6
7
7
import boto3
8
8
from maggma .stores import MemoryStore
9
- from moto import mock_s3
9
+ from moto import mock_aws
10
10
11
11
__author__ = "Jimmy Shen <[email protected] >"
12
12
@@ -37,7 +37,7 @@ def tearDownClass(cls):
37
37
cls .testdb .connection .drop_database (cls .testdb .db_name )
38
38
39
39
def test_s3_valid (self ):
40
- with mock_s3 ():
40
+ with mock_aws ():
41
41
conn = boto3 .resource ("s3" , region_name = "us-east-1" )
42
42
conn .create_bucket (Bucket = "test_bucket" )
43
43
index_store = MemoryStore ()
@@ -50,7 +50,7 @@ def test_s3_valid(self):
50
50
self .assertEqual (res ["data" ], "111111111110111111" )
51
51
52
52
def test_s3_not_valid (self ):
53
- with mock_s3 ():
53
+ with mock_aws ():
54
54
conn = boto3 .resource ("s3" , region_name = "us-east-1" )
55
55
conn .create_bucket (Bucket = "test_bucket_2" )
56
56
index_store = MemoryStore ()
@@ -61,7 +61,7 @@ def test_s3_not_valid(self):
61
61
store .connect ()
62
62
63
63
def test_maggma_store_names (self ):
64
- with mock_s3 ():
64
+ with mock_aws ():
65
65
conn = boto3 .resource ("s3" , region_name = "us-east-1" )
66
66
conn .create_bucket (Bucket = "test_bucket" )
67
67
index_store = MemoryStore ()
@@ -84,7 +84,7 @@ def test_uri(self):
84
84
calc_db .collection .insert_one ({"task_id" : "mp-1" , "data" : "12345" })
85
85
self .assertEqual (calc_db .collection .find_one ()["data" ], "12345" )
86
86
87
- with mock_s3 ():
87
+ with mock_aws ():
88
88
conn = boto3 .resource ("s3" , region_name = "us-east-1" )
89
89
conn .create_bucket (Bucket = "test_bucket" )
90
90
uri_db = TestToDb .from_db_file (db_dir + "/db_aws_uri.json" )
0 commit comments