2019-09-10 20:25:50 +00:00
|
|
|
import sys, os
|
|
|
|
sys.path.append(".")
|
2019-11-21 09:26:23 +00:00
|
|
|
sys.path.append("src/")
|
2019-09-10 20:25:50 +00:00
|
|
|
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()
|