Skip to content
Snippets Groups Projects
Commit 9c42b2c8 authored by Holger's avatar Holger
Browse files

Fix unit tests

parent 362eea7e
No related branches found
No related tags found
No related merge requests found
......@@ -435,6 +435,8 @@ class Steem(object):
"""Returns the block interval in seconds"""
props = self.get_config(use_stored_data=use_stored_data)
block_interval = 3
if props is None:
return block_interval
for key in props:
if key[-14:] == "BLOCK_INTERVAL":
block_interval = props[key]
......@@ -445,6 +447,8 @@ class Steem(object):
"""Returns the blockchain version"""
props = self.get_config(use_stored_data=use_stored_data)
blockchain_version = '0.0.0'
if props is None:
return blockchain_version
for key in props:
if key[-18:] == "BLOCKCHAIN_VERSION":
blockchain_version = props[key]
......@@ -454,6 +458,8 @@ class Steem(object):
"""Returns the vote dust threshold"""
props = self.get_config(use_stored_data=use_stored_data)
dust_threshold = 0
if props is None:
return dust_threshold
for key in props:
if key[-20:] == "VOTE_DUST_THRESHOLD":
dust_threshold = props[key]
......
......@@ -472,7 +472,7 @@ class Testcases(unittest.TestCase):
def test_sp_to_rshares(self):
stm = self.bts
rshares = stm.sp_to_rshares(stm.vests_to_sp(1e6))
self.assertTrue(abs(rshares - 19950000000.0) < 2)
self.assertTrue(abs(rshares - 20000000000.0) < 2)
def test_rshares_to_vests(self):
stm = self.bts
......
......@@ -164,8 +164,8 @@ class Testcases(unittest.TestCase):
"amount": Amount("0.01 STEEM", steem_instance=steem),
"memo": '1 of 1 transaction'}))
self.assertEqual(
tx["operations"][0][0],
"transfer"
tx["operations"][0]["type"],
"transfer_operation"
)
tx.appendWif(self.active_key)
tx.sign()
......
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