示例#1
0
文件: test_disc.py 项目: epronk/mktoc
 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 )
示例#2
0
文件: test_disc.py 项目: epronk/mktoc
 def time_sub(self,s):
    """Helper function for test cases above."""
    self.assertEqual( str(_TrackTime(s[0]) - _TrackTime(s[1])), \
                      str(_TrackTime(s[2])) )
示例#3
0
文件: test_disc.py 项目: epronk/mktoc
 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 )
示例#4
0
文件: test_disc.py 项目: epronk/mktoc
 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 )
示例#5
0
文件: test_disc.py 项目: epronk/mktoc
 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)
示例#6
0
 def time_sub(self, s):
     """Helper function for test cases above."""
     self.assertEqual( str(_TrackTime(s[0]) - _TrackTime(s[1])), \
                       str(_TrackTime(s[2])) )
示例#7
0
 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)
示例#8
0
 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)
示例#9
0
 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)