main
Last change
on this file was
42bd667,
checked in by David Fuertes <dfuertes@…>, 4 years ago
|
Historial Limpio
|
-
Property mode set to
100644
|
File size:
1.0 KB
|
Line | |
---|
1 | #!/usr/bin/python3 |
---|
2 | import ports_manager |
---|
3 | |
---|
4 | from fileinput import filename |
---|
5 | |
---|
6 | |
---|
7 | |
---|
8 | try: |
---|
9 | import unittest2 as unittest #for Python <= 2.6 |
---|
10 | except: |
---|
11 | import unittest |
---|
12 | |
---|
13 | import os |
---|
14 | import sys |
---|
15 | sys.path.append(os.path.dirname(sys.argv[0]) + '/') #Path to my unitTest directory |
---|
16 | from gluon import * |
---|
17 | |
---|
18 | from baseTest import BaseTest |
---|
19 | |
---|
20 | APP =sys.argv[1] |
---|
21 | |
---|
22 | |
---|
23 | |
---|
24 | #This line executes your controller file, bringing all of the function declarations into the local namespace. |
---|
25 | #execfile("applications/" + APP + "/controllers/default.py", globals()) |
---|
26 | filename = "applications/" + APP + "/controllers/connectPC.py" |
---|
27 | |
---|
28 | exec(compile(open(filename, "rb").read(), filename, 'exec'), globals()) |
---|
29 | |
---|
30 | |
---|
31 | |
---|
32 | |
---|
33 | class PortManagerTest(BaseTest): |
---|
34 | |
---|
35 | def testGetPort(self): |
---|
36 | port = None |
---|
37 | port = ports_manager.get_origin_port('155.210.68.44', '10.7.1.112', '8080', '2') |
---|
38 | print(port) |
---|
39 | self.assertIsNotNone(port) |
---|
40 | |
---|
41 | |
---|
42 | |
---|
43 | suite = unittest.TestSuite() |
---|
44 | suite.addTest(unittest.makeSuite(PortManagerTest)) |
---|
45 | unittest.TextTestRunner(verbosity=2).run(suite) |
---|
Note: See
TracBrowser
for help on using the repository browser.