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 2021-06-05 23:30:09
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-mocket (Old)
 and      /work/SRC/openSUSE:Factory/.python-mocket.new.1898 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-mocket"

Sat Jun  5 23:30:09 2021 rev:12 rq:896019 version:3.9.41

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-mocket/python-mocket.changes      
2021-02-04 20:24:08.806832893 +0100
+++ /work/SRC/openSUSE:Factory/.python-mocket.new.1898/python-mocket.changes    
2021-06-05 23:30:25.212321959 +0200
@@ -1,0 +2,9 @@
+Fri May 21 16:02:54 UTC 2021 - Sebastian Wagner <[email protected]>
+
+- update to version 3.9.41:
+ - A few refactors.
+ - Adding `make setup` for local development.
+ - Migrating package creation to using build.  Avoid decorator>=5 as 
dependency. (#149)
+ - Avoid decorator>=5 as dependency. (#149)
+
+-------------------------------------------------------------------

Old:
----
  mocket-3.9.40.tar.gz

New:
----
  mocket-3.9.41.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-mocket.spec ++++++
--- /var/tmp/diff_new_pack.boMOo5/_old  2021-06-05 23:30:26.028323378 +0200
+++ /var/tmp/diff_new_pack.boMOo5/_new  2021-06-05 23:30:26.032323386 +0200
@@ -1,5 +1,5 @@
 #
-# spec file for package python-mocket
+# spec file
 #
 # Copyright (c) 2021 SUSE LLC
 #
@@ -26,7 +26,7 @@
 %bcond_with test
 %endif
 Name:           python-mocket%{psuffix}
-Version:        3.9.40
+Version:        3.9.41
 Release:        0
 Summary:        Python socket mock framework
 License:        BSD-3-Clause
@@ -35,7 +35,7 @@
 BuildRequires:  %{python_module setuptools}
 BuildRequires:  fdupes
 BuildRequires:  python-rpm-macros
-Requires:       python-decorator
+Requires:       python-decorator < 5
 Requires:       python-http-parser >= 0.9.0
 Requires:       python-python-magic
 Requires:       python-six
@@ -94,6 +94,7 @@
 %if !%{with test}
 export LANG=en_US.UTF-8
 %python_install
+%python_expand rm -r %{buildroot}%{$python_sitelib}/app/
 %python_expand %fdupes %{buildroot}%{$python_sitelib}
 %endif
 

++++++ mocket-3.9.40.tar.gz -> mocket-3.9.41.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mocket-3.9.40/PKG-INFO new/mocket-3.9.41/PKG-INFO
--- old/mocket-3.9.40/PKG-INFO  2021-01-21 17:38:53.250246300 +0100
+++ new/mocket-3.9.41/PKG-INFO  2021-05-21 11:06:13.087126300 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: mocket
-Version: 3.9.40
+Version: 3.9.41
 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
@@ -354,6 +354,6 @@
 Classifier: Topic :: Software Development :: Testing
 Classifier: License :: OSI Approved :: BSD License
 Description-Content-Type: text/x-rst
+Provides-Extra: speedups
 Provides-Extra: dev
 Provides-Extra: pook
-Provides-Extra: speedups
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mocket-3.9.40/app/app/asgi.py 
new/mocket-3.9.41/app/app/asgi.py
--- old/mocket-3.9.40/app/app/asgi.py   1970-01-01 01:00:00.000000000 +0100
+++ new/mocket-3.9.41/app/app/asgi.py   2021-03-20 20:06:28.000000000 +0100
@@ -0,0 +1,16 @@
+"""
+ASGI config for app project.
+
+It exposes the ASGI callable as a module-level variable named ``application``.
+
+For more information on this file, see
+https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/
+"""
+
+import os
+
+from django.core.asgi import get_asgi_application
+
+os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'app.settings')
+
+application = get_asgi_application()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mocket-3.9.40/app/app/settings.py 
new/mocket-3.9.41/app/app/settings.py
--- old/mocket-3.9.40/app/app/settings.py       1970-01-01 01:00:00.000000000 
+0100
+++ new/mocket-3.9.41/app/app/settings.py       2021-03-20 20:06:28.000000000 
+0100
@@ -0,0 +1,120 @@
+"""
+Django settings for app project.
+
+Generated by 'django-admin startproject' using Django 3.1.7.
+
+For more information on this file, see
+https://docs.djangoproject.com/en/3.1/topics/settings/
+
+For the full list of settings and their values, see
+https://docs.djangoproject.com/en/3.1/ref/settings/
+"""
+
+from pathlib import Path
+
+# Build paths inside the project like this: BASE_DIR / 'subdir'.
+BASE_DIR = Path(__file__).resolve().parent.parent
+
+
+# Quick-start development settings - unsuitable for production
+# See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/
+
+# SECURITY WARNING: keep the secret key used in production secret!
+SECRET_KEY = 'j4u-^2=!5hyrepm)5x*%^77bt1^@v=7y67h=gu_g^b*ia(ss_#'
+
+# SECURITY WARNING: don't run with debug turned on in production!
+DEBUG = True
+
+ALLOWED_HOSTS = []
+
+
+# Application definition
+
+INSTALLED_APPS = [
+    'django.contrib.admin',
+    'django.contrib.auth',
+    'django.contrib.contenttypes',
+    'django.contrib.sessions',
+    'django.contrib.messages',
+    'django.contrib.staticfiles',
+]
+
+MIDDLEWARE = [
+    'django.middleware.security.SecurityMiddleware',
+    'django.contrib.sessions.middleware.SessionMiddleware',
+    'django.middleware.common.CommonMiddleware',
+    'django.middleware.csrf.CsrfViewMiddleware',
+    'django.contrib.auth.middleware.AuthenticationMiddleware',
+    'django.contrib.messages.middleware.MessageMiddleware',
+    'django.middleware.clickjacking.XFrameOptionsMiddleware',
+]
+
+ROOT_URLCONF = 'app.urls'
+
+TEMPLATES = [
+    {
+        'BACKEND': 'django.template.backends.django.DjangoTemplates',
+        'DIRS': [],
+        'APP_DIRS': True,
+        'OPTIONS': {
+            'context_processors': [
+                'django.template.context_processors.debug',
+                'django.template.context_processors.request',
+                'django.contrib.auth.context_processors.auth',
+                'django.contrib.messages.context_processors.messages',
+            ],
+        },
+    },
+]
+
+WSGI_APPLICATION = 'app.wsgi.application'
+
+
+# Database
+# https://docs.djangoproject.com/en/3.1/ref/settings/#databases
+
+DATABASES = {
+    'default': {
+        'ENGINE': 'django.db.backends.sqlite3',
+        'NAME': BASE_DIR / 'db.sqlite3',
+    }
+}
+
+
+# Password validation
+# https://docs.djangoproject.com/en/3.1/ref/settings/#auth-password-validators
+
+AUTH_PASSWORD_VALIDATORS = [
+    {
+        'NAME': 
'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
+    },
+    {
+        'NAME': 
'django.contrib.auth.password_validation.MinimumLengthValidator',
+    },
+    {
+        'NAME': 
'django.contrib.auth.password_validation.CommonPasswordValidator',
+    },
+    {
+        'NAME': 
'django.contrib.auth.password_validation.NumericPasswordValidator',
+    },
+]
+
+
+# Internationalization
+# https://docs.djangoproject.com/en/3.1/topics/i18n/
+
+LANGUAGE_CODE = 'en-us'
+
+TIME_ZONE = 'UTC'
+
+USE_I18N = True
+
+USE_L10N = True
+
+USE_TZ = True
+
+
+# Static files (CSS, JavaScript, Images)
+# https://docs.djangoproject.com/en/3.1/howto/static-files/
+
+STATIC_URL = '/static/'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mocket-3.9.40/app/app/urls.py 
new/mocket-3.9.41/app/app/urls.py
--- old/mocket-3.9.40/app/app/urls.py   1970-01-01 01:00:00.000000000 +0100
+++ new/mocket-3.9.41/app/app/urls.py   2021-03-20 20:06:28.000000000 +0100
@@ -0,0 +1,21 @@
+"""app URL Configuration
+
+The `urlpatterns` list routes URLs to views. For more information please see:
+    https://docs.djangoproject.com/en/3.1/topics/http/urls/
+Examples:
+Function views
+    1. Add an import:  from my_app import views
+    2. Add a URL to urlpatterns:  path('', views.home, name='home')
+Class-based views
+    1. Add an import:  from other_app.views import Home
+    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
+Including another URLconf
+    1. Import the include() function: from django.urls import include, path
+    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
+"""
+from django.contrib import admin
+from django.urls import path
+
+urlpatterns = [
+    path('admin/', admin.site.urls),
+]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mocket-3.9.40/app/app/wsgi.py 
new/mocket-3.9.41/app/app/wsgi.py
--- old/mocket-3.9.40/app/app/wsgi.py   1970-01-01 01:00:00.000000000 +0100
+++ new/mocket-3.9.41/app/app/wsgi.py   2021-03-20 20:06:28.000000000 +0100
@@ -0,0 +1,16 @@
+"""
+WSGI config for app project.
+
+It exposes the WSGI callable as a module-level variable named ``application``.
+
+For more information on this file, see
+https://docs.djangoproject.com/en/3.1/howto/deployment/wsgi/
+"""
+
+import os
+
+from django.core.wsgi import get_wsgi_application
+
+os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'app.settings')
+
+application = get_wsgi_application()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mocket-3.9.40/app/manage.py 
new/mocket-3.9.41/app/manage.py
--- old/mocket-3.9.40/app/manage.py     1970-01-01 01:00:00.000000000 +0100
+++ new/mocket-3.9.41/app/manage.py     2021-03-20 20:06:28.000000000 +0100
@@ -0,0 +1,22 @@
+#!/usr/bin/env python
+"""Django's command-line utility for administrative tasks."""
+import os
+import sys
+
+
+def main():
+    """Run administrative tasks."""
+    os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'app.settings')
+    try:
+        from django.core.management import execute_from_command_line
+    except ImportError as exc:
+        raise ImportError(
+            "Couldn't import Django. Are you sure it's installed and "
+            "available on your PYTHONPATH environment variable? Did you "
+            "forget to activate a virtual environment?"
+        ) from exc
+    execute_from_command_line(sys.argv)
+
+
+if __name__ == '__main__':
+    main()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mocket-3.9.40/mocket/__init__.py 
new/mocket-3.9.41/mocket/__init__.py
--- old/mocket-3.9.40/mocket/__init__.py        2021-01-21 17:37:02.000000000 
+0100
+++ new/mocket-3.9.41/mocket/__init__.py        2021-05-21 11:06:01.000000000 
+0200
@@ -2,4 +2,4 @@
 
 __all__ = ("mocketize", "Mocket", "MocketEntry", "Mocketizer")
 
