コード例 #1
0
ファイル: TestLaps.py プロジェクト: rdnelson/Hazzard
 def testCmpLapDifferent(self):
     """Check that different number of laps is prioritized over time"""
     assert laps.cmpLap([1], []) == -1, "[1] is not less-than []"
     assert laps.cmpLap([], [1]) == 1, "[] is not greater than [1]"
     assert laps.cmpLap([1,1,1], [1,2]) == -1, "[1,1,1] is not less than [1,2]"
     assert laps.cmpLap([2,1], [1,1,1]) == 1, "[2,1] is not greater than [1,1,1]"
     assert laps.cmpLap([10,10], [1]) == -1, "[10,10] is not less than [1]"
     assert laps.cmpLap([10], [6,6]) == 1, "[10] is not greater than [6,6]"
コード例 #2
0
ファイル: TestLaps.py プロジェクト: rdnelson/Hazzard
 def testCmpLapTimes(self):
     """Check that for same lap count, time determines equality"""
     assert laps.cmpLap([1],[1]) == 0, "[1] does not equal [1]"
     assert laps.cmpLap([1],[2]) == -1, "[1] is not less than [2]"
     assert laps.cmpLap([2],[1]) == 1, "[2] is not greater than [1]"
     assert laps.cmpLap([2,3],[1,4]) == 0, "[2,3] does not equal [1,4]"
     assert laps.cmpLap([1,2],[3,3]) == -1, "[1,2] is not less than [3,3]"
     assert laps.cmpLap([3,3],[1,2]) == 1, "[3,3] is not greater than [1,2]"
コード例 #3
0
ファイル: TestLaps.py プロジェクト: rdnelson/Hazzard
 def testCmpLapEmpty(self):
     """Check that zero laps complete evaluate to be equal (0)"""
     assert laps.cmpLap([], []) == 0, "Zero laps complete are not equal"