source: OpenRLabs-Git/web2py/applications/rlabs/unitTest/disabledTest/test_ports_manager.py

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
2import ports_manager
3
4from fileinput import filename
5
6
7
8try:
9    import unittest2 as unittest #for Python <= 2.6
10except:
11    import unittest   
12
13import os
14import sys
15sys.path.append(os.path.dirname(sys.argv[0]) + '/') #Path to my unitTest directory
16from gluon import *
17
18from baseTest import BaseTest
19
20APP =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())
26filename = "applications/" + APP + "/controllers/connectPC.py"
27
28exec(compile(open(filename, "rb").read(), filename, 'exec'), globals())
29
30
31
32
33class 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           
43suite = unittest.TestSuite()
44suite.addTest(unittest.makeSuite(PortManagerTest))
45unittest.TextTestRunner(verbosity=2).run(suite)
Note: See TracBrowser for help on using the repository browser.