예제 #1
0
    def testInvalidCommandSpec(self):
        with self.assertRaises(Exception):
            _x = CommandSpec()

        with self.assertRaises(Exception):
            _x = CommandSpec(description=None)

        with self.assertRaises(Exception):
            _x = CommandSpec(description=3)
예제 #2
0
    def testValidSpec(self):
        try:
            x = Spec(description="123", singleNodeOnly=True)
            x.invariant()

            x = Spec(description="123", singleNodeOnly=True)
            x.commands = dict(command1=CommandSpec("A command"),
                              command2=CommandSpec("Another command"))
            x.invariant()
        except:
            self.fail("Got unexpected exception")
예제 #3
0
 def testValidCommandSpec(self):
   try:
     x = CommandSpec("")
     x.invariant()
     x = CommandSpec(description="")
     x.invariant()
     x = CommandSpec(description="this is a command")
     x.invariant()
   except:
     self.fail("Got unexpected exception")
예제 #4
0
 def testValidCommandSpec(self):
     try:
         x = CommandSpec("")
         x.invariant()
         x = CommandSpec(description="")
         x.invariant()
         x = CommandSpec(description="this is a command")
         x.invariant()
     except:
         self.fail("Got unexpected exception")