Hello community, here is the log from the commit of package python-httmock for openSUSE:Factory checked in at 2020-12-01 14:23:11 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-httmock (Old) and /work/SRC/openSUSE:Factory/.python-httmock.new.5913 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-httmock" Tue Dec 1 14:23:11 2020 rev:4 rq:851912 version:1.4.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-httmock/python-httmock.changes 2019-03-05 12:23:31.792874220 +0100 +++ /work/SRC/openSUSE:Factory/.python-httmock.new.5913/python-httmock.changes 2020-12-01 14:23:24.365633527 +0100 @@ -1,0 +2,6 @@ +Sun Nov 29 19:33:50 UTC 2020 - ecsos <[email protected]> + +- Update to 1.4.0: + - No changelog from upstream. + +------------------------------------------------------------------- Old: ---- 1.3.0.tar.gz New: ---- 1.4.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-httmock.spec ++++++ --- /var/tmp/diff_new_pack.psB8XH/_old 2020-12-01 14:23:24.917634125 +0100 +++ /var/tmp/diff_new_pack.psB8XH/_new 2020-12-01 14:23:24.917634125 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-httmock # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,12 +18,12 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-httmock -Version: 1.3.0 +Version: 1.4.0 Release: 0 Summary: A mocking library for requests License: Apache-2.0 Group: Development/Languages/Python -Url: https://github.com/patrys/httmock +URL: https://github.com/patrys/httmock Source: https://github.com/patrys/httmock/archive/%{version}.tar.gz BuildRequires: %{python_module setuptools} BuildRequires: fdupes ++++++ 1.3.0.tar.gz -> 1.4.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/httmock-1.3.0/.travis.yml new/httmock-1.4.0/.travis.yml --- old/httmock-1.3.0/.travis.yml 2019-01-28 18:19:10.000000000 +0100 +++ new/httmock-1.4.0/.travis.yml 2020-10-28 13:00:08.000000000 +0100 @@ -1,3 +1,7 @@ +os: linux +arch: + - amd64 + - ppc64le language: python python: - 2.7 @@ -5,6 +9,12 @@ - 3.4 - 3.5 - 3.6 + - 3.7 + - 3.8 +jobs: + exclude: + - arch: ppc64le + python: pypy install: - "pip install requests" script: nosetests diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/httmock-1.3.0/httmock.py new/httmock-1.4.0/httmock.py --- old/httmock-1.3.0/httmock.py 2019-01-28 18:19:10.000000000 +0100 +++ new/httmock-1.4.0/httmock.py 2020-10-28 13:00:08.000000000 +0100 @@ -14,10 +14,7 @@ if sys.version_info >= (3, 0, 0): from io import BytesIO else: - try: - from cStringIO import StringIO as BytesIO - except ImportError: - from StringIO import StringIO as BytesIO + from StringIO import StringIO as BytesIO binary_type = bytes @@ -39,7 +36,7 @@ def response(status_code=200, content='', headers=None, reason=None, elapsed=0, - request=None, stream=False): + request=None, stream=False, http_vsn=11): res = requests.Response() res.status_code = status_code if isinstance(content, (dict, list)): @@ -64,6 +61,7 @@ res.raw = BytesIO(content) else: res.raw = BytesIO(b'') + res.raw.version = http_vsn # normally this closes the underlying connection, # but we have nothing to free. @@ -194,7 +192,7 @@ response = history.pop() response.history = tuple(history) - session.cookies = response.cookies + session.cookies.update(response.cookies) return response @@ -231,7 +229,8 @@ res.get('reason'), res.get('elapsed', 0), request, - stream=kwargs.get('stream', False)) + stream=kwargs.get('stream', False), + http_vsn=res.get('http_vsn', 11)) elif isinstance(res, (text_type, binary_type)): return response(content=res, stream=kwargs.get('stream', False)) elif res is None: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/httmock-1.3.0/setup.py new/httmock-1.4.0/setup.py --- old/httmock-1.3.0/setup.py 2019-01-28 18:19:10.000000000 +0100 +++ new/httmock-1.4.0/setup.py 2020-10-28 13:00:08.000000000 +0100 @@ -3,15 +3,12 @@ from setuptools import setup import os -LICENSE = open( - os.path.join(os.path.dirname(__file__), 'LICENSE')).read().strip() - DESCRIPTION = open( os.path.join(os.path.dirname(__file__), 'README.md')).read().strip() setup( name='httmock', - version='1.3.0', + version='1.4.0', description='A mocking library for requests.', author='Patryk Zawadzki', author_email='[email protected]', @@ -22,9 +19,11 @@ 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 3', 'Intended Audience :: Developers', + 'License :: OSI Approved :: Apache Software License', 'Topic :: Software Development :: Testing', 'Operating System :: OS Independent'], install_requires=['requests >= 1.0.0'], - license=LICENSE, + license='Apache-2.0', long_description=DESCRIPTION, + long_description_content_type='text/markdown', test_suite='tests') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/httmock-1.3.0/tests.py new/httmock-1.4.0/tests.py --- old/httmock-1.3.0/tests.py 2019-01-28 18:19:10.000000000 +0100 +++ new/httmock-1.4.0/tests.py 2020-10-28 13:00:08.000000000 +0100 @@ -66,7 +66,8 @@ def dict_any_mock(url, request): return { 'content': 'Hello from %s' % (url.netloc,), - 'status_code': 200 + 'status_code': 200, + 'http_vsn': 10, } @@ -136,6 +137,13 @@ self.assertEqual(r.text, u'Motörhead') self.assertEqual(r.content, r.text.encode('utf-8')) + def test_has_raw_version(self): + with HTTMock(any_mock): + r = requests.get('http://example.com') + self.assertEqual(r.raw.version, 11) + with HTTMock(dict_any_mock): + r = requests.get('http://example.com') + self.assertEqual(r.raw.version, 10) class DecoratorTest(unittest.TestCase): @@ -242,6 +250,11 @@ r = response(200, None, {'Content-Type': 'application/json'}) self.assertEqual(r.headers['content-type'], 'application/json') + def test_response_raw_version(self): + r = response(200, None, {'Content-Type': 'application/json'}, + http_vsn=10) + self.assertEqual(r.raw.version, 10) + def test_response_cookies(self): @all_requests def response_content(url, request): @@ -268,6 +281,18 @@ self.assertTrue('foo' in session.cookies) self.assertEqual(session.cookies['foo'], 'bar') + def test_session_persistent_cookies(self): + session = requests.Session() + with HTTMock(lambda u, r: response(200, 'Foo', {'Set-Cookie': 'foo=bar;'}, request=r)): + session.get('https://foo_bar') + with HTTMock(lambda u, r: response(200, 'Baz', {'Set-Cookie': 'baz=qux;'}, request=r)): + session.get('https://baz_qux') + self.assertEqual(len(session.cookies), 2) + self.assertTrue('foo' in session.cookies) + self.assertEqual(session.cookies['foo'], 'bar') + self.assertTrue('baz' in session.cookies) + self.assertEqual(session.cookies['baz'], 'qux') + def test_python_version_encoding_differences(self): # Previous behavior would result in this test failing in Python3 due # to how requests checks for utf-8 JSON content in requests.utils with: @@ -341,7 +366,7 @@ results = self.several_calls( 1, requests.get, 'http://facebook.com/') - self.assertEquals(facebook_mock_count.call['count'], 1) + self.assertEqual(facebook_mock_count.call['count'], 1) @with_httmock(google_mock_count, facebook_mock_count) def test_several_call_decorated(self): @@ -357,7 +382,7 @@ self.assertEqual(r.content, b'Hello from Facebook') self.several_calls(1, requests.get, 'http://facebook.com/') - self.assertEquals(facebook_mock_count.call['count'], 4) + self.assertEqual(facebook_mock_count.call['count'], 4) def test_store_several_requests(self): with HTTMock(google_mock_store_requests): _______________________________________________ openSUSE Commits mailing list -- [email protected] To unsubscribe, email [email protected] List Netiquette: https://en.opensuse.org/openSUSE:Mailing_list_netiquette List Archives: https://lists.opensuse.org/archives/list/[email protected]
