Ejemplo n.º 1
0
def test_request_fails_when_accessing_non_existent_route():
    """
    Test request fails with NotFound (404) when route cannot be resolved, regardless of authentication
    """
    client = VinylDNSClient(VinylDNSTestContext.vinyldns_url,
                            "unknownAccessKey", "anyAccessSecretKey")
    url = urljoin(VinylDNSTestContext.vinyldns_url, "/no-existo")
    _, data = client.make_request(url, "GET", client.headers, status=404)

    assert_that(data, is_("The requested path [/no-existo] does not exist."))
Ejemplo n.º 2
0
def test_request_fails_with_unsupported_http_method_for_route():
    """
    Test request fails with MethodNotAllowed (405) when HTTP Method is not supported for specified route
    """
    client = VinylDNSClient(VinylDNSTestContext.vinyldns_url,
                            "unknownAccessKey", "anyAccessSecretKey")
    url = urljoin(VinylDNSTestContext.vinyldns_url, "/zones")
    _, data = client.make_request(url, "PUT", client.headers, status=405)

    assert_that(data,
                is_("HTTP method not allowed, supported methods: GET, POST"))