Onionr/tests/test_default_config_json.py
2019-09-12 21:22:25 -05:00

23 lines
693 B
Python

import sys, os
sys.path.append(".")
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())
unittest.main()