def match_status(rv, expected_code):
    """
    Test whether the HTTP status code of the return value matches the expected status code.
    :param rv: the return value.
    :param expected_code: the expected status code.
    :return: True, in case of a code match; False, otherwise.
    """
    actual_code = rv.status_code
    match_condition = actual_code == expected_code
    return match_condition