Exemple #1
0
 def assert_created_at__keep_query_string(self) -> None:
     response = FakeResponse(
         "201 Created",
         [("Location", "http://example.com/foo?abc=def#frag")],
     )
     with assert_succeeds(AssertionError):
         response.assert_created_at("/foo?abc=def#frag")
Exemple #2
0
 def assert_created_at__wrong_location(self) -> None:
     response = FakeResponse(
         "201 Created", [("Location", "http://example.com/")]
     )
     with assert_raises(AssertionError):
         response.assert_created_at("http://example.org/")
Exemple #3
0
 def assert_created_at__relative_location(self) -> None:
     response = FakeResponse(
         "201 Created", [("Location", "http://example.com/foo/bar")]
     )
     with assert_succeeds(AssertionError):
         response.assert_created_at("/foo/bar")
Exemple #4
0
 def assert_created_at__no_location_header(self) -> None:
     response = FakeResponse("201 Created", [])
     with assert_raises(AssertionError):
         response.assert_created_at("http://example.org/")