def testSubtractionUF(self): """Time object must raise exception if subtract underflows.""" a = _TrackTime('00:00:00') b = _TrackTime('00:00:01') self.assertRaises( UnderflowError, _TrackTime.__sub__, a, b )
def time_sub(self,s): """Helper function for test cases above.""" self.assertEqual( str(_TrackTime(s[0]) - _TrackTime(s[1])), \ str(_TrackTime(s[2])) )
def testEquals(self): """Time object must be equal to each other.""" a = _TrackTime('01:02:03') b = _TrackTime('01:02:03') self.assertEqual( a, b )
def testNotEquals(self): """Time object must not be equal to each other.""" a = _TrackTime('01:20:03') b = _TrackTime('01:02:03') self.failIfEqual( a, b )
def testIndex(self): """Time object string output must be equal to the input string.""" tlist = ['00:01:02','99:98:97'] for i in tlist: val = str(_TrackTime(i)) self.assertEqual(val,i)
def time_sub(self, s): """Helper function for test cases above.""" self.assertEqual( str(_TrackTime(s[0]) - _TrackTime(s[1])), \ str(_TrackTime(s[2])) )
def testSubtractionUF(self): """Time object must raise exception if subtract underflows.""" a = _TrackTime('00:00:00') b = _TrackTime('00:00:01') self.assertRaises(UnderflowError, _TrackTime.__sub__, a, b)
def testNotEquals(self): """Time object must not be equal to each other.""" a = _TrackTime('01:20:03') b = _TrackTime('01:02:03') self.assertNotEqual(a, b)
def testIndex(self): """Time object string output must be equal to the input string.""" tlist = ['00:01:02', '99:98:97'] for i in tlist: val = str(_TrackTime(i)) self.assertEqual(val, i)