Skip to content
Snippets Groups Projects
Commit 4ed70821 authored by Holger's avatar Holger
Browse files

Fix unit tests

parent f829f362
No related branches found
No related tags found
No related merge requests found
......@@ -52,15 +52,8 @@ class Testcases(unittest.TestCase):
cls.start_testnet = num - 25
cls.stop_testnet = num
@parameterized.expand([
("normal"),
("testnet"),
])
def test_blockchain(self, node_param):
if node_param == "normal":
bts = self.bts
else:
bts = self.testnet
def test_blockchain(self):
bts = self.bts
b = Blockchain(steem_instance=bts)
num = b.get_current_block_num()
self.assertTrue(num > 0)
......@@ -74,15 +67,8 @@ class Testcases(unittest.TestCase):
timestamp = int(time.mktime(block.time().timetuple()))
self.assertEqual(block_timestamp, timestamp)
@parameterized.expand([
("normal"),
("testnet"),
])
def test_estimate_block_num(self, node_param):
if node_param == "normal":
bts = self.bts
else:
bts = self.testnet
def test_estimate_block_num(self):
bts = self.bts
b = Blockchain(steem_instance=bts)
last_block = b.get_current_block()
num = last_block.identifier
......@@ -96,15 +82,8 @@ class Testcases(unittest.TestCase):
self.assertTrue((est_block_num - (old_block.identifier)) < 2)
est_block_num = b.get_estimated_block_num(date, estimateForwards=True, accurate=False)
@parameterized.expand([
("normal"),
("testnet"),
])
def test_get_all_accounts(self, node_param):
if node_param == "normal":
bts = self.bts
else:
bts = self.testnet
def test_get_all_accounts(self):
bts = self.bts
b = Blockchain(steem_instance=bts)
accounts = []
limit = 200
......@@ -226,15 +205,8 @@ class Testcases(unittest.TestCase):
break
self.assertTrue(len(ops_blocks) == 1)
@parameterized.expand([
("normal"),
("testnet"),
])
def test_stream2(self, node_param):
if node_param == "normal":
bts = self.bts
else:
bts = self.testnet
def test_stream2(self):
bts = self.bts
b = Blockchain(steem_instance=bts)
stop_block = b.get_current_block_num()
start_block = stop_block - 10
......@@ -243,15 +215,8 @@ class Testcases(unittest.TestCase):
ops_stream.append(op)
self.assertTrue(len(ops_stream) > 0)
@parameterized.expand([
("normal"),
("testnet"),
])
def test_wait_for_and_get_block(self, node_param):
if node_param == "normal":
bts = self.bts
else:
bts = self.testnet
def test_wait_for_and_get_block(self):
bts = self.bts
b = Blockchain(steem_instance=bts, max_block_wait_repetition=18)
start_num = b.get_current_block_num()
blocknum = start_num
......
......@@ -274,7 +274,7 @@ class Testcases(unittest.TestCase):
runner.invoke(cli, ['-o', 'set', 'nodes', str(self.nodelist.get_testnet())])
result = runner.invoke(cli, ['-d', 'newaccount', 'beem3'], input="test\ntest\ntest\n")
self.assertEqual(result.exit_code, 0)
result = runner.invoke(cli, ['-d', 'newaccount', '--fee', '6 STEEM', 'beem3'], input="test\ntest\ntest\n")
result = runner.invoke(cli, ['-d', 'newaccount', 'beem3'], input="test\ntest\ntest\n")
self.assertEqual(result.exit_code, 0)
def test_importaccount(self):
......
......@@ -33,12 +33,6 @@ class Testcases(unittest.TestCase):
keys={"active": wif},
num_retries=10
)
cls.testnet = Steem(
node="https://testnet.steemitdev.com",
nobroadcast=True,
keys={"active": wif},
num_retries=10
)
# from getpass import getpass
# self.bts.wallet.unlock(getpass())
set_shared_steem_instance(cls.bts)
......@@ -86,7 +80,7 @@ class Testcases(unittest.TestCase):
self.assertEqual(len(d), 10)
def test_cashout(self):
bts = self.testnet
bts = self.bts
query = Query(limit=10)
Discussions_by_cashout(query, steem_instance=bts)
# self.assertEqual(len(d), 10)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment