-
Notifications
You must be signed in to change notification settings - Fork 166
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Finish up unittests using new caching system
- Loading branch information
Showing
3 changed files
with
29 additions
and
57 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,35 @@ | ||
|
||
# -*- coding: utf-8 -*- | ||
import unittest | ||
from bitshares import BitShares | ||
from bitshares.asset import Asset | ||
from bitshares.instance import set_shared_bitshares_instance, SharedInstance | ||
from bitshares.blockchainobject import BlockchainObject | ||
|
||
import logging | ||
|
||
log = logging.getLogger() | ||
|
||
|
||
class Testcases(unittest.TestCase): | ||
|
||
def test_bts1bts2(self): | ||
b1 = BitShares( | ||
"wss://node.testnet.bitshares.eu", | ||
nobroadcast=True, | ||
) | ||
b1 = BitShares("wss://node.testnet.bitshares.eu", nobroadcast=True) | ||
|
||
b2 = BitShares( | ||
"wss://node.bitshares.eu", | ||
nobroadcast=True, | ||
) | ||
b2 = BitShares("wss://node.bitshares.eu", nobroadcast=True) | ||
|
||
self.assertNotEqual(b1.rpc.url, b2.rpc.url) | ||
|
||
def test_default_connection(self): | ||
b1 = BitShares( | ||
"wss://node.testnet.bitshares.eu", | ||
nobroadcast=True, | ||
) | ||
b1 = BitShares("wss://node.testnet.bitshares.eu", nobroadcast=True) | ||
set_shared_bitshares_instance(b1) | ||
test = Asset("1.3.0") | ||
test = Asset("1.3.0", blockchain_instance=b1) | ||
# Needed to clear cache | ||
test.refresh() | ||
|
||
b2 = BitShares( | ||
"wss://node.bitshares.eu", | ||
nobroadcast=True, | ||
) | ||
b2 = BitShares("wss://node.bitshares.eu", nobroadcast=True) | ||
set_shared_bitshares_instance(b2) | ||
|
||
bts = Asset("1.3.0") | ||
bts = Asset("1.3.0", blockchain_instance=b2) | ||
# Needed to clear cache | ||
bts.refresh() | ||
|
||
self.assertEqual(test["symbol"], "TEST") | ||
self.assertEqual(bts["symbol"], "BTS") |