def terminy(self): term1 = Term(Day.TUE, 9, 45) term2 = Term(Day.WED, 10, 15) self.assertEqual( term1.earlierThan(term2), True ) self.assertEqual( term1.laterThan(term2), False) self.assertEqual( term1.equals(term2), False)
from DeanerySystem.day import Day from DeanerySystem.term import Term term1 = Term(8, 30) term2 = Term(9, 45, 30) term3 = Term(9, 45, 90) print(term3.earlierThan(term2)) print(term1) # Ma się wypisać: "8:30 [90]" print(term2) # Ma się wypisać: "9:45 [30]" print(term3) # Ma się wypisać: "9:45 [90]" print("term1 < term2:", term1 < term2) # Ma się wypisać True print("term1 <= term2:", term1 <= term2) # Ma się wypisać True print("term1 > term2:", term1 > term2) # Ma się wypisać False print("term1 >= term2:", term1 >= term2) # Ma się wypisać False print("term2 == term2:", term2 == term2) # Ma się wypisać True print("term2 == term3:", term2 == term3) # Ma się wypisać False term4 = term3 - term1 # Tworzy termin, którego: # - godzina rozpoczęcia jest taka jak 'term1', # - czas trwania to różnica minut pomiędzy godziną zakończenia 'term3' (11:15), a godziną rozpoczęcia 'term1' (8:30) print(term4)
from DeanerySystem.term import Term from DeanerySystem.day import Day term1 = Term(Day.TUE, 9, 45) print(term1) # Ma się wypisać: "Wtorek 9:45 [90]" term2 = Term(Day.WED, 10, 15) print(term2) # Ma się wypisać: "Środa 10:15 [90]" print(term1.earlierThan(term2)); # Ma się wypisać: "True" print(term1.laterThan(term2)); # Ma się wypisać: "False" print(term1.equals(term2)); # Ma się wypisać: "False" term1 = Term(Day.TUE, 9, 45) term2 = Term(Day.WED, 10, 15) term = term1.minuteDifference(term2) print("Term: {}".format(term)) term = term1.endTime() print("Term endTime: {}".format(term))