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 2024-05-13 17:56:56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-mocket (Old) and /work/SRC/openSUSE:Factory/.python-mocket.new.1880 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-mocket" Mon May 13 17:56:56 2024 rev:34 rq:1172444 version:3.12.6 Changes: -------- --- /work/SRC/openSUSE:Factory/python-mocket/python-mocket.changes 2024-02-07 18:48:36.563128927 +0100 +++ /work/SRC/openSUSE:Factory/.python-mocket.new.1880/python-mocket.changes 2024-05-13 17:57:00.883560889 +0200 @@ -1,0 +2,8 @@ +Sun May 5 12:58:39 UTC 2024 - Sebastian Wagner <se...@sebix.at> + +- Update to version 3.12.6: + - Strict mode check should accept a location as str by @mindflayer in #230 +- Update to version 3.12.5: + - Add getblocking() method by @mindflayer in #228 + +------------------------------------------------------------------- Old: ---- mocket-3.12.4.tar.gz New: ---- mocket-3.12.6.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-mocket.spec ++++++ --- /var/tmp/diff_new_pack.uioEKW/_old 2024-05-13 17:57:02.051603506 +0200 +++ /var/tmp/diff_new_pack.uioEKW/_new 2024-05-13 17:57:02.055603652 +0200 @@ -27,7 +27,7 @@ %{?sle15_python_module_pythons} Name: python-mocket%{psuffix} -Version: 3.12.4 +Version: 3.12.6 Release: 0 Summary: Python socket mock framework License: BSD-3-Clause ++++++ mocket-3.12.4.tar.gz -> mocket-3.12.6.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mocket-3.12.4/PKG-INFO new/mocket-3.12.6/PKG-INFO --- old/mocket-3.12.4/PKG-INFO 2020-02-02 01:00:00.000000000 +0100 +++ new/mocket-3.12.6/PKG-INFO 2020-02-02 01:00:00.000000000 +0100 @@ -1,6 +1,6 @@ -Metadata-Version: 2.1 +Metadata-Version: 2.3 Name: mocket -Version: 3.12.4 +Version: 3.12.6 Summary: Socket Mock Framework - for all kinds of socket animals, web-clients included - with gevent/asyncio/SSL support Project-URL: github, https://github.com/mindflayer/python-mocket Author-email: Giorgio Salluzzo <giorgio.sallu...@gmail.com> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mocket-3.12.4/mocket/__init__.py new/mocket-3.12.6/mocket/__init__.py --- old/mocket-3.12.4/mocket/__init__.py 2020-02-02 01:00:00.000000000 +0100 +++ new/mocket-3.12.6/mocket/__init__.py 2020-02-02 01:00:00.000000000 +0100 @@ -3,4 +3,4 @@ __all__ = ("async_mocketize", "mocketize", "Mocket", "MocketEntry", "Mocketizer") -__version__ = "3.12.4" +__version__ = "3.12.6" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mocket-3.12.4/mocket/mocket.py new/mocket-3.12.6/mocket/mocket.py --- old/mocket-3.12.4/mocket/mocket.py 2020-02-02 01:00:00.000000000 +0100 +++ new/mocket-3.12.6/mocket/mocket.py 2020-02-02 01:00:00.000000000 +0100 @@ -235,6 +235,9 @@ def setblocking(self, block): self.settimeout(None) if block else self.settimeout(0.0) + def getblocking(self): + return self.gettimeout() is None + def getsockname(self): return socket.gethostbyname(self._address[0]), self._address[1] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mocket-3.12.4/mocket/utils.py new/mocket-3.12.6/mocket/utils.py --- old/mocket-3.12.4/mocket/utils.py 2020-02-02 01:00:00.000000000 +0100 +++ new/mocket-3.12.6/mocket/utils.py 2020-02-02 01:00:00.000000000 +0100 @@ -57,12 +57,17 @@ def is_allowed(self, location: Union[str, Tuple[str, int]]) -> bool: """ Checks if (`host`, `port`) or at least `host` - are allowed locationsto perform real `socket` calls + are allowed locations to perform real `socket` calls """ if not self.STRICT: return True - host, _ = location - return location in self.STRICT_ALLOWED or host in self.STRICT_ALLOWED + try: + host, _ = location + except ValueError: + host = None + return location in self.STRICT_ALLOWED or ( + host is not None and host in self.STRICT_ALLOWED + ) @staticmethod def raise_not_allowed(): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mocket-3.12.4/pyproject.toml new/mocket-3.12.6/pyproject.toml --- old/mocket-3.12.4/pyproject.toml 2020-02-02 01:00:00.000000000 +0100 +++ new/mocket-3.12.6/pyproject.toml 2020-02-02 01:00:00.000000000 +0100 @@ -1,5 +1,5 @@ [build-system] -requires = ["hatchling"] +requires = ["hatchling>=1.22.2"] build-backend = "hatchling.build" [project] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mocket-3.12.4/tests/main/test_mode.py new/mocket-3.12.6/tests/main/test_mode.py --- old/mocket-3.12.4/tests/main/test_mode.py 2020-02-02 01:00:00.000000000 +0100 +++ new/mocket-3.12.6/tests/main/test_mode.py 2020-02-02 01:00:00.000000000 +0100 @@ -65,7 +65,8 @@ Mocketizer(strict_mode=False, strict_mode_allowed=["foobar.local"]) -def test_strict_mode_false_always_allowed(): - with Mocketizer(strict_mode=False): - assert MocketMode().is_allowed("foobar.com") - assert MocketMode().is_allowed(("foobar.com", 443)) +@pytest.mark.parametrize("strict_mode_on", (False, True)) +def test_strict_mode_allowed_or_not(strict_mode_on): + with Mocketizer(strict_mode=strict_mode_on): + assert MocketMode().is_allowed("foobar.com") is not strict_mode_on + assert MocketMode().is_allowed(("foobar.com", 443)) is not strict_mode_on diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mocket-3.12.4/tests/main/test_socket.py new/mocket-3.12.6/tests/main/test_socket.py --- old/mocket-3.12.4/tests/main/test_socket.py 1970-01-01 01:00:00.000000000 +0100 +++ new/mocket-3.12.6/tests/main/test_socket.py 2020-02-02 01:00:00.000000000 +0100 @@ -0,0 +1,13 @@ +import socket + +import pytest + +from mocket.mocket import MocketSocket + + +@pytest.mark.parametrize("blocking", (False, True)) +def test_blocking_socket(blocking): + sock = MocketSocket(socket.AF_INET, socket.SOCK_STREAM) + sock.connect(("locahost", 1234)) + sock.setblocking(blocking) + assert sock.getblocking() is blocking