diff --git a/src/onionrcommands/daemonlaunch.py b/src/onionrcommands/daemonlaunch.py index 4dd705f8..ef13ea66 100755 --- a/src/onionrcommands/daemonlaunch.py +++ b/src/onionrcommands/daemonlaunch.py @@ -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 :) diff --git a/tests/test_config.py b/tests/test_config.py deleted file mode 100644 index dd1beac5..00000000 --- a/tests/test_config.py +++ /dev/null @@ -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() diff --git a/tests/test_random_bind_ip_setting.py b/tests/test_random_bind_ip_setting.py new file mode 100644 index 00000000..59bee035 --- /dev/null +++ b/tests/test_random_bind_ip_setting.py @@ -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()