-
Notifications
You must be signed in to change notification settings - Fork 2
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 #170 from mesoscope/feature/firebase-upload-gradients
Feature/firebase upload gradients
- Loading branch information
Showing
6 changed files
with
139 additions
and
12 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 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from cellpack.autopack.DBRecipeHandler import GradientDoc | ||
from cellpack.tests.mocks.mock_db import MockDB | ||
|
||
mock_db = MockDB({}) | ||
|
||
|
||
def test_should_write_with_no_existing_doc(): | ||
gradient_doc = GradientDoc({"name": "test_grad_name", "test_key": "test_value"}) | ||
doc, doc_id = gradient_doc.should_write(mock_db, "test_grad_name") | ||
assert doc_id is None | ||
assert doc is None | ||
|
||
|
||
def test_should_write_with_existing_doc(): | ||
existing_doc = {"name": "test_grad_name", "test_key": "test_value"} | ||
mock_db.data = existing_doc | ||
gradient_doc = GradientDoc({"name": "test_grad_name", "test_key": "test_value"}) | ||
|
||
doc, doc_id = gradient_doc.should_write(mock_db, "test_grad_name") | ||
assert doc_id is not None | ||
assert doc is not None |