-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
65 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,3 +12,4 @@ venv/ | |
.tox/ | ||
coverage/ | ||
.coverage | ||
.cache |
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,53 @@ | ||
import unittest | ||
import unittest.mock as mock | ||
import xcat.db as db | ||
import xcat.tests.utils as utils | ||
|
||
|
||
class TestDB(unittest.TestCase): | ||
|
||
@mock.patch('xcat.db.plyvel') | ||
def setUp(self, mock_plyvel): | ||
self.db = db.DB() | ||
|
||
def test_init(self): | ||
self.assertIsInstance(self.db.db, mock.Mock) | ||
self.assertIsInstance(self.db.preimageDB, mock.Mock) | ||
|
||
@mock.patch('xcat.db.json') | ||
def test_create_with_dict(self, mock_json): | ||
test_id = 'test trade id' | ||
trade_string = 'trade string' | ||
mock_json.dumps.return_value = trade_string | ||
test_trade = utils.test_trade | ||
|
||
self.db.create(test_trade, test_id) | ||
|
||
mock_json.dumps.assert_called_with(test_trade) | ||
self.db.db.put.assert_called_with( | ||
str.encode(test_id), | ||
str.encode(trade_string)) | ||
|
||
def test_create_with_trade(self): | ||
pass | ||
|
||
def test_createByFundtx(self): | ||
pass | ||
|
||
def test_get(self): | ||
pass | ||
|
||
def test_instantiate(self): | ||
pass | ||
|
||
def test_save_secret(self): | ||
pass | ||
|
||
def test_get_secret(self): | ||
pass | ||
|
||
def test_dump(self): | ||
pass | ||
|
||
def test_print_entries(self): | ||
pass |