Hello community,
here is the log from the commit of package python-responses for
openSUSE:Factory checked in at 2020-06-10 00:34:33
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-responses (Old)
and /work/SRC/openSUSE:Factory/.python-responses.new.3606 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-responses"
Wed Jun 10 00:34:33 2020 rev:13 rq:812533 version:0.10.14
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-responses/python-responses.changes
2020-06-05 19:59:06.343708629 +0200
+++
/work/SRC/openSUSE:Factory/.python-responses.new.3606/python-responses.changes
2020-06-10 00:34:37.032786815 +0200
@@ -1,0 +2,7 @@
+Mon Jun 8 10:18:01 UTC 2020 - Ondřej Súkup <[email protected]>
+
+- update to 0.10.14
+ * Improved handling of unicode bodies
+ * Streamlined querysting matching code
+
+-------------------------------------------------------------------
Old:
----
responses-0.10.12.tar.gz
New:
----
responses-0.10.14.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-responses.spec ++++++
--- /var/tmp/diff_new_pack.Zmq5QA/_old 2020-06-10 00:34:38.020789464 +0200
+++ /var/tmp/diff_new_pack.Zmq5QA/_new 2020-06-10 00:34:38.024789475 +0200
@@ -1,7 +1,7 @@
#
# spec file for package python-responses
#
-# Copyright (c) 2020 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,7 +18,7 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-responses
-Version: 0.10.12
+Version: 0.10.14
Release: 0
Summary: A utility library for mocking out the `requests` Python library
License: Apache-2.0
++++++ responses-0.10.12.tar.gz -> responses-0.10.14.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/responses-0.10.12/CHANGES
new/responses-0.10.14/CHANGES
--- old/responses-0.10.12/CHANGES 2020-03-03 03:50:19.000000000 +0100
+++ new/responses-0.10.14/CHANGES 2020-04-20 04:26:10.000000000 +0200
@@ -1,3 +1,11 @@
+0.10.13
+-------
+
+- Improved README examples.
+- Improved handling of unicode bodies. The inferred content-type for unicode
+ bodies is now `text/plain; charset=utf-8`.
+- Streamlined querysting matching code.
+
0.10.12
-------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/responses-0.10.12/PKG-INFO
new/responses-0.10.14/PKG-INFO
--- old/responses-0.10.12/PKG-INFO 2020-03-03 03:50:59.000000000 +0100
+++ new/responses-0.10.14/PKG-INFO 2020-04-20 04:26:47.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: responses
-Version: 0.10.12
+Version: 0.10.14
Summary: A utility library for mocking out the `requests` Python library.
Home-page: https://github.com/getsentry/responses
Author: David Cramer
@@ -246,7 +246,7 @@
)
- You can see params passed in the original ``request`` in
``responses.calls[].request.params``:
+ You can see params passed in the original ``request`` in
``responses.calls[].request.params``:
.. code-block:: python
@@ -263,7 +263,7 @@
)
resp = requests.get('http://example.com', params={"hello":
"world"})
- assert response.calls[0].request.params == {"hello": "world"}
+ assert responses.calls[0].request.params == {"hello": "world"}
Responses as a context manager
------------------------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/responses-0.10.12/README.rst
new/responses-0.10.14/README.rst
--- old/responses-0.10.12/README.rst 2020-03-03 03:50:19.000000000 +0100
+++ new/responses-0.10.14/README.rst 2020-04-20 04:26:10.000000000 +0200
@@ -239,7 +239,7 @@
)
-You can see params passed in the original ``request`` in
``responses.calls[].request.params``:
+You can see params passed in the original ``request`` in
``responses.calls[].request.params``:
.. code-block:: python
@@ -256,7 +256,7 @@
)
resp = requests.get('http://example.com', params={"hello": "world"})
- assert response.calls[0].request.params == {"hello": "world"}
+ assert responses.calls[0].request.params == {"hello": "world"}
Responses as a context manager
------------------------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/responses-0.10.12/responses.egg-info/PKG-INFO
new/responses-0.10.14/responses.egg-info/PKG-INFO
--- old/responses-0.10.12/responses.egg-info/PKG-INFO 2020-03-03
03:50:59.000000000 +0100
+++ new/responses-0.10.14/responses.egg-info/PKG-INFO 2020-04-20
04:26:47.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: responses
-Version: 0.10.12
+Version: 0.10.14
Summary: A utility library for mocking out the `requests` Python library.
Home-page: https://github.com/getsentry/responses
Author: David Cramer
@@ -246,7 +246,7 @@
)
- You can see params passed in the original ``request`` in
``responses.calls[].request.params``:
+ You can see params passed in the original ``request`` in
``responses.calls[].request.params``:
.. code-block:: python
@@ -263,7 +263,7 @@
)
resp = requests.get('http://example.com', params={"hello":
"world"})
- assert response.calls[0].request.params == {"hello": "world"}
+ assert responses.calls[0].request.params == {"hello": "world"}
Responses as a context manager
------------------------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/responses-0.10.12/responses.py
new/responses-0.10.14/responses.py
--- old/responses-0.10.12/responses.py 2020-03-03 03:50:19.000000000 +0100
+++ new/responses-0.10.14/responses.py 2020-04-20 04:26:10.000000000 +0200
@@ -270,17 +270,7 @@
url_qsl = sorted(parse_qsl(url_parsed.query))
other_qsl = sorted(parse_qsl(other_parsed.query))
- if len(url_qsl) != len(other_qsl):
- return False
-
- for (a_k, a_v), (b_k, b_v) in zip(url_qsl, other_qsl):
- if a_k != b_k:
- return False
-
- if a_v != b_v:
- return False
-
- return True
+ return url_qsl == other_qsl
def _should_match_querystring(self, match_querystring_argument):
if match_querystring_argument is not _unspecified:
@@ -355,11 +345,10 @@
content_type = "application/json"
if content_type is UNSET:
- content_type = "text/plain"
-
- # body must be bytes
- if isinstance(body, six.text_type):
- body = body.encode("utf-8")
+ if isinstance(body, six.text_type) and _has_unicode(body):
+ content_type = "text/plain; charset=utf-8"
+ else:
+ content_type = "text/plain"
self.body = body
self.status = status
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/responses-0.10.12/setup.py
new/responses-0.10.14/setup.py
--- old/responses-0.10.12/setup.py 2020-03-03 03:50:19.000000000 +0100
+++ new/responses-0.10.14/setup.py 2020-04-20 04:26:10.000000000 +0200
@@ -54,7 +54,7 @@
setup(
name="responses",
- version="0.10.12",
+ version="0.10.14",
author="David Cramer",
description=("A utility library for mocking out the `requests` Python
library."),
url="https://github.com/getsentry/responses",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/responses-0.10.12/test_responses.py
new/responses-0.10.14/test_responses.py
--- old/responses-0.10.12/test_responses.py 2020-03-03 03:50:19.000000000
+0100
+++ new/responses-0.10.14/test_responses.py 2020-04-20 04:26:10.000000000
+0200
@@ -5,6 +5,7 @@
import inspect
import re
import six
+from io import BufferedReader, BytesIO
import pytest
import requests
@@ -334,6 +335,20 @@
assert_reset()
+def test_match_querystring_missing_key():
+ @responses.activate
+ def run():
+ responses.add(responses.GET, "http://example.com?foo=1&bar=2",
body=b"test")
+ with pytest.raises(ConnectionError):
+ requests.get("http://example.com/?foo=1&baz=2")
+
+ with pytest.raises(ConnectionError):
+ requests.get("http://example.com/?bar=2&fez=1")
+
+ run()
+ assert_reset()
+
+
def test_accept_string_body():
@responses.activate
def run():
@@ -909,6 +924,36 @@
assert_reset()
+def test_handles_unicode_body():
+ url = "http://example.com/test"
+
+ @responses.activate
+ def run():
+ responses.add(responses.GET, url, body="михољско лето")
+
+ resp = requests.get(url)
+
+ assert_response(resp, "михољско лето", content_type="text/plain;
charset=utf-8")
+
+ run()
+ assert_reset()
+
+
+def test_handles_buffered_reader_body():
+ url = "http://example.com/test"
+
+ @responses.activate
+ def run():
+ responses.add(responses.GET, url,
body=BufferedReader(BytesIO(b"test")))
+
+ resp = requests.get(url)
+
+ assert_response(resp, "test")
+
+ run()
+ assert_reset()
+
+
def test_headers():
@responses.activate
def run():
@@ -969,6 +1014,21 @@
run()
assert_reset()
+
+
+def test_multiple_methods():
+ @responses.activate
+ def run():
+ responses.add(responses.GET, "http://example.com/one", body="gotcha")
+ responses.add(responses.POST, "http://example.com/one", body="posted")
+
+ resp = requests.get("http://example.com/one")
+ assert_response(resp, "gotcha")
+ resp = requests.post("http://example.com/one")
+ assert_response(resp, "posted")
+
+ run()
+ assert_reset()
def test_passthru(httpserver):