Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-mocket for openSUSE:Factory checked in at 2022-05-04 15:10:35 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-mocket (Old) and /work/SRC/openSUSE:Factory/.python-mocket.new.1538 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-mocket" Wed May 4 15:10:35 2022 rev:21 rq:974361 version:3.10.5 Changes: -------- --- /work/SRC/openSUSE:Factory/python-mocket/python-mocket.changes 2022-04-23 19:45:37.642959150 +0200 +++ /work/SRC/openSUSE:Factory/.python-mocket.new.1538/python-mocket.changes 2022-05-04 15:10:47.552145604 +0200 @@ -1,0 +2,33 @@ +Mon Apr 25 08:36:19 UTC 2022 - Sebastian Wagner <sebix+novell....@sebix.at> + +- - Bump Mocket version + - MocketEntry.request_class str vs bytes (#177) + * Change request_cls to prevent unintended bytes -> str conversion (#176) + * Use type from `.compat`. + Co-authored-by: Michael Lazar <lazar.michae...@gmail.com> + - Update README.rst + - Remove blank lines after docstring (#174) + Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com> + - Remove assert statement from non-test files (#173) + Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com> + - Small refactor. (#172) + - Update README.rst + - Update LICENSE + - No need for it. + - New badge + - Update README.rst + - Update README.rst + - Add Mocket "strict mode" (#171) + * Add Mocket "strict mode". + - Update main.yml + - Introducing `request_list()` method (#170) + * Introducing `request_list()` method. + - Refactoring. (#169) + - Some cleaning/refactoring (#168) + * Some cleaning/refactoring. + * Improving coverage. + - Update README.rst + - Use literal syntax instead of function calls to create data structure (#167) + Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com> + +------------------------------------------------------------------- Old: ---- mocket-3.10.4.tar.gz New: ---- mocket-3.10.5.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-mocket.spec ++++++ --- /var/tmp/diff_new_pack.GCBYSJ/_old 2022-05-04 15:10:48.020146180 +0200 +++ /var/tmp/diff_new_pack.GCBYSJ/_new 2022-05-04 15:10:48.028146190 +0200 @@ -27,7 +27,7 @@ %{?!python_module:%define python_module() python3-%{**}} %define skip_python2 1 Name: python-mocket%{psuffix} -Version: 3.10.4 +Version: 3.10.5 Release: 0 Summary: Python socket mock framework License: BSD-3-Clause ++++++ mocket-3.10.4.tar.gz -> mocket-3.10.5.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mocket-3.10.4/LICENSE new/mocket-3.10.5/LICENSE --- old/mocket-3.10.4/LICENSE 2021-09-11 12:18:09.000000000 +0200 +++ new/mocket-3.10.5/LICENSE 2022-02-19 13:30:19.000000000 +0100 @@ -1,4 +1,4 @@ -Copyright (c) 2017-2021 Giorgio Salluzzo and individual contributors. All rights reserved. +Copyright (c) 2017-2022 Giorgio Salluzzo and individual contributors. All rights reserved. Copyright (c) 2013-2017 Andrea de Marco, Giorgio Salluzzo and individual contributors. All rights reserved. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mocket-3.10.4/PKG-INFO new/mocket-3.10.5/PKG-INFO --- old/mocket-3.10.4/PKG-INFO 2022-01-09 17:57:03.872046000 +0100 +++ new/mocket-3.10.5/PKG-INFO 2022-04-25 08:58:09.638920800 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: mocket -Version: 3.10.4 +Version: 3.10.5 Summary: Socket Mock Framework - for all kinds of socket animals, web-clients included - with gevent/asyncio/SSL support Home-page: https://github.com/mindflayer/python-mocket Author: Giorgio Salluzzo @@ -36,8 +36,8 @@ .. image:: https://coveralls.io/repos/github/mindflayer/python-mocket/badge.svg?branch=master :target: https://coveralls.io/github/mindflayer/python-mocket?branch=master -.. image:: https://img.shields.io/lgtm/grade/python/g/mindflayer/python-mocket.svg?logo=lgtm&logoWidth=18 - :target: https://lgtm.com/projects/g/mindflayer/python-mocket/context:python +.. image:: https://app.codacy.com/project/badge/Grade/6327640518ce42adaf59368217028f14 + :target: https://www.codacy.com/gh/mindflayer/python-mocket/dashboard A socket mock framework @@ -46,6 +46,15 @@ ...and then MicroPython's *urequests* (*mocket >= 3.9.1*) +Outside GitHub +============== + +Thanks to `@felixonmars`_, Mocket is available in the `Arch Linux repository`_. It's also packaged for `openSUSE`_ and `NixOS`_. + +.. _`@felixonmars`: https://github.com/felixonmars +.. _`Arch Linux repository`: https://www.archlinux.org/packages/community/any/python-mocket/ +.. _`openSUSE`: https://software.opensuse.org/package/python-mocket +.. _`NixOS`: https://search.nixos.org/packages?query=mocket Versioning ========== @@ -57,22 +66,18 @@ ========== *Star* the project on GitHub, *Buy Me a Coffee* clicking the button below or, even better, contribute with patches or documentation. -Thanks to `@felixonmars`_ Mocket is available in the `Arch Linux repository`_. - -.. _`@felixonmars`: https://github.com/felixonmars -.. _`Arch Linux repository`: https://www.archlinux.org/packages/community/any/python-mocket/ - .. image:: https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png :target: https://www.buymeacoffee.com/mULbInw5z :alt: Buy Me A Coffee How to use it ============= -Read these three blog posts if you want to have a big picture of what *Mocket* is capable of: +Read the following blog posts if you want to have a big picture of what *Mocket* is capable of: - https://medium.com/p/mocket-is-alive-and-is-fighting-with-us-b2810d52597a - https://hackernoon.com/make-development-great-again-faab769d264e - https://hackernoon.com/httpretty-now-supports-asyncio-e310814704c6 +- https://medium.com/@mindflayer/how-to-make-your-tests-fail-when-they-try-to-access-the-network-python-eb80090a6d24 The starting point to understand how to use *Mocket* to write a custom mock is the following example: @@ -107,7 +112,7 @@ ====================================== Let's create a new virtualenv with all we need:: - $ virtualenv example + $ python3 -m venv example $ source example/bin/activate $ pip install pytest requests mocket diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mocket-3.10.4/README.rst new/mocket-3.10.5/README.rst --- old/mocket-3.10.4/README.rst 2022-01-09 17:53:30.000000000 +0100 +++ new/mocket-3.10.5/README.rst 2022-04-25 08:34:32.000000000 +0200 @@ -8,8 +8,8 @@ .. image:: https://coveralls.io/repos/github/mindflayer/python-mocket/badge.svg?branch=master :target: https://coveralls.io/github/mindflayer/python-mocket?branch=master -.. image:: https://img.shields.io/lgtm/grade/python/g/mindflayer/python-mocket.svg?logo=lgtm&logoWidth=18 - :target: https://lgtm.com/projects/g/mindflayer/python-mocket/context:python +.. image:: https://app.codacy.com/project/badge/Grade/6327640518ce42adaf59368217028f14 + :target: https://www.codacy.com/gh/mindflayer/python-mocket/dashboard A socket mock framework @@ -18,6 +18,15 @@ ...and then MicroPython's *urequests* (*mocket >= 3.9.1*) +Outside GitHub +============== + +Thanks to `@felixonmars`_, Mocket is available in the `Arch Linux repository`_. It's also packaged for `openSUSE`_ and `NixOS`_. + +.. _`@felixonmars`: https://github.com/felixonmars +.. _`Arch Linux repository`: https://www.archlinux.org/packages/community/any/python-mocket/ +.. _`openSUSE`: https://software.opensuse.org/package/python-mocket +.. _`NixOS`: https://search.nixos.org/packages?query=mocket Versioning ========== @@ -29,22 +38,18 @@ ========== *Star* the project on GitHub, *Buy Me a Coffee* clicking the button below or, even better, contribute with patches or documentation. -Thanks to `@felixonmars`_ Mocket is available in the `Arch Linux repository`_. - -.. _`@felixonmars`: https://github.com/felixonmars -.. _`Arch Linux repository`: https://www.archlinux.org/packages/community/any/python-mocket/ - .. image:: https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png :target: https://www.buymeacoffee.com/mULbInw5z :alt: Buy Me A Coffee How to use it ============= -Read these three blog posts if you want to have a big picture of what *Mocket* is capable of: +Read the following blog posts if you want to have a big picture of what *Mocket* is capable of: - https://medium.com/p/mocket-is-alive-and-is-fighting-with-us-b2810d52597a - https://hackernoon.com/make-development-great-again-faab769d264e - https://hackernoon.com/httpretty-now-supports-asyncio-e310814704c6 +- https://medium.com/@mindflayer/how-to-make-your-tests-fail-when-they-try-to-access-the-network-python-eb80090a6d24 The starting point to understand how to use *Mocket* to write a custom mock is the following example: @@ -79,7 +84,7 @@ ====================================== Let's create a new virtualenv with all we need:: - $ virtualenv example + $ python3 -m venv example $ source example/bin/activate $ pip install pytest requests mocket diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mocket-3.10.4/mocket/__init__.py new/mocket-3.10.5/mocket/__init__.py --- old/mocket-3.10.4/mocket/__init__.py 2022-01-09 17:53:30.000000000 +0100 +++ new/mocket-3.10.5/mocket/__init__.py 2022-04-25 08:51:32.000000000 +0200 @@ -3,4 +3,4 @@ __all__ = ("async_mocketize", "mocketize", "Mocket", "MocketEntry", "Mocketizer") -__version__ = "3.10.4" +__version__ = "3.10.5" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mocket-3.10.4/mocket/mocket.py new/mocket-3.10.5/mocket/mocket.py --- old/mocket-3.10.4/mocket/mocket.py 2022-01-09 17:53:30.000000000 +0100 +++ new/mocket-3.10.5/mocket/mocket.py 2022-04-25 08:49:46.000000000 +0200 @@ -467,7 +467,8 @@ if truesocket_recording_dir: # JSON dumps will be saved here - assert os.path.isdir(truesocket_recording_dir) + if not os.path.isdir(truesocket_recording_dir): + raise AssertionError socket.socket = socket.__dict__["socket"] = MocketSocket socket._socketobject = socket.__dict__["_socketobject"] = MocketSocket @@ -547,9 +548,8 @@ @classmethod def assert_fail_if_entries_not_served(cls): """Mocket checks that all entries have been served at least once.""" - assert all( - entry._served for entry in itertools.chain(*cls._entries.values()) - ), "Some Mocket entries have not been served" + if not all(entry._served for entry in itertools.chain(*cls._entries.values())): + raise AssertionError("Some Mocket entries have not been served") class MocketEntry: @@ -559,7 +559,7 @@ return self response_index = 0 - request_cls = str + request_cls = byte_type response_cls = Response responses = None _served = None diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mocket-3.10.4/mocket.egg-info/PKG-INFO new/mocket-3.10.5/mocket.egg-info/PKG-INFO --- old/mocket-3.10.4/mocket.egg-info/PKG-INFO 2022-01-09 17:57:03.000000000 +0100 +++ new/mocket-3.10.5/mocket.egg-info/PKG-INFO 2022-04-25 08:58:09.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: mocket -Version: 3.10.4 +Version: 3.10.5 Summary: Socket Mock Framework - for all kinds of socket animals, web-clients included - with gevent/asyncio/SSL support Home-page: https://github.com/mindflayer/python-mocket Author: Giorgio Salluzzo @@ -36,8 +36,8 @@ .. image:: https://coveralls.io/repos/github/mindflayer/python-mocket/badge.svg?branch=master :target: https://coveralls.io/github/mindflayer/python-mocket?branch=master -.. image:: https://img.shields.io/lgtm/grade/python/g/mindflayer/python-mocket.svg?logo=lgtm&logoWidth=18 - :target: https://lgtm.com/projects/g/mindflayer/python-mocket/context:python +.. image:: https://app.codacy.com/project/badge/Grade/6327640518ce42adaf59368217028f14 + :target: https://www.codacy.com/gh/mindflayer/python-mocket/dashboard A socket mock framework @@ -46,6 +46,15 @@ ...and then MicroPython's *urequests* (*mocket >= 3.9.1*) +Outside GitHub +============== + +Thanks to `@felixonmars`_, Mocket is available in the `Arch Linux repository`_. It's also packaged for `openSUSE`_ and `NixOS`_. + +.. _`@felixonmars`: https://github.com/felixonmars +.. _`Arch Linux repository`: https://www.archlinux.org/packages/community/any/python-mocket/ +.. _`openSUSE`: https://software.opensuse.org/package/python-mocket +.. _`NixOS`: https://search.nixos.org/packages?query=mocket Versioning ========== @@ -57,22 +66,18 @@ ========== *Star* the project on GitHub, *Buy Me a Coffee* clicking the button below or, even better, contribute with patches or documentation. -Thanks to `@felixonmars`_ Mocket is available in the `Arch Linux repository`_. - -.. _`@felixonmars`: https://github.com/felixonmars -.. _`Arch Linux repository`: https://www.archlinux.org/packages/community/any/python-mocket/ - .. image:: https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png :target: https://www.buymeacoffee.com/mULbInw5z :alt: Buy Me A Coffee How to use it ============= -Read these three blog posts if you want to have a big picture of what *Mocket* is capable of: +Read the following blog posts if you want to have a big picture of what *Mocket* is capable of: - https://medium.com/p/mocket-is-alive-and-is-fighting-with-us-b2810d52597a - https://hackernoon.com/make-development-great-again-faab769d264e - https://hackernoon.com/httpretty-now-supports-asyncio-e310814704c6 +- https://medium.com/@mindflayer/how-to-make-your-tests-fail-when-they-try-to-access-the-network-python-eb80090a6d24 The starting point to understand how to use *Mocket* to write a custom mock is the following example: @@ -107,7 +112,7 @@ ====================================== Let's create a new virtualenv with all we need:: - $ virtualenv example + $ python3 -m venv example $ source example/bin/activate $ pip install pytest requests mocket diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mocket-3.10.4/tests/main/test_http.py new/mocket-3.10.5/tests/main/test_http.py --- old/mocket-3.10.4/tests/main/test_http.py 2022-01-08 17:50:17.000000000 +0100 +++ new/mocket-3.10.5/tests/main/test_http.py 2022-04-25 08:34:32.000000000 +0200 @@ -320,7 +320,7 @@ Entry.single_register(Entry.POST, url, status=201) file_obj = open("tests/fluidicon.png", "rb") files = {"content": file_obj} - r = requests.post(url, files=files, data={}, verify=False) + r = requests.post(url, files=files, data={}) self.assertEqual(r.status_code, 201) @mocketize @@ -336,7 +336,6 @@ https://github.com/mindflayer/python-mocket/issues/111 https://gist.github.com/amotl/015ef6b336db55128798d7f1a9a67dea """ - # Define HTTP conversation. url = "http://127.0.0.1:8080/api/data" Entry.single_register(Entry.POST, url) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mocket-3.10.4/tests/main/test_httpretty.py new/mocket-3.10.5/tests/main/test_httpretty.py --- old/mocket-3.10.4/tests/main/test_httpretty.py 2021-06-06 20:03:57.000000000 +0200 +++ new/mocket-3.10.5/tests/main/test_httpretty.py 2022-04-25 08:34:32.000000000 +0200 @@ -35,7 +35,6 @@ @httprettified def test_httpretty_should_mock_a_simple_get_with_requests_read(): """HTTPretty should mock a simple GET with requests.get""" - httpretty.register_uri( httpretty.GET, "http://yipit.com/", body="Find the best daily deals" ) @@ -49,7 +48,6 @@ @httprettified def test_httpretty_provides_easy_access_to_querystrings(): """HTTPretty should provide an easy access to the querystring""" - HTTPretty.register_uri( HTTPretty.GET, "http://yipit.com/", body="Find the best daily deals" ) @@ -63,7 +61,6 @@ @httprettified def test_httpretty_should_mock_headers_requests(): """HTTPretty should mock basic headers with requests""" - HTTPretty.register_uri( HTTPretty.GET, "http://github.com/", @@ -89,7 +86,6 @@ @httprettified def test_httpretty_should_allow_adding_and_overwritting_requests(): """HTTPretty should allow adding and overwritting headers with requests""" - HTTPretty.register_uri( HTTPretty.GET, "http://github.com/foo", @@ -118,7 +114,6 @@ @httprettified def test_httpretty_should_allow_forcing_headers_requests(): """HTTPretty should allow forcing headers with requests""" - HTTPretty.register_uri( HTTPretty.GET, "http://github.com/foo", @@ -137,7 +132,6 @@ def test_httpretty_should_allow_adding_and_overwritting_by_kwargs_u2(): """HTTPretty should allow adding and overwritting headers by keyword args " \ "with requests""" - HTTPretty.register_uri( HTTPretty.GET, "http://github.com/foo", @@ -164,7 +158,6 @@ @httprettified def test_rotating_responses_with_requests(): """HTTPretty should support rotating responses with requests""" - HTTPretty.register_uri( HTTPretty.GET, "https://api.yahoo.com/test", @@ -193,7 +186,6 @@ @httprettified def test_can_inspect_last_request(): """HTTPretty.last_request is a mimetools.Message request from last match""" - HTTPretty.register_uri( HTTPretty.POST, "http://api.github.com/", @@ -215,7 +207,6 @@ @httprettified def test_can_inspect_last_request_with_ssl(): """HTTPretty.last_request is recorded even when mocking 'https' (SSL)""" - HTTPretty.register_uri( HTTPretty.POST, "https://secure.github.com/", @@ -237,7 +228,6 @@ @httprettified def test_httpretty_ignores_querystrings_from_registered_uri(): """HTTPretty should ignore querystrings from the registered uri (requests library)""" - HTTPretty.register_uri( HTTPretty.GET, "http://yipit.com/?id=123", body=b"Find the best daily deals" ) @@ -299,7 +289,6 @@ @httprettified def test_httpretty_should_allow_multiple_methods_for_the_same_uri(): """HTTPretty should allow registering multiple methods for the same uri""" - url = "http://test.com/test" methods = ["GET", "POST", "PUT", "OPTIONS"] for method in methods: @@ -313,7 +302,6 @@ @httprettified def test_httpretty_should_allow_multiple_responses_with_multiple_methods(): """HTTPretty should allow multiple responses when binding multiple methods to the same uri""" - url = "http://test.com/list" # add get responses diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mocket-3.10.4/tests/main/test_mocket.py new/mocket-3.10.5/tests/main/test_mocket.py --- old/mocket-3.10.4/tests/main/test_mocket.py 2022-01-08 17:50:17.000000000 +0100 +++ new/mocket-3.10.5/tests/main/test_mocket.py 2022-04-25 08:49:46.000000000 +0200 @@ -94,6 +94,18 @@ with self.assertRaises(IOError): entry.get_response() + def test_collect_last_request(self): + addr = ("localhost", 80) + + entry = MocketEntry(addr, True) + Mocket.register(entry) + with Mocketizer(): + _so = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + _so.connect(addr) + _so.sendall(b"data\r\n") + _so.close() + self.assertEqual(Mocket.last_request(), b"data\r\n") + def test_subsequent_recv_requests_have_correct_length(self): addr = ("localhost", 80) Mocket.register(MocketEntry(addr, [b"Long payload", b"Short"]))