-__version__ = "3.9.40"
+__version__ = "3.9.41"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mocket-3.9.40/mocket/mocket.py 
new/mocket-3.9.41/mocket/mocket.py
--- old/mocket-3.9.40/mocket/mocket.py  2021-01-21 17:36:07.000000000 +0100
+++ new/mocket-3.9.41/mocket/mocket.py  2021-05-21 10:23:52.000000000 +0200
@@ -548,18 +548,18 @@
         ):
             responses = [responses]
 
-        self.responses = []
-        for r in responses:
-            if isinstance(r, BaseException):
-                pass
-            elif not getattr(r, "data", False):
-                if isinstance(r, text_type):
-                    r = encode_to_bytes(r)
-                r = self.response_cls(r)
-            self.responses.append(r)
+        if not responses:
+            self.responses = [self.response_cls(encode_to_bytes(""))]
         else:
-            if not responses:
-                self.responses = [self.response_cls(encode_to_bytes(""))]
+            self.responses = []
+            for r in responses:
+                if isinstance(r, BaseException):
+                    pass
+                elif not getattr(r, "data", False):
+                    if isinstance(r, text_type):
+                        r = encode_to_bytes(r)
+                    r = self.response_cls(r)
+                self.responses.append(r)
 
     def can_handle(self, data):
         return True
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mocket-3.9.40/mocket.egg-info/PKG-INFO 
new/mocket-3.9.41/mocket.egg-info/PKG-INFO
--- old/mocket-3.9.40/mocket.egg-info/PKG-INFO  2021-01-21 17:38:53.000000000 
+0100
+++ new/mocket-3.9.41/mocket.egg-info/PKG-INFO  2021-05-21 11:06:13.000000000 
+0200
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: mocket
-Version: 3.9.40
+Version: 3.9.41
 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
