2019-09-29 01:26:17 +00:00
|
|
|
import sys, os
|
2020-03-04 06:59:29 +00:00
|
|
|
import uuid
|
2019-09-29 01:26:17 +00:00
|
|
|
sys.path.append(".")
|
2019-11-21 09:26:23 +00:00
|
|
|
sys.path.append("src/")
|
2020-03-04 06:59:29 +00:00
|
|
|
TEST_DIR = 'testdata/%s-%s' % (uuid.uuid4(), os.path.basename(__file__)) + '/'
|
|
|
|
print("Test directory:", TEST_DIR)
|
|
|
|
os.environ["ONIONR_HOME"] = TEST_DIR
|
2019-09-29 01:26:17 +00:00
|
|
|
import unittest
|
2020-11-22 00:43:59 +00:00
|
|
|
from utils import createdirs
|
|
|
|
createdirs.create_dirs()
|
|
|
|
from onionrcrypto import getourkeypair
|
|
|
|
getourkeypair.get_keypair()
|
2019-09-29 01:26:17 +00:00
|
|
|
import vanityonionr
|
|
|
|
|
2019-09-30 05:13:43 +00:00
|
|
|
import niceware
|
|
|
|
|
|
|
|
wordlist = niceware.WORD_LIST
|
2019-09-29 01:26:17 +00:00
|
|
|
|
|
|
|
class TestBasic(unittest.TestCase):
|
|
|
|
|
|
|
|
def test_basic(self):
|
|
|
|
pair = vanityonionr.find_multiprocess("onion")
|
2019-09-30 05:13:43 +00:00
|
|
|
b = niceware.bytes_to_passphrase(pair[0])
|
2019-10-05 23:55:40 +00:00
|
|
|
self.assertTrue(b[0].startswith("onion"))
|
2019-09-29 01:26:17 +00:00
|
|
|
|
|
|
|
unittest.main()
|