2019-07-26 23:20:27 +00:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
import sys, os
|
|
|
|
sys.path.append(".")
|
2019-11-21 09:26:23 +00:00
|
|
|
sys.path.append("src/")
|
2019-07-26 23:20:27 +00:00
|
|
|
import unittest, uuid
|
|
|
|
|
|
|
|
TEST_DIR = 'testdata/%s-%s' % (uuid.uuid4(), os.path.basename(__file__)) + '/'
|
|
|
|
print("Test directory:", TEST_DIR)
|
|
|
|
os.environ["ONIONR_HOME"] = TEST_DIR
|
2022-02-07 01:18:53 +00:00
|
|
|
from onionrutils import getopenport
|
2019-07-26 23:20:27 +00:00
|
|
|
|
|
|
|
class GetOpenPortTest(unittest.TestCase):
|
|
|
|
def test_open_port(self):
|
2022-02-07 01:18:53 +00:00
|
|
|
open_port = int(getopenport.get_open_port())
|
2019-07-26 23:20:27 +00:00
|
|
|
self.assertGreaterEqual(open_port, 1024)
|
|
|
|
|
2019-09-13 02:22:25 +00:00
|
|
|
unittest.main()
|