"""
Various tests for config
import os
import tempfile
from test_process import TestProcessProto
from pybitmessage.bmconfigparser import BMConfigParser
class TestProcessConfig(TestProcessProto):
"""A test case for keys.dat"""
home = tempfile.mkdtemp()
def test_config_defaults(self):
"""Test settings in the generated config"""
config = BMConfigParser()
config.read(os.path.join(self.home, 'keys.dat'))
self.assertEqual(config.safeGetInt(
'bitmessagesettings', 'settingsversion'), 10)
'bitmessagesettings', 'port'), 8444)
# don't connect
self.assertTrue(config.safeGetBoolean(
'bitmessagesettings', 'dontconnect'))
# API disabled
self.assertFalse(config.safeGetBoolean(
'bitmessagesettings', 'apienabled'))
# extralowdifficulty is false
'bitmessagesettings', 'defaultnoncetrialsperbyte'), 1000)
'bitmessagesettings', 'defaultpayloadlengthextrabytes'), 1000)