-
Notifications
You must be signed in to change notification settings - Fork 175
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #789 from Zhuoying/fix-ld-wf
Initiate rebased branch for lattice dynamics
- Loading branch information
Showing
26 changed files
with
6,303 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,10 +3,9 @@ | |
""" | ||
import os | ||
import unittest | ||
|
||
import boto3 | ||
from maggma.stores import MemoryStore | ||
from moto import mock_s3 | ||
from moto import mock_aws | ||
|
||
__author__ = "Jimmy Shen <[email protected]>" | ||
|
||
|
@@ -19,7 +18,15 @@ | |
logger = get_logger(__name__) | ||
|
||
|
||
|
||
|
||
class TestToDb(CalcDb): | ||
def setup_method(self,method): | ||
self.reset() | ||
|
||
def teardown_method(self,method): | ||
pass | ||
|
||
def build_indexes(self, indexes=None, background=True): | ||
pass | ||
|
||
|
@@ -37,7 +44,7 @@ def tearDownClass(cls): | |
cls.testdb.connection.drop_database(cls.testdb.db_name) | ||
|
||
def test_s3_valid(self): | ||
with mock_s3(): | ||
with mock_aws(): | ||
conn = boto3.resource("s3", region_name="us-east-1") | ||
conn.create_bucket(Bucket="test_bucket") | ||
index_store = MemoryStore() | ||
|
@@ -50,7 +57,7 @@ def test_s3_valid(self): | |
self.assertEqual(res["data"], "111111111110111111") | ||
|
||
def test_s3_not_valid(self): | ||
with mock_s3(): | ||
with mock_aws(): | ||
conn = boto3.resource("s3", region_name="us-east-1") | ||
conn.create_bucket(Bucket="test_bucket_2") | ||
index_store = MemoryStore() | ||
|
@@ -61,7 +68,7 @@ def test_s3_not_valid(self): | |
store.connect() | ||
|
||
def test_maggma_store_names(self): | ||
with mock_s3(): | ||
with mock_aws(): | ||
conn = boto3.resource("s3", region_name="us-east-1") | ||
conn.create_bucket(Bucket="test_bucket") | ||
index_store = MemoryStore() | ||
|
@@ -84,7 +91,7 @@ def test_uri(self): | |
calc_db.collection.insert_one({"task_id": "mp-1", "data": "12345"}) | ||
self.assertEqual(calc_db.collection.find_one()["data"], "12345") | ||
|
||
with mock_s3(): | ||
with mock_aws(): | ||
conn = boto3.resource("s3", region_name="us-east-1") | ||
conn.create_bucket(Bucket="test_bucket") | ||
uri_db = TestToDb.from_db_file(db_dir + "/db_aws_uri.json") | ||
|
Oops, something went wrong.