def testSpeeds(self):
     """test event speeds"""
     from nox.lib.core import Event_type
     fast   = Event_type.allocate(Event_type.FAST); 
     medium = Event_type.allocate(Event_type.MEDIUM); 
     slow   = Event_type.allocate(Event_type.SLOW); 
     self.failUnlessEqual(fast.get_speed(), Event_type.FAST, 'Fast not equal');
     self.failUnlessEqual(medium.get_speed(), Event_type.MEDIUM, 'Medium not equal');
     self.failUnlessEqual(slow.get_speed(), Event_type.SLOW, 'Slow not equal');
Ejemplo n.º 2
0
 def testSpeeds(self):
     """test event speeds"""
     from nox.lib.core import Event_type
     fast = Event_type.allocate(Event_type.FAST)
     medium = Event_type.allocate(Event_type.MEDIUM)
     slow = Event_type.allocate(Event_type.SLOW)
     self.failUnlessEqual(fast.get_speed(), Event_type.FAST,
                          'Fast not equal')
     self.failUnlessEqual(medium.get_speed(), Event_type.MEDIUM,
                          'Medium not equal')
     self.failUnlessEqual(slow.get_speed(), Event_type.SLOW,
                          'Slow not equal')
 def testToInt(self):
     """test uniqueness of to_int"""    
     from nox.lib.core import Event_type
     allocated = []
     for i in range(0,256):
         new_type = Event_type.allocate(Event_type.FAST).to_int(); 
         if new_type in allocated:
             self.fail('Allocation failure')
         allocated.append(new_type)
Ejemplo n.º 4
0
 def testToInt(self):
     """test uniqueness of to_int"""
     from nox.lib.core import Event_type
     allocated = []
     for i in range(0, 256):
         new_type = Event_type.allocate(Event_type.FAST).to_int()
         if new_type in allocated:
             self.fail('Allocation failure')
         allocated.append(new_type)