added getopenport
This commit is contained in:
parent
3f5834da95
commit
4bbbff7651
16
onionr/tests/test_getopenport.py
Normal file
16
onionr/tests/test_getopenport.py
Normal file
@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env python3
|
||||
import sys, os
|
||||
sys.path.append(".")
|
||||
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
|
||||
import netcontroller
|
||||
|
||||
class GetOpenPortTest(unittest.TestCase):
|
||||
def test_open_port(self):
|
||||
open_port = int(netcontroller.get_open_port())
|
||||
self.assertGreaterEqual(open_port, 1024)
|
||||
|
||||
unittest.main()
|
Loading…
Reference in New Issue
Block a user