示例#1
0
 def test_validateArgs_none_fails(self):
     try:
         validateArgs(None)
         self.fail("Should fail with no arguments")
     except Exception as e:
         self.assertTrue(e.__class__ is ValueError)
示例#2
0
 def test_validateArgs_unknown_fails(self):
     try:
         validateArgs(["unknown"])
         self.fail("Should fail with unknown argument")
     except Exception as e:
         self.assertTrue(e.__class__ is ValueError)
示例#3
0
 def test_validateArgs_dark_passes(self):
     self.assertEqual("dark", validateArgs(["dark"]))
示例#4
0
 def test_validateArgs_device_only_none_fails(self):
     try:
         validateArgs(["-s", "DEVICE_NAME"])
         self.fail("Should fail with no arguments")
     except Exception as e:
         self.assertTrue(e.__class__ is ValueError)