@@ -354,6 +354,6 @@
 Classifier: Topic :: Software Development :: Testing
 Classifier: License :: OSI Approved :: BSD License
 Description-Content-Type: text/x-rst
+Provides-Extra: speedups
 Provides-Extra: dev
 Provides-Extra: pook
-Provides-Extra: speedups
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mocket-3.9.40/mocket.egg-info/SOURCES.txt 
new/mocket-3.9.41/mocket.egg-info/SOURCES.txt
--- old/mocket-3.9.40/mocket.egg-info/SOURCES.txt       2021-01-21 
17:38:53.000000000 +0100
+++ new/mocket-3.9.41/mocket.egg-info/SOURCES.txt       2021-05-21 
11:06:13.000000000 +0200
@@ -3,6 +3,13 @@
 README.rst
 requirements.txt
 setup.py
+app/__init__.py
+app/manage.py
+app/app/__init__.py
+app/app/asgi.py
+app/app/settings.py
+app/app/urls.py
+app/app/wsgi.py
 mocket/__init__.py
 mocket/async_mocket.py
 mocket/compat.py
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mocket-3.9.40/mocket.egg-info/requires.txt 
new/mocket-3.9.41/mocket.egg-info/requires.txt
--- old/mocket-3.9.40/mocket.egg-info/requires.txt      2021-01-21 
17:38:53.000000000 +0100
+++ new/mocket-3.9.41/mocket.egg-info/requires.txt      2021-05-21 
11:06:13.000000000 +0200
@@ -1,7 +1,7 @@
-decorator>=4.0.0
-http-parser>=0.9.0
 python-magic>=0.4.5
