Onionr/tests/test_default_config_json.py

23 lines
693 B
Python
Raw Normal View History

import sys, os
sys.path.append(".")
2019-09-13 02:22:25 +00:00
sys.path.append("onionr/")
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 OnionrConfig(unittest.TestCase):
def test_default_file(self):
json.loads(readstatic.read_static('default_config.json'))
def test_installed_config(self):
import onionrsetup
onionrsetup.setup_config()
with open(TEST_DIR + 'config.json') as conf:
json.loads(conf.read())
2019-09-13 02:22:25 +00:00
unittest.main()