mirror of
https://github.com/kevin1024/vcrpy.git
synced 2025-12-09 01:03:24 +00:00
Added port to Request with matcher and test
This commit is contained in:
@@ -38,5 +38,5 @@ def test_url_matcher():
|
|||||||
def test_metchers():
|
def test_metchers():
|
||||||
assert_matcher('method')
|
assert_matcher('method')
|
||||||
assert_matcher('host')
|
assert_matcher('host')
|
||||||
#assert_matcher('method')
|
assert_matcher('port')
|
||||||
#assert_matcher('method')
|
#assert_matcher('method')
|
||||||
|
|||||||
@@ -13,6 +13,10 @@ def host(r1, r2):
|
|||||||
return r1.host == r2.host
|
return r1.host == r2.host
|
||||||
|
|
||||||
|
|
||||||
|
def port(r1, r2):
|
||||||
|
return r1.port == r2.port
|
||||||
|
|
||||||
|
|
||||||
def path(r1, r2):
|
def path(r1, r2):
|
||||||
return r1.path == r2.path
|
return r1.path == r2.path
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,10 @@ class Request(object):
|
|||||||
def host(self):
|
def host(self):
|
||||||
return urlparse(self.uri).hostname
|
return urlparse(self.uri).hostname
|
||||||
|
|
||||||
|
@property
|
||||||
|
def port(self):
|
||||||
|
return urlparse(self.uri).port
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def url(self):
|
def url(self):
|
||||||
return self.uri
|
return self.uri
|
||||||
|
|||||||
Reference in New Issue
Block a user