Example #1
0
def test_get_availability_for_existing_date():
    p = Provider('1', '1', '1', '', '', '')
    p.add_centre('rand')
    p.get_availability('rand', 2019, 9, 20)
    p.make_time_slot_unavailable('rand', 2019, 9, 20, '08:30')
    val = p.get_availability('rand', 2019, 9, 20)
    assert ('08:30' not in val and type(val) is list)
Example #2
0
def test_make_non_existing_and_available_slots_unavailable():
    p = Provider('1', '1', '1', '', '', '')
    p.add_centre('rand')
    p.get_availability('rand', 2019, 9, 20)
    checker = p.make_time_slot_unavailable('rand', 2019, 9, 20, '08:30')
    assert (checker == True)
    val = p.get_availability('rand', 2019, 9, 20)
    assert ('08:30' not in val)
    checker = p.make_time_slot_unavailable('rand', 2019, 9, 20, '09:30')
    val = p.get_availability('rand', 2019, 9, 20)
    assert ('08:30' not in val and '09:30' not in val)