From 1f453e18a1e7952286efb255439534cc25787c6c Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Mon, 3 Apr 2017 19:40:43 +0100 Subject: [PATCH 1/2] support python3.6 --- .travis.yml | 8 ++++---- setup.py | 2 ++ tox.ini | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2e736a4..fe2068d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,8 +4,8 @@ python: - 2.6 - 2.7 - 3.4 +- 3.5 +- 3.6 - pypy -install: -- pip install requests -- python setup.py install -script: ./runtests.sh +install: pip install -U tox-travis +script: tox diff --git a/setup.py b/setup.py index 11c649c..6ba0cac 100644 --- a/setup.py +++ b/setup.py @@ -44,6 +44,8 @@ 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', ], # What does your project relate to? diff --git a/tox.ini b/tox.ini index 472b865..dc83e16 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ # content of: tox.ini , put in same dir as setup.py [tox] -envlist = py26, py27, py33, py34, pypy +envlist = py26, py27, py33, py34, py35, py36, pypy, pypy3 [testenv] deps = pytest From 4b08f5fbc2a3eecc46d837024a05297958014025 Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Mon, 3 Apr 2017 20:07:24 +0100 Subject: [PATCH 2/2] add test for chunked encoding --- tests/test_httpbin.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/test_httpbin.py b/tests/test_httpbin.py index 35eddbf..4d370e8 100644 --- a/tests/test_httpbin.py +++ b/tests/test_httpbin.py @@ -43,6 +43,14 @@ def test_httpbin_str(httpbin): def test_chunked_encoding(httpbin_both): assert requests.get(httpbin_both.url + '/stream/20').status_code == 200 + +def test_post_chunked_binary(httpbin_both): + data1 = iter([b'data', b'to', b'send']) + url = httpbin_both.url + '/post' + resp = requests.post(url, data1) + assert resp.json()['data'] == b'datatosend' + + @pytest_httpbin.use_class_based_httpbin @pytest_httpbin.use_class_based_httpbin_secure class TestClassBassedTests(unittest.TestCase):