From d32b5dea18065c0043d9e3ad35133c5cb88b6eeb Mon Sep 17 00:00:00 2001 From: Dmitri Bogomolov <4glitch@gmail.com> Date: Mon, 22 Jul 2019 17:55:33 +0300 Subject: [PATCH] Trying to use the _settings --- src/bitmessagemain.py | 12 ++++++------ src/tests/test_api.py | 10 +++++++--- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/bitmessagemain.py b/src/bitmessagemain.py index dbc88de9..ebaa74ef 100755 --- a/src/bitmessagemain.py +++ b/src/bitmessagemain.py @@ -219,12 +219,12 @@ class Main: state.last_api_response = time.time() # Apply special settings config = BMConfigParser() - config.set( - 'bitmessagesettings', 'apienabled', 'true') - config.set( - 'bitmessagesettings', 'apiusername', 'username') - config.set( - 'bitmessagesettings', 'apipassword', 'password') + # config.set( + # 'bitmessagesettings', 'apienabled', 'true') + # config.set( + # 'bitmessagesettings', 'apiusername', 'username') + # config.set( + # 'bitmessagesettings', 'apipassword', 'password') config.set( 'bitmessagesettings', 'apinotifypath', os.path.join(app_dir, 'tests', 'apinotify_handler.py') diff --git a/src/tests/test_api.py b/src/tests/test_api.py index 2bb6d0ce..81023e0f 100644 --- a/src/tests/test_api.py +++ b/src/tests/test_api.py @@ -4,8 +4,8 @@ Tests using API. import base64 import json +import time import xmlrpclib # nosec -from time import sleep from test_process import TestProcessProto @@ -16,6 +16,11 @@ class TestAPI(TestProcessProto): _seed = base64.encodestring( 'TIGER, tiger, burning bright. In the forests of the night' ) + _settings = { + 'apienabled': 'true', + 'apiusername': 'username', + 'apipassword': 'password' + } @classmethod def setUpClass(cls): @@ -26,9 +31,8 @@ class TestAPI(TestProcessProto): "http://username:password@127.0.0.1:8442/") for _ in range(0, 5): if cls._get_readline('.api_started'): - print('API start detected!') return - sleep(1) + time.sleep(1) def _add_random_address(self, label): return self.api.createRandomAddress(base64.encodestring(label))