Ejemplo n.º 1
0
def test_guest_utility_id_not_exists(guest_id: int):
    """Negative testing for :py:meth:`wwdtm.guest.GuestUtility.id_exists`

    :param guest_id: Guest ID to test if a guest does not exist
    """
    utility = GuestUtility(connect_dict=get_connect_dict())
    result = utility.id_exists(guest_id)

    assert not result, f"Guest ID {guest_id} exists"
Ejemplo n.º 2
0
def test_guest_utility_slug_exists(guest_slug: str):
    """Testing for :py:meth:`wwdtm.guest.GuestUtility.slug_exists`

    :param guest_slug: Guest slug string to test if a guest exists
    """
    utility = GuestUtility(connect_dict=get_connect_dict())
    result = utility.slug_exists(guest_slug)

    assert result, f"Guest slug {guest_slug} does not exist"
Ejemplo n.º 3
0
def test_guest_utility_convert_invalid_slug_to_id(guest_slug: str):
    """Negative testing for :py:meth:`wwdtm.guest.GuestUtility.convert_slug_to_id`

    :param guest_slug: Guest slug string to test failing to convert into
        guest ID
    """
    utility = GuestUtility(connect_dict=get_connect_dict())
    id_ = utility.convert_slug_to_id(guest_slug)

    assert not id_, f"Guest ID for slug {guest_slug} was found"
Ejemplo n.º 4
0
def test_guest_utility_convert_invalid_id_to_slug(guest_id: int):
    """Negative testing for :py:meth:`wwdtm.guest.GuestUtility.convert_id_to_slug`

    :param guest_id: Guest ID to test failing to convert into guest slug
        string
    """
    utility = GuestUtility(connect_dict=get_connect_dict())
    slug = utility.convert_id_to_slug(guest_id)

    assert not slug, f"Guest slug for ID {guest_id} was found"
Ejemplo n.º 5
0
def test_guest_utility_convert_id_to_slug(guest_id: int):
    """Testing for :py:meth:`wwdtm.guest.GuestUtility.convert_id_to_slug`

    :param guest_id: Guest ID to test converting into guest slug string
    """
    utility = GuestUtility(connect_dict=get_connect_dict())
    slug = utility.convert_id_to_slug(guest_id)

    assert slug, f"Guest slug for ID {guest_id} was not found"
    assert isinstance(slug, str), f"Invalid value returned for ID {guest_id}"
Ejemplo n.º 6
0
def test_guest_utility_convert_slug_to_id(guest_slug: str):
    """Testing for :py:meth:`wwdtm.guest.GuestUtility.convert_slug_to_id`

    :param guest_slug: Guest slug string to test converting into guest
        ID
    """
    utility = GuestUtility(connect_dict=get_connect_dict())
    id_ = utility.convert_slug_to_id(guest_slug)

    assert id_, f"Guest ID for slug {guest_slug} was not found"
    assert isinstance(id_,
                      int), f"Invalid value returned for slug {guest_slug}"