2020-01-29 03:39:01 +00:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
import sys, os
|
|
|
|
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
|
|
|
|
|
|
|
|
from utils import identifyhome, createdirs
|
2022-02-07 01:18:53 +00:00
|
|
|
import onionrvalues
|
2020-01-29 03:39:01 +00:00
|
|
|
|
|
|
|
class TestOnionrValues(unittest.TestCase):
|
2020-09-07 05:13:36 +00:00
|
|
|
def test_api_version(self):
|
2020-10-10 00:16:24 +00:00
|
|
|
self.assertEqual(onionrvalues.API_VERSION, '2')
|
2020-09-07 05:13:36 +00:00
|
|
|
|
2020-01-29 03:39:01 +00:00
|
|
|
def test_default_expire(self):
|
2020-02-28 11:05:00 +00:00
|
|
|
self.assertEqual(onionrvalues.DEFAULT_EXPIRE, 2678400)
|
2020-01-29 03:39:01 +00:00
|
|
|
|
2020-03-03 11:55:50 +00:00
|
|
|
def test_block_clock_skew(self):
|
|
|
|
self.assertEqual(onionrvalues.MAX_BLOCK_CLOCK_SKEW, 120)
|
|
|
|
|
|
|
|
def test_block_export_ext(self):
|
2020-03-30 08:23:59 +00:00
|
|
|
self.assertEqual(onionrvalues.BLOCK_EXPORT_FILE_EXT, '.onionr')
|
2020-01-29 03:39:01 +00:00
|
|
|
|
|
|
|
unittest.main()
|