def test_cannot_create_guest_with_invalid_room_number_type(self, num): with pytest.raises(ValueError): Guest("John", num, KeyCard(Key(), Key()))
def test_can_unlock_with_matching_keycard(self): k1 = Key() k2 = Key() keycard = KeyCard(k1, k2) lock = Lock(k1, k2) assert lock.can_be_unlocked(keycard)