tMerge pull request #1885 from thokon00/fix_test - electrum - Electrum Bitcoin wallet (HTM) git clone https://git.parazyd.org/electrum (DIR) Log (DIR) Files (DIR) Refs (DIR) Submodules --- (DIR) commit 6373a76a4a80038936a2c4201b021e1b33c8e8bd (DIR) parent ecf398c95e0b69892f714d4e6428e50c54403169 (HTM) Author: ThomasV <thomasv@electrum.org> Date: Thu, 4 Aug 2016 23:08:20 +0200 Merge pull request #1885 from thokon00/fix_test fix test_simple_config and test_transaction Diffstat: M lib/tests/test_simple_config.py | 3 ++- M lib/tests/test_transaction.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) --- (DIR) diff --git a/lib/tests/test_simple_config.py b/lib/tests/test_simple_config.py t@@ -4,6 +4,7 @@ import os import unittest import tempfile import shutil +import json from StringIO import StringIO from lib.simple_config import (SimpleConfig, read_system_config, t@@ -233,7 +234,7 @@ class TestUserConfig(unittest.TestCase): thefile = os.path.join(self.user_dir, "config") payload = {"gap_limit": 5} with open(thefile, "w") as f: - f.write(repr(payload)) + f.write(json.dumps(payload)) result = read_user_config(self.user_dir) self.assertEqual(payload, result) (DIR) diff --git a/lib/tests/test_transaction.py b/lib/tests/test_transaction.py t@@ -77,7 +77,7 @@ class TestTransaction(unittest.TestCase): self.assertEquals(tx.deserialize(), expected) self.assertEquals(tx.deserialize(), None) - self.assertEquals(tx.as_dict(), {'hex': unsigned_blob, 'complete': False}) + self.assertEquals(tx.as_dict(), {'hex': unsigned_blob, 'complete': False, 'final': True}) self.assertEquals(tx.get_outputs(), [('14CHYaaByjJZpx4oHBpfDMdqhTyXnZ3kVs', 1000000)]) self.assertEquals(tx.get_output_addresses(), ['14CHYaaByjJZpx4oHBpfDMdqhTyXnZ3kVs']) t@@ -121,7 +121,7 @@ class TestTransaction(unittest.TestCase): tx = transaction.Transaction(signed_blob) self.assertEquals(tx.deserialize(), expected) self.assertEquals(tx.deserialize(), None) - self.assertEquals(tx.as_dict(), {'hex': signed_blob, 'complete': True}) + self.assertEquals(tx.as_dict(), {'hex': signed_blob, 'complete': True, 'final': True}) self.assertEquals(tx.inputs_to_sign(), set()) self.assertEquals(tx.serialize(), signed_blob)