Beispiel #1
0
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"
Beispiel #2
0
def test_pop():
    with respx.mock:
        request = respx.get("https://foo.bar/", name="foobar")
        popped = respx.pop("foobar")
        assert popped is request
Beispiel #3
0
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/"