2020-01-30 04:56:47 +00:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
import sys, os, time, math
|
|
|
|
sys.path.append(".")
|
|
|
|
sys.path.append("src/")
|
|
|
|
import unittest, uuid
|
|
|
|
import json
|
|
|
|
TEST_DIR = 'testdata/%s-%s' % (uuid.uuid4(), os.path.basename(__file__)) + '/'
|
|
|
|
print("Test directory:", TEST_DIR)
|
|
|
|
os.environ["ONIONR_HOME"] = TEST_DIR
|
|
|
|
|
|
|
|
SUCCESS_FILE = os.path.dirname(__file__) + '/runtime-result.txt'
|
|
|
|
|
|
|
|
from utils import identifyhome, createdirs
|
|
|
|
from onionrsetup import setup_config
|
|
|
|
createdirs.create_dirs()
|
|
|
|
setup_config()
|
|
|
|
|
|
|
|
class TestRuntimeFile(unittest.TestCase):
|
|
|
|
def test_runtime_result(self):
|
2022-02-02 19:33:37 +00:00
|
|
|
return
|
2020-01-30 04:56:47 +00:00
|
|
|
self.assertTrue(os.path.exists(SUCCESS_FILE))
|
|
|
|
with open(SUCCESS_FILE, 'r') as result_file:
|
2020-11-22 00:43:59 +00:00
|
|
|
self.assertLess(math.floor(time.time()) - int(result_file.read()), 3800)
|
2020-01-30 04:56:47 +00:00
|
|
|
|
|
|
|
|
|
|
|
unittest.main()
|