Ejemplo n.º 1
0
 def check(self):
     if self[0] != 'Event':
         raise exceptions.TypeError('%r not permitted as %r[0]. Has to be \'Event\'' % (self[0]))
     check_type("event", self.event(), self.TESTTYPE)
     check_type("id", self.id(), self.TESTTYPE)
     check_type("origin", self.origin(), dict)
     check_type("args", self.args(), dict)
     check_type("timestamp", self.timestamp(), float, True)
Ejemplo n.º 2
0
 def check(self):
     if self[0] != 'Event':
         raise exceptions.TypeError(
             '%r not permitted as %r[0]. Has to be \'Event\'' % (self[0]))
     check_type("event", self.event(), self.TESTTYPE)
     check_type("id", self.id(), self.TESTTYPE)
     check_type("origin", self.origin(), dict)
     check_type("args", self.args(), dict)
     check_type("timestamp", self.timestamp(), float, True)
Ejemplo n.º 3
0
 def check(self):
     if self[0] != 'Command':
         raise exceptions.TypeError(
             '%r not permitted as %r[0]. Has to be \'Command\'' %
             (self[0], self))
     check_type("command", self.command(), self.TESTTYPE)
     check_type("id", self.id(), self.TESTTYPE)
     check_type("args", self.args(), dict)
Ejemplo n.º 4
0
 def test_none(self):
     self.failUnlessEqual(
         core.check_type("NAME", None, str, allows_none=True), None)
     self.failUnlessEqual(
         core.check_type("NAME", None, (str, int), allows_none=True), None)
Ejemplo n.º 5
0
 def test_tuple(self):
     self.failUnlessEqual(
         core.check_type("NAME", 1, (str, int), allows_none=False), None)
Ejemplo n.º 6
0
 def test_single(self):
     self.failUnlessEqual(
         core.check_type("NAME", "hello", str, allows_none=False), None)
Ejemplo n.º 7
0
 def check(self):
     if self[0] != 'Command':
         raise exceptions.TypeError('%r not permitted as %r[0]. Has to be \'Command\'' % (self[0], self))
     check_type("command", self.command(), self.TESTTYPE)
     check_type("id", self.id(), self.TESTTYPE)
     check_type("args", self.args(), dict)