def test_add_multiple_returns_correct_number(): p = Person(Name='calvin') now_dt = arrow.get('2014-01-01T09:09:00.000-05:00') tw = PersonTimeWindow(LocationName='kitchen', Priority=100, ical=ical_event, CompareDateTime=now_dt) p.add_window(tw) tw = PersonTimeWindow(LocationName='bedroom', Priority=200, ical=ical_event, CompareDateTime=now_dt) p.add_window(tw) assert p.all_available_count(now_dt) == 2
def test_saving_person_with_available_windows_are_available(): now_dt = arrow.get('2014-01-01T09:09:00.000-05:00') pm = PersonManager() p = Person(Name='calvin') now_dt = arrow.get('2014-01-01T09:09:00.000-05:00') tw = PersonTimeWindow(LocationName='kitchen', Priority=100, ical=ical_event, CompareDateTime=now_dt) p.add_window(tw) tw = PersonTimeWindow(LocationName='bedroom', Priority=200, ical=ical_event, CompareDateTime=now_dt) p.add_window(tw) pm.update_window_set(p) assert p.all_available_count(now_dt) == 2