Implemented --ap-list.
[cnetworkmanager.git] / test / t01-nofail.py
blobc4ca60cc1b6daf48320ca10deec6ca54371f08d4
1 #! /usr/bin/python
3 import subprocess
4 import sys
5 import unittest
7 class NoFail(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 testFail(self):
17 self.assertRaises(Exception, self.callIt, "--no-such-option")
19 def testHelp(self):
20 self.callIt("--help")
22 if __name__ == '__main__':
23 unittest.main()