From 4bbbff7651b8f6e8e6687d81c1c8cffc01b5c678 Mon Sep 17 00:00:00 2001 From: Kevin Froman Date: Fri, 26 Jul 2019 18:20:27 -0500 Subject: [PATCH] added getopenport --- onionr/tests/test_getopenport.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 onionr/tests/test_getopenport.py diff --git a/onionr/tests/test_getopenport.py b/onionr/tests/test_getopenport.py new file mode 100644 index 00000000..fb82e224 --- /dev/null +++ b/onionr/tests/test_getopenport.py @@ -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() \ No newline at end of file