forked from bitshares/python-bitshares
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_connection.py
More file actions
44 lines (35 loc) · 1.34 KB
/
test_connection.py
File metadata and controls
44 lines (35 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# -*- 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_default_connection(self):
b1 = BitShares("wss://eu.nodes.bitshares.ws", nobroadcast=True)
set_shared_bitshares_instance(b1)
test = Asset("1.3.0", blockchain_instance=b1)
# Needed to clear cache
test.refresh()
"""
b2 = BitShares("wss://node.bitshares.eu", nobroadcast=True)
set_shared_bitshares_instance(b2)
bts = Asset("1.3.0", blockchain_instance=b2)
# Needed to clear cache
bts.refresh()
self.assertEqual(test["symbol"], "TEST")
self.assertEqual(bts["symbol"], "BTS")
"""
def test_default_connection2(self):
b1 = BitShares("wss://eu.nodes.bitshares.ws", nobroadcast=True)
test = Asset("1.3.0", blockchain_instance=b1)
test.refresh()
"""
b2 = BitShares("wss://node.bitshares.eu", nobroadcast=True)
bts = Asset("1.3.0", blockchain_instance=b2)
bts.refresh()
self.assertEqual(test["symbol"], "TEST")
self.assertEqual(bts["symbol"], "BTS")
"""