Trying to use the _settings
This commit is contained in:
parent
0975099e36
commit
d32b5dea18
|
@ -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')
|
||||
|
|
|
@ -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))
|
||||
|
|
Reference in New Issue
Block a user