Merge branch 'v0.6' of https://github.com/surbhicis/PyBitmessage into UiChanges
This commit is contained in:
commit
5d927eb124
|
@ -25,6 +25,7 @@ program = None
|
||||||
|
|
||||||
|
|
||||||
def pickle_knownnodes():
|
def pickle_knownnodes():
|
||||||
|
"""Generate old style pickled knownnodes.dat"""
|
||||||
now = time.time()
|
now = time.time()
|
||||||
with open(knownnodes_file, 'wb') as dst:
|
with open(knownnodes_file, 'wb') as dst:
|
||||||
pickle.dump({
|
pickle.dump({
|
||||||
|
@ -40,6 +41,7 @@ def pickle_knownnodes():
|
||||||
|
|
||||||
|
|
||||||
def cleanup():
|
def cleanup():
|
||||||
|
"""Cleanup application files"""
|
||||||
os.remove(knownnodes_file)
|
os.remove(knownnodes_file)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ class TestAPIShutdown(TestAPIProto, TestProcessShutdown):
|
||||||
"""Separate test case for API command 'shutdown'"""
|
"""Separate test case for API command 'shutdown'"""
|
||||||
def test_shutdown(self):
|
def test_shutdown(self):
|
||||||
"""Shutdown the pybitmessage"""
|
"""Shutdown the pybitmessage"""
|
||||||
self.assertEquals(self.api.shutdown(), 'done')
|
self.assertEqual(self.api.shutdown(), 'done')
|
||||||
for _ in range(5):
|
for _ in range(5):
|
||||||
if not self.process.is_running():
|
if not self.process.is_running():
|
||||||
break
|
break
|
||||||
|
|
|
@ -26,6 +26,7 @@ class TestConfig(unittest.TestCase):
|
||||||
False
|
False
|
||||||
)
|
)
|
||||||
# no arg for default
|
# no arg for default
|
||||||
|
# pylint: disable=too-many-function-args
|
||||||
with self.assertRaises(TypeError):
|
with self.assertRaises(TypeError):
|
||||||
BMConfigParser().safeGetBoolean(
|
BMConfigParser().safeGetBoolean(
|
||||||
'nonexistent', 'nonexistent', True)
|
'nonexistent', 'nonexistent', True)
|
||||||
|
@ -47,9 +48,9 @@ class TestProcessConfig(TestProcessProto):
|
||||||
config = BMConfigParser()
|
config = BMConfigParser()
|
||||||
config.read(os.path.join(self.home, 'keys.dat'))
|
config.read(os.path.join(self.home, 'keys.dat'))
|
||||||
|
|
||||||
self.assertEquals(config.safeGetInt(
|
self.assertEqual(config.safeGetInt(
|
||||||
'bitmessagesettings', 'settingsversion'), 10)
|
'bitmessagesettings', 'settingsversion'), 10)
|
||||||
self.assertEquals(config.safeGetInt(
|
self.assertEqual(config.safeGetInt(
|
||||||
'bitmessagesettings', 'port'), 8444)
|
'bitmessagesettings', 'port'), 8444)
|
||||||
# don't connect
|
# don't connect
|
||||||
self.assertTrue(config.safeGetBoolean(
|
self.assertTrue(config.safeGetBoolean(
|
||||||
|
@ -59,7 +60,7 @@ class TestProcessConfig(TestProcessProto):
|
||||||
'bitmessagesettings', 'apienabled'))
|
'bitmessagesettings', 'apienabled'))
|
||||||
|
|
||||||
# extralowdifficulty is false
|
# extralowdifficulty is false
|
||||||
self.assertEquals(config.safeGetInt(
|
self.assertEqual(config.safeGetInt(
|
||||||
'bitmessagesettings', 'defaultnoncetrialsperbyte'), 1000)
|
'bitmessagesettings', 'defaultnoncetrialsperbyte'), 1000)
|
||||||
self.assertEquals(config.safeGetInt(
|
self.assertEqual(config.safeGetInt(
|
||||||
'bitmessagesettings', 'defaultpayloadlengthextrabytes'), 1000)
|
'bitmessagesettings', 'defaultpayloadlengthextrabytes'), 1000)
|
||||||
|
|
Reference in New Issue
Block a user