def test_pop(): with respx.mock: request = respx.get("https://foo.bar/", name="foobar") popped = respx.pop("foobar") assert popped is request with pytest.raises(KeyError): respx.pop("foobar") assert respx.pop("foobar", "custom default") == "custom default"
def test_pop(): with respx.mock: request = respx.get("https://foo.bar/", name="foobar") popped = respx.pop("foobar") assert popped is request
def test_pop(): with respx.mock: respx.get("https://foo.bar/", alias="foobar") request_pattern = respx.pop("foobar") assert request_pattern.url == "https://foo.bar/"