+decorator<5,>=4.0.0
 urllib3>=1.25.3
+http-parser>=0.9.0
 
 [dev]
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mocket-3.9.40/mocket.egg-info/top_level.txt 
new/mocket-3.9.41/mocket.egg-info/top_level.txt
--- old/mocket-3.9.40/mocket.egg-info/top_level.txt     2021-01-21 
17:38:53.000000000 +0100
+++ new/mocket-3.9.41/mocket.egg-info/top_level.txt     2021-05-21 
11:06:13.000000000 +0200
@@ -1 +1,2 @@
+app
 mocket
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mocket-3.9.40/requirements.txt 
new/mocket-3.9.41/requirements.txt
--- old/mocket-3.9.40/requirements.txt  2021-01-21 17:38:52.000000000 +0100
+++ new/mocket-3.9.41/requirements.txt  2021-05-21 11:06:11.000000000 +0200
@@ -1,4 +1,4 @@
 python-magic>=0.4.5
-decorator>=4.0.0
+decorator>=4.0.0,<5
 urllib3>=1.25.3
 http-parser>=0.9.0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mocket-3.9.40/tests/main/test_mocket.py 
new/mocket-3.9.41/tests/main/test_mocket.py
--- old/mocket-3.9.40/tests/main/test_mocket.py 2021-01-15 17:23:19.000000000 
+0100
+++ new/mocket-3.9.41/tests/main/test_mocket.py 2021-05-21 11:06:01.000000000 
+0200
@@ -1,8 +1,10 @@
 from __future__ import unicode_literals
 
+import os
 import io
 import socket
 from unittest import TestCase
+from unittest.mock import patch
 
 import pytest
 
@@ -163,3 +165,12 @@
 @mocketize
 def test_mocketize_with_fixture(fixture):
     assert 2 == fixture
+
+
+@mocketize
+@patch("os.getcwd")
+def test_patch(
+    method_patch,
+):
+    method_patch.return_value = 'foo'
+    assert os.getcwd() == "foo"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/mocket-3.9.40/tests/tests37/test_asyncio.py 
new/mocket-3.9.41/tests/tests37/test_asyncio.py
--- old/mocket-3.9.40/tests/tests37/test_asyncio.py     2021-01-21 
17:36:07.000000000 +0100
+++ new/mocket-3.9.41/tests/tests37/test_asyncio.py     2021-03-20 
19:51:56.000000000 +0100
@@ -1,18 +1,23 @@
 import asyncio
+import glob
+import io
 import json
-from unittest import TestCase
+import shutil
 import socket
-import io
+import tempfile
+from unittest import TestCase
 
-from mocket.mocket import Mocket, mocketize
+from mocket.mocket import mocketize
 
 
 class AsyncIoRecordTestCase(TestCase):
+    temp_dir = tempfile.mkdtemp()
+
+    @mocketize(truesocket_recording_dir=temp_dir)
     def test_asyncio_record_replay(self):
         async def test_asyncio_connection():
-            mock_out = b'HTTP/1.1 301 Moved Permanently\r\n'
             reader, writer = await asyncio.open_connection(
-                host='google.com',
+                host="google.com",
                 port=80,
                 family=socket.AF_INET,
                 proto=socket.IPPROTO_TCP,
@@ -20,26 +25,24 @@
                 server_hostname=None,
             )
 
-            buf = 'GET / HTTP/1.1\r\nHost: google.com\r\n\r\n'
+            buf = "GET / HTTP/1.1\r\nHost: google.com\r\n\r\n"
             writer.write(buf.encode())
             await writer.drain()
 
-            r = await reader.readline()
+            await reader.readline()
             writer.close()
             await writer.wait_closed()
-    
-        mock_out = b'HTTP/1.1 301 Moved Permanently\r\n'
-
-        test_name = 'test_asyncio_record'
-        # This enables mocket to record the response
-        Mocket.enable(test_name, ".")
 
         loop = asyncio.get_event_loop()
         loop.set_debug(True)
         loop.run_until_complete(test_asyncio_connection())
 
-        dump_filename = f'./{test_name}.json'
-        with io.open(dump_filename) as f:
+        files = glob.glob(f"{self.temp_dir}/*.json")
+        self.assertEqual(len(files), 1)
+
+        with io.open(files[0]) as f:
             responses = json.load(f)
 
-        assert len(responses["google.com"]["80"].keys()) == 1
+        self.assertEqual(len(responses["google.com"]["80"].keys()), 1)
+
+        shutil.rmtree(self.temp_dir)

Reply via email to