Implemented --ap-list.
[cnetworkmanager.git] / test / t02-with-nm.py
blob5334460678101b5510ea9f265f8bc1637ab88b67
1 #! /usr/bin/python
3 import subprocess
4 import sys
5 import unittest
7 class WithNM(unittest.TestCase):
8 def callIt(self, params):
9 cmd = sys.path[0] + '/../cnetworkmanager'
10 p = subprocess.Popen([cmd, params], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
11 o = p.communicate()[0]
12 # TODO print it if verbose
13 if p.returncode != 0:
14 raise Exception("Command failed with status", p.returncode, o)
16 def testDev(self):
17 self.callIt("--dev")
19 def testActCon(self):
20 self.callIt("--actcon")
22 def testUsrCon(self):
23 self.callIt("--usrcon")
25 def testSysCon(self):
26 self.callIt("--syscon")
28 def testAP(self):
29 self.callIt("--ap")
31 def testNets(self):
32 self.callIt("--nets")
34 if __name__ == '__main__':
35 unittest.main()