From 1190a0e62ece01570667e804b906f93219b5f1e8 Mon Sep 17 00:00:00 2001 From: Max Shytikov Date: Sat, 3 May 2014 22:32:27 +0200 Subject: [PATCH] Removed default '80' port of uri in tests --- tests/fixtures/migration/new_cassette.json | 2 +- tests/fixtures/migration/new_cassette.yaml | 2 +- tests/fixtures/wild/domain_redirect.yaml | 4 ++-- tests/integration/test_request.py | 4 ++-- tests/unit/test_json_serializer.py | 2 +- tests/unit/test_matchers.py | 20 ++++++++++---------- tests/unit/test_request.py | 8 ++++---- 7 files changed, 21 insertions(+), 21 deletions(-) diff --git a/tests/fixtures/migration/new_cassette.json b/tests/fixtures/migration/new_cassette.json index 166c4fc..acf1267 100644 --- a/tests/fixtures/migration/new_cassette.json +++ b/tests/fixtures/migration/new_cassette.json @@ -8,7 +8,7 @@ "User-Agent": ["python-requests/2.2.1 CPython/2.6.1 Darwin/10.8.0"] }, "method": "GET", - "uri": "http://httpbin.org:80/ip" + "uri": "http://httpbin.org/ip" }, "response": { "status": { diff --git a/tests/fixtures/migration/new_cassette.yaml b/tests/fixtures/migration/new_cassette.yaml index 2adcbe4..58d19ea 100644 --- a/tests/fixtures/migration/new_cassette.yaml +++ b/tests/fixtures/migration/new_cassette.yaml @@ -5,7 +5,7 @@ Accept-Encoding: ['gzip, deflate, compress'] User-Agent: ['python-requests/2.2.1 CPython/2.6.1 Darwin/10.8.0'] method: GET - uri: http://httpbin.org:80/ip + uri: http://httpbin.org/ip response: body: {string: !!python/unicode "{\n \"origin\": \"217.122.164.194\"\n}"} headers: [!!python/unicode "Access-Control-Allow-Origin: *\r\n", !!python/unicode "Content-Type: diff --git a/tests/fixtures/wild/domain_redirect.yaml b/tests/fixtures/wild/domain_redirect.yaml index 027bbee..e7d4224 100644 --- a/tests/fixtures/wild/domain_redirect.yaml +++ b/tests/fixtures/wild/domain_redirect.yaml @@ -5,7 +5,7 @@ Accept-Encoding: ['gzip, deflate, compress'] User-Agent: ['vcrpy-test'] method: GET - uri: http://seomoz.org:80/ + uri: http://seomoz.org/ response: body: {string: ''} headers: ["Location: http://moz.com/\r\n", "Server: BigIP\r\n", "Connection: Keep-Alive\r\n", @@ -18,7 +18,7 @@ Accept-Encoding: ['gzip, deflate, compress'] User-Agent: ['vcrpy-test'] method: GET - uri: http://moz.com:80/ + uri: http://moz.com/ response: body: string: !!binary | diff --git a/tests/integration/test_request.py b/tests/integration/test_request.py index 882783e..829c6eb 100644 --- a/tests/integration/test_request.py +++ b/tests/integration/test_request.py @@ -6,6 +6,6 @@ def test_recorded_request_url_with_redirected_request(tmpdir): with vcr.use_cassette(str(tmpdir.join('test.yml'))) as cass: assert len(cass) == 0 urlopen('http://httpbin.org/redirect/3') - assert cass.requests[0].url == 'http://httpbin.org:80/redirect/3' - assert cass.requests[3].url == 'http://httpbin.org:80/get' + assert cass.requests[0].url == 'http://httpbin.org/redirect/3' + assert cass.requests[3].url == 'http://httpbin.org/get' assert len(cass) == 4 diff --git a/tests/unit/test_json_serializer.py b/tests/unit/test_json_serializer.py index 0787d0b..3bf927a 100644 --- a/tests/unit/test_json_serializer.py +++ b/tests/unit/test_json_serializer.py @@ -6,7 +6,7 @@ from vcr.request import Request def test_serialize_binary(): request = Request( method='GET', - uri='http://localhost:80/', + uri='http://localhost/', body='', headers={}, ) diff --git a/tests/unit/test_matchers.py b/tests/unit/test_matchers.py index 0d53fd7..f942bd2 100644 --- a/tests/unit/test_matchers.py +++ b/tests/unit/test_matchers.py @@ -6,13 +6,13 @@ from vcr import request # the dict contains requests with corresponding to its key difference # with 'base' request. REQUESTS = { - 'base': request.Request('GET', 'http://host.com:80/p?a=b', '', {}), - 'method': request.Request('POST', 'http://host.com:80/p?a=b', '', {}), + 'base': request.Request('GET', 'http://host.com/p?a=b', '', {}), + 'method': request.Request('POST', 'http://host.com/p?a=b', '', {}), 'scheme': request.Request('GET', 'https://host.com:80/p?a=b', '', {}), - 'host': request.Request('GET', 'http://another-host.com:80/p?a=b', '', {}), + 'host': request.Request('GET', 'http://another-host.com/p?a=b', '', {}), 'port': request.Request('GET', 'http://host.com:90/p?a=b', '', {}), - 'path': request.Request('GET', 'http://host.com:80/x?a=b', '', {}), - 'query': request.Request('GET', 'http://host.com:80/p?c=d', '', {}), + 'path': request.Request('GET', 'http://host.com/x?a=b', '', {}), + 'query': request.Request('GET', 'http://host.com/p?c=d', '', {}), } @@ -36,13 +36,13 @@ def test_uri_matcher(): def test_query_matcher(): - req1 = request.Request('GET', 'http://host.com:80/?a=b&c=d', '', {}) - req2 = request.Request('GET', 'http://host.com:80/?c=d&a=b', '', {}) + 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:80/?a=b&a=b&c=d', '', {}) - req2 = request.Request('GET', 'http://host.com:80/?a=b&c=d&a=b', '', {}) - req3 = request.Request('GET', 'http://host.com:80/?c=d&a=b&a=b', '', {}) + 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) diff --git a/tests/unit/test_request.py b/tests/unit/test_request.py index ce0186f..13f5271 100644 --- a/tests/unit/test_request.py +++ b/tests/unit/test_request.py @@ -2,13 +2,13 @@ from vcr.request import Request def test_str(): - req = Request('GET', 'http://www.google.com:80/', '', {}) - str(req) == '' + req = Request('GET', 'http://www.google.com/', '', {}) + str(req) == '' def test_headers(): headers = {'X-Header1': ['h1'], 'X-Header2': 'h2'} - req = Request('GET', 'http://go.com:80/', '', headers) + req = Request('GET', 'http://go.com/', '', headers) assert req.headers == {'X-Header1': ['h1'], 'X-Header2': ['h2']} req.add_header('X-Header1', 'h11') @@ -17,7 +17,7 @@ def test_headers(): def test_flat_headers_dict(): headers = {'X-Header1': ['h1', 'h11'], 'X-Header2': ['h2']} - req = Request('GET', 'http://go.com:80/', '', headers) + req = Request('GET', 'http://go.com/', '', headers) assert req.flat_headers_dict() == {'X-Header1': 'h1', 'X-Header2': 'h2'}