mirror of
https://github.com/kevin1024/vcrpy.git
synced 2025-12-10 01:25:34 +00:00
Replaced Request 'host, port, protocol, path' with 'uri'
This commit is contained in:
@@ -3,28 +3,28 @@ from vcr import request
|
||||
|
||||
|
||||
def test_method():
|
||||
req_get = request.Request('http', 'google.com', 80, 'GET', '/', '', {})
|
||||
req_get = request.Request('GET', 'http://google.com:80/', '', {})
|
||||
assert True == matchers.method(req_get, req_get)
|
||||
|
||||
req_get1 = request.Request('https', 'httpbin.org', 80, 'GET', '/', '', {})
|
||||
req_get1 = request.Request('GET', 'https://httpbin.org:80/', '', {})
|
||||
assert True == matchers.method(req_get, req_get1)
|
||||
|
||||
req_post = request.Request('http', 'google.com', 80, 'POST', '/', '', {})
|
||||
req_post = request.Request('POST', 'http://google.com:80/', '', {})
|
||||
assert False == matchers.method(req_get, req_post)
|
||||
|
||||
|
||||
def test_url():
|
||||
req1 = request.Request('http', 'google.com', 80, 'GET', '/', '', {})
|
||||
req1 = request.Request('GET', 'http://google.com:80/', '', {})
|
||||
assert True == matchers.url(req1, req1)
|
||||
|
||||
req2 = request.Request('http', 'httpbin.org', 80, 'GET', '/', '', {})
|
||||
req2 = request.Request('GET', 'https://httpbin.org:80/', '', {})
|
||||
assert False == matchers.url(req1, req2)
|
||||
|
||||
req1_post = request.Request('http', 'google.com', 80, 'POST', '/', '', {})
|
||||
req1_post = request.Request('POST', 'http://google.com:80/', '', {})
|
||||
assert True == matchers.url(req1, req1_post)
|
||||
|
||||
req_query_string = request.Request(
|
||||
'http', 'google.com?p1=t1&p2=t2', 80, 'GET', '/', '', {})
|
||||
'GET', 'http://google.com:80/?p1=t1&p2=t2', '', {})
|
||||
req_query_string1 = request.Request(
|
||||
'http', 'google.com?p2=t2&p1=t1', 80, 'GET', '/', '', {})
|
||||
'GET', 'http://google.com:80/?p2=t2&p1=t1', '', {})
|
||||
assert False == matchers.url(req_query_string, req_query_string1)
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
from vcr.request import Request
|
||||
|
||||
|
||||
def test_url():
|
||||
req = Request('http', 'www.google.com', 80, 'GET', '/', '', {})
|
||||
assert req.url == 'http://www.google.com/'
|
||||
|
||||
|
||||
def test_str():
|
||||
req = Request('http', 'www.google.com', 80, 'GET', '/', '', {})
|
||||
str(req) == '<Request (GET) http://www.google.com>'
|
||||
req = Request('GET', 'http://www.google.com:80/', '', {})
|
||||
str(req) == '<Request (GET) http://www.google.com:80/>'
|
||||
|
||||
Reference in New Issue
Block a user