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 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)
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)