def returns_one_appointement(): res = "1;3/13/2015 8:00:00 AM;3/13/2015 1:00:00 PM;C5CA" appointment = file_parser.parse_appointment(res) expected_appointment = ("1", file_parser.Appointment(file_parser.parse_date("3/13/2015 8:00:00 AM"), file_parser.parse_date("3/13/2015 1:00:00 PM"))) assert_that(appointment[1], instance_of(file_parser.Appointment)) assert_that(appointment[0], equal_to("1")) assert_that(appointment[1].start, expected_appointment[1].start) assert_that(appointment[1].end, expected_appointment[1].end)
def returns_zero_appointement_when_to_less_input(): res = "1;3/13/2015 8:00:00 AM;3" appointment = file_parser.parse_appointment(res) assert_that(appointment, equal_to(None))