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.3 KB
|
Line | |
---|
1 | #!/usr/bin/python3 |
---|
2 | from fileinput import filename |
---|
3 | |
---|
4 | |
---|
5 | try: |
---|
6 | import unittest2 as unittest #for Python <= 2.6 |
---|
7 | except: |
---|
8 | import unittest |
---|
9 | |
---|
10 | import os |
---|
11 | import sys |
---|
12 | sys.path.append(os.path.dirname(sys.argv[0]) + '/') #Path to my unitTest directory |
---|
13 | from gluon import * |
---|
14 | |
---|
15 | from baseTest import BaseTest |
---|
16 | |
---|
17 | APP =sys.argv[1] |
---|
18 | |
---|
19 | |
---|
20 | |
---|
21 | #This line executes your controller file, bringing all of the function declarations into the local namespace. |
---|
22 | #execfile("applications/" + APP + "/controllers/default.py", globals()) |
---|
23 | filename = "applications/" + APP + "/controllers/connectPC.py" |
---|
24 | |
---|
25 | exec(compile(open(filename, "rb").read(), filename, 'exec'), globals()) |
---|
26 | |
---|
27 | import opengnsys |
---|
28 | |
---|
29 | class TestGetRemotePCs(BaseTest): |
---|
30 | |
---|
31 | def testGetRemotePCs(self): |
---|
32 | |
---|
33 | ou_id = '2' #eupt |
---|
34 | lab_id = '6' #informatica1 |
---|
35 | |
---|
36 | login_info = opengnsys.doLogin() |
---|
37 | opengnsys.setApiKey(login_info['apikey']) |
---|
38 | |
---|
39 | remotePCs = opengnsys.getRemotePCs(ou_id, lab_id) |
---|
40 | |
---|
41 | pci115 = None |
---|
42 | for pc in remotePCs: |
---|
43 | if pc['pc']['id'] == 36: |
---|
44 | pci115 = pc |
---|
45 | |
---|
46 | self.assertIsNotNone(pci115['status']) |
---|
47 | |
---|
48 | suite = unittest.TestSuite() |
---|
49 | suite.addTest(unittest.makeSuite(TestGetRemotePCs)) |
---|
50 | unittest.TextTestRunner(verbosity=2).run(suite) |
---|
Note: See
TracBrowser
for help on using the repository browser.