def test_query_matcher(): req1 = request.Request("GET", "http://host.com/?a=b&c=d", "", {}) req2 = request.Request("GET", "http://host.com/?c=d&a=b", "", {}) assert matchers.query(req1, req2) is None req1 = request.Request("GET", "http://host.com/?a=b&a=b&c=d", "", {}) req2 = request.Request("GET", "http://host.com/?a=b&c=d&a=b", "", {}) req3 = request.Request("GET", "http://host.com/?c=d&a=b&a=b", "", {}) assert matchers.query(req1, req2) is None assert matchers.query(req1, req3) is None
def test_query_matcher(): req1 = request.Request('GET', 'http://host.com/?a=b&c=d', '', {}) req2 = request.Request('GET', 'http://host.com/?c=d&a=b', '', {}) assert matchers.query(req1, req2) req1 = request.Request('GET', 'http://host.com/?a=b&a=b&c=d', '', {}) req2 = request.Request('GET', 'http://host.com/?a=b&c=d&a=b', '', {}) req3 = request.Request('GET', 'http://host.com/?c=d&a=b&a=b', '', {}) assert matchers.query(req1, req2) assert matchers.query(req1, req3)
def extended_query_matcher(received_request, cassette_request): query(received_request, cassette_request)