remove defunct test, add random bint ip test, and fix offline mode

This commit is contained in:
Kevin Froman 2020-01-27 19:32:25 -06:00
parent ef25377e15
commit a1fd5f2648
3 changed files with 24 additions and 23 deletions

View File

@ -84,13 +84,14 @@ def daemon():
shared_state.share_object() # share the parent object to the threads
apiHost = ''
while apiHost == '':
try:
with open(filepaths.public_API_host_file, 'r') as hostFile:
apiHost = hostFile.read()
except FileNotFoundError:
pass
time.sleep(0.5)
if not offline_mode:
while apiHost == '':
try:
with open(filepaths.public_API_host_file, 'r') as hostFile:
apiHost = hostFile.read()
except FileNotFoundError:
pass
time.sleep(0.5)
logger.raw('', terminal=True)
# print nice header thing :)

View File

@ -1,16 +0,0 @@
import sys, os
sys.path.append(".")
sys.path.append("src/")
import unittest, uuid, json
TEST_DIR = 'testdata/%s-%s' % (uuid.uuid4(), os.path.basename(__file__)) + '/'
print("Test directory:", TEST_DIR)
os.environ["ONIONR_HOME"] = TEST_DIR
import onionrblocks
from utils import createdirs
from utils import readstatic
createdirs.create_dirs()
class OnionrConfigTest(unittest.TestCase):
def test_security_value(self):
return
unittest.main()

View File

@ -0,0 +1,16 @@
import sys, os
sys.path.append(".")
sys.path.append("src/")
import unittest, uuid
TEST_DIR = 'testdata/%s-%s' % (uuid.uuid4(), os.path.basename(__file__)) + '/'
print("Test directory:", TEST_DIR)
os.environ["ONIONR_HOME"] = TEST_DIR
from onionrsetup import setup_config
setup_config()
import config
class TestRandomBindIP(unittest.TestCase):
def test_random_bind_ip_default_setting(self):
self.assertTrue(config.get('general.random_bind_ip'))
unittest.main()