1
0
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:
Max Shytikov
2014-04-07 01:12:05 +02:00
parent 18ec57fa73
commit bd9fa773e8
3 changed files with 9 additions and 1 deletions

View File

@@ -38,5 +38,5 @@ def test_url_matcher():
def test_metchers():
assert_matcher('method')
assert_matcher('host')
#assert_matcher('method')
assert_matcher('port')
#assert_matcher('method')

View File

@@ -13,6 +13,10 @@ def host(r1, r2):
return r1.host == r2.host
def port(r1, r2):
return r1.port == r2.port
def path(r1, r2):
return r1.path == r2.path

View File

@@ -19,6 +19,10 @@ class Request(object):
def host(self):
return urlparse(self.uri).hostname
@property
def port(self):
return urlparse(self.uri).port
@property
def url(self):
return self.uri