Onionr/tests/test_vanity.py
Kevin Froman 60d2ebfaed + added more tests
* fixed chdir home bug
* fixed some tests creating normal data dir
2020-03-04 01:15:58 -06:00

22 lines
542 B
Python

import sys, os
import uuid
sys.path.append(".")
sys.path.append("src/")
TEST_DIR = 'testdata/%s-%s' % (uuid.uuid4(), os.path.basename(__file__)) + '/'
print("Test directory:", TEST_DIR)
os.environ["ONIONR_HOME"] = TEST_DIR
import unittest
import vanityonionr
import niceware
wordlist = niceware.WORD_LIST
class TestBasic(unittest.TestCase):
def test_basic(self):
pair = vanityonionr.find_multiprocess("onion")
b = niceware.bytes_to_passphrase(pair[0])
self.assertTrue(b[0].startswith("onion"))
unittest.main()