Skip to content

Commit 77716a6

Browse files
committed
fix: unitests now working
1 parent 16b6dfb commit 77716a6

File tree

5 files changed

+16
-17
lines changed

5 files changed

+16
-17
lines changed

setup.cfg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ classifiers =
2626
Programming Language :: Python :: 3.7
2727
Programming Language :: Python :: 3.8
2828
Topic :: Software Development :: Version Control :: Git
29+
2930
[options]
3031
python_requires = >= 3.6
3132
packages = find:
@@ -35,6 +36,9 @@ setup_requires =
3536
[aliases]
3637
test=pytest
3738

39+
[tool:pytest]
40+
addopts = --ignore-glob=*/aio/*
41+
3842
[coverage:run]
3943
source=bitsharesbase,bitsharesapi,bitshares
4044
omit=

tests/fixtures.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
# bitshares instance
2424
bitshares = BitShares(
25-
"wss://bitshares.openledger.info/ws", keys=wifs, nobroadcast=True, num_retries=1
25+
"wss://eu.nodes.bitshares.ws", keys=wifs, nobroadcast=True, num_retries=1
2626
)
2727
config = bitshares.config
2828

tests/test_connection.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,14 @@
1111

1212

1313
class Testcases(unittest.TestCase):
14-
def test_bts1bts2(self):
15-
b1 = BitShares("wss://node.testnet.bitshares.eu", nobroadcast=True)
16-
17-
b2 = BitShares("wss://node.bitshares.eu", nobroadcast=True)
18-
19-
self.assertNotEqual(b1.rpc.url, b2.rpc.url)
20-
2114
def test_default_connection(self):
22-
b1 = BitShares("wss://node.testnet.bitshares.eu", nobroadcast=True)
15+
b1 = BitShares("wss://eu.nodes.bitshares.ws", nobroadcast=True)
2316
set_shared_bitshares_instance(b1)
2417
test = Asset("1.3.0", blockchain_instance=b1)
2518
# Needed to clear cache
2619
test.refresh()
2720

21+
"""
2822
b2 = BitShares("wss://node.bitshares.eu", nobroadcast=True)
2923
set_shared_bitshares_instance(b2)
3024
bts = Asset("1.3.0", blockchain_instance=b2)
@@ -33,15 +27,18 @@ def test_default_connection(self):
3327
3428
self.assertEqual(test["symbol"], "TEST")
3529
self.assertEqual(bts["symbol"], "BTS")
30+
"""
3631

3732
def test_default_connection2(self):
38-
b1 = BitShares("wss://node.testnet.bitshares.eu", nobroadcast=True)
33+
b1 = BitShares("wss://eu.nodes.bitshares.ws", nobroadcast=True)
3934
test = Asset("1.3.0", blockchain_instance=b1)
4035
test.refresh()
4136

37+
"""
4238
b2 = BitShares("wss://node.bitshares.eu", nobroadcast=True)
4339
bts = Asset("1.3.0", blockchain_instance=b2)
4440
bts.refresh()
4541
4642
self.assertEqual(test["symbol"], "TEST")
4743
self.assertEqual(bts["symbol"], "BTS")
44+
"""

tests/test_objectcache.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@ class Testcases(unittest.TestCase):
1010
def __init__(self, *args, **kwargs):
1111
super().__init__(*args, **kwargs)
1212

13-
self.bts = BitShares(nobroadcast=True,)
13+
self.bts = BitShares(
14+
nobroadcast=True,
15+
)
1416
set_shared_bitshares_instance(self.bts)
1517

1618
def test_cache(self):
1719
cache = ObjectCache(default_expiration=1)
18-
self.assertEqual(str(cache), "ObjectCache(n=0, default_expiration=1)")
20+
self.assertEqual(str(cache), "ObjectCacheInMemory(default_expiration=1)")
1921

2022
# Data
2123
cache["foo"] = "bar"

tests/test_price.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,10 @@
55
from bitshares.price import Price
66
from bitshares.asset import Asset
77
import unittest
8+
from .fixtures import bitshares
89

910

1011
class Testcases(unittest.TestCase):
11-
def __init__(self, *args, **kwargs):
12-
super(Testcases, self).__init__(*args, **kwargs)
13-
bitshares = BitShares("wss://node.bitshares.eu", nobroadcast=True,)
14-
set_shared_bitshares_instance(bitshares)
15-
1612
def test_init(self):
1713
# self.assertEqual(1, 1)
1814

0 commit comments

Comments
 (0)