def test_after_checkin_guest_appear_as_checkedin(self, names, num): assume(len(names) < num) hotel = Hotel(num) for n in names: hotel.checkin(n) for n in names: assert hotel.is_checkedin(n)
def test_after_checkout_guest_appears_checkedout(self, names, num): assume(len(names) < num) hotel = Hotel(num) for n in names: hotel.checkin(n) for n in names: hotel.checkout(n) assert not hotel.is_checkedin(n)
def test_checkedin_guest_has_a_room(self, names1, names2, num): assume(len(names1) < num) assume(names1 & names2) hotel = Hotel(num) for n in names1: hotel.checkin(n) for n in names2: if hotel.is_checkedin(n): assert isinstance(hotel.room_of(n), Room)
def test_checkout_of_checkedin_guest(self, names, num): assume(len(names) < num) hotel = Hotel(num) for n in names: hotel.checkin(n) for n in names: hotel.checkout(n) for n in names: assert not hotel.is_checkedin(n)
def test_guest_having_a_room_is_checkedin(self, names1, names2, num): assume(len(names1) < num) assume(names1 & names2) hotel = Hotel(num) for n in names1: hotel.checkin(n) for n in names2: try: if isinstance(hotel.room_of(n), Room): assert hotel.is_checkedin(n) except ValueError: pass
def test_is_checkedin_fails_with_invalid_guest_name_type(self, n, name): h = Hotel(n) with pytest.raises(ValueError): h.is_checkedin(name)