openSUSE Commits
Threads by month
- ----- 2025 -----
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
February 2023
- 1 participants
- 2021 discussions
Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-pytest-expect for openSUSE:Factory checked in at 2023-02-28 12:48:12
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-pytest-expect (Old)
and /work/SRC/openSUSE:Factory/.python-pytest-expect.new.31432 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pytest-expect"
Tue Feb 28 12:48:12 2023 rev:3 rq:1067944 version:1.1.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-pytest-expect/python-pytest-expect.changes 2019-02-26 22:14:30.150230169 +0100
+++ /work/SRC/openSUSE:Factory/.python-pytest-expect.new.31432/python-pytest-expect.changes 2023-02-28 12:48:37.924476511 +0100
@@ -1,0 +2,5 @@
+Mon Feb 27 10:41:49 UTC 2023 - Matej Cepl <mcepl(a)suse.com>
+
+- Don't use fdupes -s, it hurts.
+
+-------------------------------------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-pytest-expect.spec ++++++
--- /var/tmp/diff_new_pack.DlwTAi/_old 2023-02-28 12:48:38.420479734 +0100
+++ /var/tmp/diff_new_pack.DlwTAi/_new 2023-02-28 12:48:38.424479759 +0100
@@ -1,7 +1,7 @@
#
# spec file for package python-pytest-expect
#
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -16,7 +16,6 @@
#
-%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-pytest-expect
Version: 1.1.0
Release: 0
@@ -54,12 +53,12 @@
%install
%python_install
-%python_expand %fdupes -s %{buildroot}%{$python_sitelib}
+%python_expand %fdupes %{buildroot}%{$python_sitelib}
%files %{python_files}
%license LICENSE
%doc README.rst
%{python_sitelib}/pytest_expect
-%{python_sitelib}/pytest_expect-%{version}-py%{python_version}.egg-info
+%{python_sitelib}/pytest_expect-%{version}*-info
%changelog
1
0
Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package strace for openSUSE:Factory checked in at 2023-02-28 12:48:10
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/strace (Old)
and /work/SRC/openSUSE:Factory/.strace.new.31432 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "strace"
Tue Feb 28 12:48:10 2023 rev:98 rq:1067933 version:6.2
Changes:
--------
--- /work/SRC/openSUSE:Factory/strace/strace.changes 2022-12-14 14:10:35.431367412 +0100
+++ /work/SRC/openSUSE:Factory/.strace.new.31432/strace.changes 2023-02-28 12:48:34.604454943 +0100
@@ -1,0 +2,12 @@
+Mon Feb 27 09:39:58 UTC 2023 - Andreas Schwab <schwab(a)suse.de>
+
+- Update to strace 6.2
+ * Implemented collision resolution for overlapping ioctl commands
+ from tty and snd subsystems.
+ * Implemented decoding of IFLA_BRPORT_MAB and IFLA_DEVLINK_PORT
+ netlink attributes.
+ * Updated lists of ALG_*, BPF_*, IFLA_*, KEY_*, KVM_*, LANDLOCK_*,
+ MEMBARRIER_*, NFT_*, NTF_*, and V4L2_* constants.
+ * Updated lists of ioctl commands from Linux 6.2.
+
+-------------------------------------------------------------------
Old:
----
strace-6.1.tar.xz
strace-6.1.tar.xz.asc
New:
----
strace-6.2.tar.xz
strace-6.2.tar.xz.asc
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ strace.spec ++++++
--- /var/tmp/diff_new_pack.mEMnVT/_old 2023-02-28 12:48:35.276459308 +0100
+++ /var/tmp/diff_new_pack.mEMnVT/_new 2023-02-28 12:48:35.280459335 +0100
@@ -1,7 +1,7 @@
#
# spec file for package strace
#
-# Copyright (c) 2021 SUSE LLC
+# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -17,7 +17,7 @@
Name: strace
-Version: 6.1
+Version: 6.2
Release: 0
Summary: A utility to trace the system calls of a program
License: BSD-3-Clause
++++++ strace-6.1.tar.xz -> strace-6.2.tar.xz ++++++
++++ 15575 lines of diff (skipped)
1
0
Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package pam_wrapper for openSUSE:Factory checked in at 2023-02-28 12:48:09
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/pam_wrapper (Old)
and /work/SRC/openSUSE:Factory/.pam_wrapper.new.31432 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "pam_wrapper"
Tue Feb 28 12:48:09 2023 rev:15 rq:1067924 version:1.1.4
Changes:
--------
--- /work/SRC/openSUSE:Factory/pam_wrapper/pam_wrapper.changes 2021-10-28 18:31:42.176424462 +0200
+++ /work/SRC/openSUSE:Factory/.pam_wrapper.new.31432/pam_wrapper.changes 2023-02-28 12:48:33.460447511 +0100
@@ -1,0 +2,6 @@
+Mon Feb 27 09:38:30 UTC 2023 - Andreas Schneider <asn(a)cryptomilk.org>
+
+- Fix building with cmocka >= 1.1.6
+ * Added pam_wrapper-fix-cmocka-1.1.6+-support.patch
+
+-------------------------------------------------------------------
New:
----
pam_wrapper-fix-cmocka-1.1.6+-support.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ pam_wrapper.spec ++++++
--- /var/tmp/diff_new_pack.95ZWBD/_old 2023-02-28 12:48:34.028451201 +0100
+++ /var/tmp/diff_new_pack.95ZWBD/_new 2023-02-28 12:48:34.036451253 +0100
@@ -1,7 +1,7 @@
#
# spec file for package pam_wrapper
#
-# Copyright (c) 2021 SUSE LLC
+# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -32,6 +32,7 @@
Source0: https://ftp.samba.org/pub/cwrap/%{name}-%{version}.tar.gz
Source1: https://ftp.samba.org/pub/cwrap/%{name}-%{version}.tar.gz.asc
Source2: %{name}-rpmlintrc
+Patch0: pam_wrapper-fix-cmocka-1.1.6+-support.patch
BuildRequires: cmake
BuildRequires: doxygen
BuildRequires: libcmocka-devel
++++++ pam_wrapper-fix-cmocka-1.1.6+-support.patch ++++++
From 9e7f8ac9ee1f968ac8af2d9c2e9dbd91a3090b73 Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn(a)samba.org>
Date: Fri, 17 Feb 2023 18:08:45 +0100
Subject: [PATCH 1/2] cmake: Drop FindCMocka.cmake Module
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
We should use config mode.
Signed-off-by: Andreas Schneider <asn(a)samba.org>
Reviewed-by: Pavel Filipensk�� <pfilipensky(a)samba.org>
---
cmake/Modules/FindCMocka.cmake | 49 ----------------------------------
1 file changed, 49 deletions(-)
delete mode 100644 cmake/Modules/FindCMocka.cmake
diff --git a/cmake/Modules/FindCMocka.cmake b/cmake/Modules/FindCMocka.cmake
deleted file mode 100644
index 2dd9fc5..0000000
--- a/cmake/Modules/FindCMocka.cmake
+++ /dev/null
@@ -1,49 +0,0 @@
-# - Try to find CMocka
-# Once done this will define
-#
-# CMOCKA_ROOT_DIR - Set this variable to the root installation of CMocka
-#
-# Read-Only variables:
-# CMOCKA_FOUND - system has CMocka
-# CMOCKA_INCLUDE_DIR - the CMocka include directory
-# CMOCKA_LIBRARIES - Link these to use CMocka
-# CMOCKA_DEFINITIONS - Compiler switches required for using CMocka
-#
-#=============================================================================
-# Copyright (c) 2011-2012 Andreas Schneider <asn(a)cryptomilk.org>
-#
-# Distributed under the OSI-approved BSD License (the "License");
-# see accompanying file Copyright.txt for details.
-#
-# This software is distributed WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the License for more information.
-#=============================================================================
-#
-
-find_path(CMOCKA_INCLUDE_DIR
- NAMES
- cmocka.h
- PATHS
- ${CMOCKA_ROOT_DIR}/include
-)
-
-find_library(CMOCKA_LIBRARY
- NAMES
- cmocka
- PATHS
- ${CMOCKA_ROOT_DIR}/include
-)
-
-if (CMOCKA_LIBRARY)
- set(CMOCKA_LIBRARIES
- ${CMOCKA_LIBRARIES}
- ${CMOCKA_LIBRARY}
- )
-endif (CMOCKA_LIBRARY)
-
-include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(CMocka DEFAULT_MSG CMOCKA_LIBRARIES CMOCKA_INCLUDE_DIR)
-
-# show the CMOCKA_INCLUDE_DIR and CMOCKA_LIBRARIES variables only in the advanced view
-mark_as_advanced(CMOCKA_INCLUDE_DIR CMOCKA_LIBRARIES)
--
2.39.2
From 8e94874bf5c0d569a16985eafa9922d8c527a9fb Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn(a)samba.org>
Date: Fri, 17 Feb 2023 17:51:27 +0100
Subject: [PATCH 2/2] cmake: Fix cmocka >= 1.1.6 find_package() in CONFIG mode
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Andreas Schneider <asn(a)samba.org>
Reviewed-by: Pavel Filipensk�� <pfilipensky(a)samba.org>
---
tests/CMakeLists.txt | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 9d56f21..26f2da2 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -1,5 +1,9 @@
project(tests C)
+if (TARGET cmocka::cmocka)
+ set(CMOCKA_LIBRARY cmocka::cmocka)
+endif()
+
set(PAM_MATRIX_PATH "${CMAKE_BINARY_DIR}/src/modules/pam_matrix.so")
configure_file(services/matrix.in ${CMAKE_CURRENT_BINARY_DIR}/services/matrix @ONLY)
--
2.39.2
1
0
Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package uid_wrapper for openSUSE:Factory checked in at 2023-02-28 12:48:08
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/uid_wrapper (Old)
and /work/SRC/openSUSE:Factory/.uid_wrapper.new.31432 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "uid_wrapper"
Tue Feb 28 12:48:08 2023 rev:15 rq:1067922 version:1.3.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/uid_wrapper/uid_wrapper.changes 2023-01-21 19:10:25.536909492 +0100
+++ /work/SRC/openSUSE:Factory/.uid_wrapper.new.31432/uid_wrapper.changes 2023-02-28 12:48:32.580441794 +0100
@@ -1,0 +2,6 @@
+Mon Feb 27 09:32:20 UTC 2023 - Andreas Schneider <asn(a)cryptomilk.org>
+
+- Fix building with cmocka >= 1.1.6
+ * Added uid_wrapper-fix-cmocka-1.1.6+-support.patch
+
+-------------------------------------------------------------------
New:
----
uid_wrapper-fix-cmocka-1.1.6+-support.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ uid_wrapper.spec ++++++
--- /var/tmp/diff_new_pack.9mw4CU/_old 2023-02-28 12:48:33.272446289 +0100
+++ /var/tmp/diff_new_pack.9mw4CU/_new 2023-02-28 12:48:33.276446316 +0100
@@ -33,6 +33,7 @@
Source1: %{name}-rpmlintrc
Source2: https://ftp.samba.org/pub/cwrap/%{name}-%{version}.tar.gz.asc
Source3: uid_wrapper.keyring
+Patch0: uid_wrapper-fix-cmocka-1.1.6+-support.patch
BuildRequires: cmake
BuildRequires: libcmocka-devel
BuildRequires: pkgconf
++++++ uid_wrapper-fix-cmocka-1.1.6+-support.patch ++++++
From 850f24c6366abda30bfd77734b90330b8809d306 Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn(a)samba.org>
Date: Fri, 17 Feb 2023 17:51:27 +0100
Subject: [PATCH] cmake: Fix cmocka >= 1.1.6 find_package() in CONFIG mode
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Andreas Schneider <asn(a)samba.org>
Reviewed-by: Pavel Filipensk�� <pfilipensky(a)samba.org>
---
tests/CMakeLists.txt | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 635e86e..68e050e 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -1,5 +1,9 @@
project(tests C)
+if (TARGET cmocka::cmocka)
+ set(CMOCKA_LIBRARY cmocka::cmocka)
+endif()
+
add_library(uwrap_fake_socket_wrapper SHARED uwrap_fake_socket_wrapper.c)
target_compile_options(uwrap_fake_socket_wrapper
PRIVATE
--
2.39.2
1
0
Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package nss_wrapper for openSUSE:Factory checked in at 2023-02-28 12:48:06
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/nss_wrapper (Old)
and /work/SRC/openSUSE:Factory/.nss_wrapper.new.31432 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "nss_wrapper"
Tue Feb 28 12:48:06 2023 rev:17 rq:1067921 version:1.1.15
Changes:
--------
--- /work/SRC/openSUSE:Factory/nss_wrapper/nss_wrapper.changes 2023-01-26 14:04:29.726247774 +0100
+++ /work/SRC/openSUSE:Factory/.nss_wrapper.new.31432/nss_wrapper.changes 2023-02-28 12:48:31.440434388 +0100
@@ -1,0 +2,6 @@
+Mon Feb 27 08:16:39 UTC 2023 - Andreas Schneider <asn(a)cryptomilk.org>
+
+- Fix building with cmocka >= 1.1.6
+ * Added nss_wrapper-fix-cmocka-1.1.6+-support.patch
+
+-------------------------------------------------------------------
New:
----
nss_wrapper-fix-cmocka-1.1.6+-support.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ nss_wrapper.spec ++++++
--- /var/tmp/diff_new_pack.WoCl3O/_old 2023-02-28 12:48:32.080438545 +0100
+++ /var/tmp/diff_new_pack.WoCl3O/_new 2023-02-28 12:48:32.084438572 +0100
@@ -33,6 +33,7 @@
Source1: https://ftp.samba.org/pub/cwrap/%{name}-%{version}.tar.gz.asc
Source2: https://cryptomilk.org/gpgkey-8DFF53E18F2ABC8D8F3C92237EE0FC4DCC014E3D.gpg#…
Source3: %{name}-rpmlintrc
+Patch0: nss_wrapper-fix-cmocka-1.1.6+-support.patch
BuildRequires: cmake
BuildRequires: libcmocka-devel
BuildRequires: netcfg
++++++ nss_wrapper-fix-cmocka-1.1.6+-support.patch ++++++
From 2c879a0ffa70cee33329291d7576ec971d420da2 Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn(a)samba.org>
Date: Fri, 17 Feb 2023 17:51:27 +0100
Subject: [PATCH] cmake: Fix cmocka >= 1.1.6 find_package() in CONFIG mode
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Andreas Schneider <asn(a)samba.org>
Reviewed-by: Pavel Filipensk�� <pfilipensky(a)samba.org>
---
tests/CMakeLists.txt | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 3b94076..733cc4e 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -1,5 +1,9 @@
project(tests C)
+if (TARGET cmocka::cmocka)
+ set(CMOCKA_LIBRARY cmocka::cmocka)
+endif()
+
set(TESTSUITE_LIBRARIES nss_utils ${NWRAP_REQUIRED_LIBRARIES} ${CMOCKA_LIBRARY})
string(TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_LOWER)
--
2.39.2
1
0
Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-hatch_vcs for openSUSE:Factory checked in at 2023-02-28 12:48:06
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-hatch_vcs (Old)
and /work/SRC/openSUSE:Factory/.python-hatch_vcs.new.31432 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-hatch_vcs"
Tue Feb 28 12:48:06 2023 rev:6 rq:1067918 version:0.3.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-hatch_vcs/python-hatch_vcs.changes 2023-02-22 15:21:06.141696520 +0100
+++ /work/SRC/openSUSE:Factory/.python-hatch_vcs.new.31432/python-hatch_vcs.changes 2023-02-28 12:48:30.372427449 +0100
@@ -1,0 +2,5 @@
+Mon Feb 27 09:05:31 UTC 2023 - Matej Cepl <mcepl(a)suse.com>
+
+- The test build branch MUST BR the package itself.
+
+-------------------------------------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-hatch_vcs.spec ++++++
--- /var/tmp/diff_new_pack.YfjNII/_old 2023-02-28 12:48:30.972431348 +0100
+++ /var/tmp/diff_new_pack.YfjNII/_new 2023-02-28 12:48:30.980431400 +0100
@@ -33,10 +33,10 @@
Source: https://files.pythonhosted.org/packages/source/h/hatch_vcs/hatch_vcs-%{vers…
BuildRequires: fdupes
BuildRequires: python-rpm-macros >= 20210929
-Requires: python-hatchling >= 0.21.0
# https://github.com/ofek/hatch-vcs/issues/8
Requires: (python-setuptools_scm >= 6.4.0)
-Provides: python-hatch-vcs = %{version}-%{info}
+Requires: python-hatchling >= 0.21.0
+Provides: python-hatch-vcs = %{version}-%{release}
BuildArch: noarch
# SECTION build
BuildRequires: %{python_module hatchling >= 0.21.0}
@@ -44,8 +44,9 @@
# /SECTION
%if %{with test}
# SECTION test
-BuildRequires: %{python_module setuptools_scm >= 6.4.0}
+BuildRequires: %{python_module hatch_vcs = %{version}}
BuildRequires: %{python_module pytest}
+BuildRequires: %{python_module setuptools_scm >= 6.4.0}
BuildRequires: git
# /SECTION
%endif
@@ -61,13 +62,14 @@
%pyproject_wheel
%install
+%if %{without test}
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
+%endif
%check
%if %{with test}
%pytest tests
-rm -rf %{buildroot}
%endif
%if %{without test}
1
0
Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package vlc for openSUSE:Factory checked in at 2023-02-28 12:48:04
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/vlc (Old)
and /work/SRC/openSUSE:Factory/.vlc.new.31432 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "vlc"
Tue Feb 28 12:48:04 2023 rev:134 rq:1067912 version:3.0.18
Changes:
--------
--- /work/SRC/openSUSE:Factory/vlc/vlc.changes 2022-12-22 16:21:44.585570075 +0100
+++ /work/SRC/openSUSE:Factory/.vlc.new.31432/vlc.changes 2023-02-28 12:48:28.772417055 +0100
@@ -1,0 +2,5 @@
+Fri Feb 24 21:42:37 UTC 2023 - Eugene Popov <popov895(a)ukr.net>
+
+- Add 104-playback-bar.patch: Backport fix for the playback bar (commit 60771fe7)
+
+-------------------------------------------------------------------
New:
----
104-playback-bar.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ vlc.spec ++++++
--- /var/tmp/diff_new_pack.4etgXt/_old 2023-02-28 12:48:30.160426073 +0100
+++ /var/tmp/diff_new_pack.4etgXt/_new 2023-02-28 12:48:30.168426124 +0100
@@ -57,6 +57,7 @@
Patch100: vlc-projectM-qt5.patch
# PATCH-FIX-UPSTREAM -- Use OpenCV C++ API
Patch103: 0001-Port-OpenCV-facedetect-example-to-C-API.patch
+Patch104: 104-playback-bar.patch
BuildRequires: Mesa-devel
BuildRequires: aalib-devel
BuildRequires: alsa-devel >= 1.0.24
@@ -407,6 +408,7 @@
%patch100 -p1
%endif
%patch103 -p1
+%patch104 -p1
# a52_init() < 0.8.0 doesn't take any arguments
if pkg-config --max-version 0.8 liba52; then
++++++ 104-playback-bar.patch ++++++
diff --git a/modules/gui/qt/components/controller.cpp b/modules/gui/qt/components/controller.cpp
index 0bbb07942ae6b3f0c8491ce1fd807e3ebf5d3db5..382be37dccd0fc9dcf9b395b906676657b58e28e 100644
--- a/modules/gui/qt/components/controller.cpp
+++ b/modules/gui/qt/components/controller.cpp
@@ -858,10 +858,17 @@ FullscreenControllerWidget::FullscreenControllerWidget( intf_thread_t *_p_i, QWi
isWideFSC = getSettings()->value( "FullScreen/wide" ).toBool();
CONNECT( this, fullscreenChanged( bool ), THEMIM, changeFullscreen( bool ) );
+
+ Q_ASSERT( _parent );
+ _parent->installEventFilter( this );
}
FullscreenControllerWidget::~FullscreenControllerWidget()
{
+ QWidget *wParent = parentWidget();
+ Q_ASSERT( wParent );
+ wParent->removeEventFilter( this );
+
getSettings()->setValue( "FullScreen/pos", previousPosition );
getSettings()->setValue( "FullScreen/screen", screenRes );
getSettings()->setValue( "FullScreen/wide", isWideFSC );
@@ -1074,6 +1081,21 @@ void FullscreenControllerWidget::customEvent( QEvent *event )
}
}
+bool FullscreenControllerWidget::eventFilter( QObject *watched, QEvent *event )
+{
+ const QWidget *wParent = parentWidget();
+ Q_ASSERT( wParent );
+
+ if ( watched == wParent && event->type() == QEvent::ActivationChange )
+ {
+ /* Hide if not active */
+ if ( !wParent->isActiveWindow() )
+ hideFSC();
+ }
+
+ return AbstractController::eventFilter( watched, event );
+}
+
/**
* On mouse move
* moving with FSC
@@ -1281,6 +1303,12 @@ void FullscreenControllerWidget::fullscreenChanged( vout_thread_t *p_vout,
*/
void FullscreenControllerWidget::mouseChanged( vout_thread_t *, int i_mousex, int i_mousey )
{
+ const QWidget *wParent = parentWidget();
+ Q_ASSERT( wParent );
+
+ /* Ignore mouse events if not active */
+ if ( !wParent->isActiveWindow() ) return;
+
bool b_toShow;
/* FIXME - multiple vout (ie multiple mouse position ?) and thread safety if multiple vout ? */
diff --git a/modules/gui/qt/components/controller.hpp b/modules/gui/qt/components/controller.hpp
index dc8bacce688ba82f47448f6e2892d0c701b726f1..ab7b29f194a52ae7369eba02801f7be020c17ec4 100644
--- a/modules/gui/qt/components/controller.hpp
+++ b/modules/gui/qt/components/controller.hpp
@@ -283,6 +283,8 @@ protected:
void customEvent( QEvent *event ) Q_DECL_OVERRIDE;
+ bool eventFilter( QObject *watched, QEvent *event ) Q_DECL_OVERRIDE;
+
private slots:
void showFSC();
void planHideFSC();
1
0
Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package php8 for openSUSE:Factory checked in at 2023-02-28 12:48:02
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/php8 (Old)
and /work/SRC/openSUSE:Factory/.php8.new.31432 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "php8"
Tue Feb 28 12:48:02 2023 rev:40 rq:1067902 version:8.1.16
Changes:
--------
--- /work/SRC/openSUSE:Factory/php8/php8.changes 2023-02-17 16:43:57.826510800 +0100
+++ /work/SRC/openSUSE:Factory/.php8.new.31432/php8.changes 2023-02-28 12:48:25.636396682 +0100
@@ -1,0 +2,5 @@
+Sat Feb 25 20:36:50 UTC 2023 - Arjen de Korte <suse+build(a)de-korte.org>
+
+- change to %bcond conditional build dependencies
+
+-------------------------------------------------------------------
@@ -6,0 +12 @@
+ ([bsc#1208366], [bsc#1208367], [bsc#1208388])
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ php8.spec ++++++
--- /var/tmp/diff_new_pack.0P0f0g/_old 2023-02-28 12:48:28.368414430 +0100
+++ /var/tmp/diff_new_pack.0P0f0g/_new 2023-02-28 12:48:28.404414665 +0100
@@ -40,18 +40,22 @@
%define psuffix %{nil}
%endif
-%define debug_build 0
-%define asan_build 0
%global apiver 20210902
%global zendver 20210902
%define extension_dir %{_libdir}/%{php_name}/extensions
%define php_sysconf %{_sysconfdir}/%{php_name}
-%define build_firebird 0
-%define build_sodium 1
-%define build_argon2 0
+
+%bcond_without apparmor
%if 0%{?suse_version} >= 1500
-%define build_argon2 1
+%bcond_without argon2
+%else
+%bcond_with argon2
%endif
+%bcond_with asan
+%bcond_with debug
+%bcond_with firebird
+%bcond_without sodium
+
Name: %{pprefix}%{php_name}%{psuffix}
Version: 8.1.16
Release: 0
@@ -106,7 +110,6 @@
BuildRequires: gmp-devel
BuildRequires: gpg2
BuildRequires: libacl-devel
-BuildRequires: libapparmor-devel
BuildRequires: libbz2-devel
BuildRequires: libtidy-devel
BuildRequires: libtiff-devel
@@ -146,15 +149,18 @@
BuildRequires: pkgconfig(openssl) >= 1.0.2
BuildRequires: pkgconfig(sqlite3) >= 3.7.7
BuildRequires: pkgconfig(zlib) >= 1.2.0.4
-%if %{build_firebird}
+%if %{with apparmor}
+BuildRequires: pkgconfig(libapparmor)
+%endif
+%if %{with firebird}
# firebird-devel was merged into libfbclient2-devel for firebird 3
BuildRequires: firebird-devel
BuildRequires: libfbclient2-devel
%endif
-%if %{build_sodium}
+%if %{with sodium}
BuildRequires: pkgconfig(libsodium) >= 1.0.8
%endif
-%if %{build_argon2}
+%if %{with argon2}
BuildRequires: pkgconfig(libargon2)
%endif
%if "%{flavor}" == "test"
@@ -606,7 +612,7 @@
%description mysql
PHP functions for access to MySQL database servers.
-%if %{build_firebird}
+%if %{with firebird}
%package firebird
Summary: Firebird database client for PHP
Group: Development/Libraries/PHP
@@ -795,7 +801,7 @@
communication functions based on the BSD sockets API, providing the
possibility to act as a socket server as well as a client.
-%if %{build_sodium}
+%if %{with sodium}
%package sodium
Summary: Cryptographic Extension Based on Libsodium
Group: Development/Libraries/PHP
@@ -986,11 +992,11 @@
# export flags
CFLAGS="%{optflags} -O3 -fPIE -fPIC -DPIC -D_GNU_SOURCE -fno-strict-aliasing"
CXXFLAGS="%{optflags} -O3 -fPIE -fPIC -DPIC -D_GNU_SOURCE -fno-strict-aliasing"
-%if %{build_firebird}
+%if %{with firebird}
CFLAGS="$CFLAGS -I/usr/include/firebird"
CXXFLAGS="$CXXFLAGS -I/usr/include/firebird"
%endif
-%if %{debug_build}
+%if %{with debug}
CFLAGS="$CFLAGS -Og"
CXXFLAGS="$CXXFLAGS -Og"
%endif
@@ -1036,7 +1042,7 @@
--with-system-tzdata=%{_datadir}/zoneinfo \
--with-mhash \
--disable-phpdbg \
-%if %{build_argon2}
+%if %{with argon2}
--with-password-argon2=%{_usr} \
%endif
"$@" || { cat config.log; exit 1; }
@@ -1056,7 +1062,7 @@
if [ $sapi == apache2 ]; then
sed -i 's/libphp/mod_%{php_name}/g' Makefile
fi
-%if %{asan_build}
+%if %{with asan}
sed -i -e 's/\(^CFLAGS.*\)/\1 -fsanitize=address/' \
-e 's/\(^EXTRA_LIBS =.*\)/\1 -lasan/' \
Makefile
@@ -1084,7 +1090,9 @@
Build fpm \
--enable-fpm \
--with-fpm-acl \
+%if %{with apparmor}
--with-fpm-apparmor \
+%endif
--with-fpm-systemd \
--with-fpm-user=%{apache_user} \
--with-fpm-group=%{apache_group} \
@@ -1160,12 +1168,12 @@
--with-pdo-sqlite=shared \
--with-sqlite3=shared \
--with-pdo-mysql=shared,mysqlnd \
-%if %{build_firebird}
+%if %{with firebird}
--with-pdo-firebird=shared \
%endif
--with-pdo-pgsql=shared,%{_usr} \
--with-pdo-odbc=shared,unixODBC,%{_usr} \
-%if %{build_sodium}
+%if %{with sodium}
--with-sodium=shared \
%endif
--enable-opcache=shared \
@@ -1175,7 +1183,7 @@
%endif
%check
-%if %{asan_build}
+%if %{with asan}
# no need for ASAN build
exit 0
%endif
@@ -1558,7 +1566,7 @@
%{extension_dir}/pdo_mysql.so
%config(noreplace) %{php_sysconf}/conf.d/pdo_mysql.ini
-%if %{build_firebird}
+%if %{with firebird}
%files firebird
%defattr(-, root, root)
%{extension_dir}/pdo_firebird.so
@@ -1633,7 +1641,7 @@
%{extension_dir}/soap.so
%config(noreplace) %{php_sysconf}/conf.d/soap.ini
-%if %{build_sodium}
+%if %{with sodium}
%files sodium
%defattr(-, root, root)
%{extension_dir}/sodium.so
1
0
Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package libheif for openSUSE:Factory checked in at 2023-02-28 12:48:01
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libheif (Old)
and /work/SRC/openSUSE:Factory/.libheif.new.31432 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libheif"
Tue Feb 28 12:48:01 2023 rev:18 rq:1067893 version:1.15.1
Changes:
--------
--- /work/SRC/openSUSE:Factory/libheif/libheif.changes 2023-02-05 19:20:05.675519440 +0100
+++ /work/SRC/openSUSE:Factory/.libheif.new.31432/libheif.changes 2023-02-28 12:48:24.372388471 +0100
@@ -1,0 +2,19 @@
+Thu Feb 16 18:49:09 UTC 2023 - Arjen de Korte <suse+build(a)de-korte.org>
+
+- update to 1.15.1
+ * fix compilation without plugins
+
+- update to 1.15.0
+ * codec plugin system now also works with Windows
+ * heif_convert: manually choose which decoder should be used
+ * support for CLLI (content light level box), MDCV (mastering
+ display colour volume), PASP (pixel aspect) information
+ * ICC profile support in gdk-pixbuf loader
+ * various fixes
+
+- build with plugins enabled on Tumbleweed
+- remove upstreamed patches
+ - 2ca02a128b2f76f7f293aa86a2ce1e04a8306c65.patch
+ - b6812284a2d70f29a5121ec3dbe652da07fdbbb7.patch
+
+-------------------------------------------------------------------
Old:
----
2ca02a128b2f76f7f293aa86a2ce1e04a8306c65.patch
b6812284a2d70f29a5121ec3dbe652da07fdbbb7.patch
libheif-1.14.2.tar.gz
New:
----
libheif-1.15.1.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ libheif.spec ++++++
--- /var/tmp/diff_new_pack.KaLJ4v/_old 2023-02-28 12:48:25.040392810 +0100
+++ /var/tmp/diff_new_pack.KaLJ4v/_new 2023-02-28 12:48:25.048392862 +0100
@@ -22,6 +22,7 @@
%bcond_with rav1e
%bcond_with svtenc
%if 0%{?suse_version} > 1500
+%bcond_without plugins
%bcond_without rav1e
%ifarch x86_64
%bcond_without svtenc
@@ -29,7 +30,7 @@
%endif
Name: libheif
-Version: 1.14.2
+Version: 1.15.1
Release: 0
Summary: HEIF/AVIF file format decoder and encoder
License: GPL-2.0-or-later
@@ -37,10 +38,6 @@
URL: https://github.com/strukturag/libheif
Source0: %{url}/releases/download/v%{version}/%{name}-%{version}.tar.gz
Source99: baselibs.conf
-# from https://github.com/strukturag/libheif/commit/b6812284a2d70f29a5121ec3dbe652…
-Patch0: b6812284a2d70f29a5121ec3dbe652da07fdbbb7.patch
-# rebased from https://github.com/strukturag/libheif/commit/2ca02a128b2f76f7f293aa86a2ce1e…
-Patch1: 2ca02a128b2f76f7f293aa86a2ce1e04a8306c65.patch
BuildRequires: chrpath
BuildRequires: cmake
BuildRequires: fdupes
++++++ libheif-1.14.2.tar.gz -> libheif-1.15.1.tar.gz ++++++
++++ 4968 lines of diff (skipped)
1
0
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 2023-02-28 12:48:00
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-mocket (Old)
and /work/SRC/openSUSE:Factory/.python-mocket.new.31432 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-mocket"
Tue Feb 28 12:48:00 2023 rev:26 rq:1067850 version:3.11.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-mocket/python-mocket.changes 2023-02-18 17:10:17.554700699 +0100
+++ /work/SRC/openSUSE:Factory/.python-mocket.new.31432/python-mocket.changes 2023-02-28 12:48:23.364381922 +0100
@@ -1,0 +2,16 @@
+Sun Feb 19 21:05:20 UTC 2023 - Sebastian Wagner <sebix(a)sebix.at>
+
+- Update to version 3.11:
+ - Migrating the HTTP[S] mock from relying on http-parser to httptools.
+ - Never discovered the root cause for the failing tests with aiohttp/Python 3.11 (first time ever I added @pytest.mark.xfail to a few tests). Same test works with httpx, so I suspect it's related to a client issue. I'll probably migrate to httpx as the reference client for testing async/await code.
+- remove patches merged upstream:
+ 0007-Switching-to-httptools.parser.HttpRequestParser.patch
+ 0008-Disabling-tests-for-pook-when-testing-Python-3.11.patch
+ 0009-Removing-DeprecationWarning-all-over-the-place.patch
+ 0010-Python-3.11-needs-an-async-decorator.patch
+ 0012-Removing-async-timeout-dependency.patch
+ 0013-Refactoring-using-event_loop-fixture.patch
+ 0014-Refactoring-using-tempfile-as-a-context-manager.patch
+ 0015-Skip-those-tests-and-see-what-happens-to-the-rest.patch
+
+-------------------------------------------------------------------
Old:
----
0007-Switching-to-httptools.parser.HttpRequestParser.patch
0008-Disabling-tests-for-pook-when-testing-Python-3.11.patch
0009-Removing-DeprecationWarning-all-over-the-place.patch
0010-Python-3.11-needs-an-async-decorator.patch
0012-Removing-async-timeout-dependency.patch
0013-Refactoring-using-event_loop-fixture.patch
0014-Refactoring-using-tempfile-as-a-context-manager.patch
0015-Skip-those-tests-and-see-what-happens-to-the-rest.patch
mocket-3.10.9.tar.gz
New:
----
mocket-3.11.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-mocket.spec ++++++
--- /var/tmp/diff_new_pack.mJZCVC/_old 2023-02-28 12:48:24.020386183 +0100
+++ /var/tmp/diff_new_pack.mJZCVC/_new 2023-02-28 12:48:24.028386235 +0100
@@ -27,21 +27,12 @@
%define skip_python2 1
Name: python-mocket%{psuffix}
-Version: 3.10.9
+Version: 3.11.0
Release: 0
Summary: Python socket mock framework
License: BSD-3-Clause
URL: https://github.com/mindflayer/python-mocket
Source0: https://files.pythonhosted.org/packages/source/m/mocket/mocket-%{version}.t…
-# PATCH-FIX-UPSTREAM: taken from https://github.com/mindflayer/python-mocket/pull/181
-Patch1: 0007-Switching-to-httptools.parser.HttpRequestParser.patch
-Patch2: 0008-Disabling-tests-for-pook-when-testing-Python-3.11.patch
-Patch3: 0009-Removing-DeprecationWarning-all-over-the-place.patch
-Patch4: 0010-Python-3.11-needs-an-async-decorator.patch
-Patch5: 0012-Removing-async-timeout-dependency.patch
-Patch6: 0013-Refactoring-using-event_loop-fixture.patch
-Patch7: 0014-Refactoring-using-tempfile-as-a-context-manager.patch
-Patch8: 0015-Skip-those-tests-and-see-what-happens-to-the-rest.patch
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
@@ -109,7 +100,7 @@
donttest="$donttest or test_truesendall_with_dump_from_recording"
%endif
# these fail after the python 3.11 patches
-donttest="$donttest or test_http_session or test_https_session or test_httprettish_session"
+#donttest="$donttest or test_http_session or test_https_session or test_httprettish_session"
%pytest -rfEs -k "not ($donttest)" ${pytest_$python_ignore}
%endif
++++++ mocket-3.10.9.tar.gz -> mocket-3.11.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mocket-3.10.9/PKG-INFO new/mocket-3.11.0/PKG-INFO
--- old/mocket-3.10.9/PKG-INFO 2022-12-03 23:22:43.329145000 +0100
+++ new/mocket-3.11.0/PKG-INFO 2023-02-19 16:56:36.339939000 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: mocket
-Version: 3.10.9
+Version: 3.11.0
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
@@ -15,6 +15,7 @@
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
+Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Software Development
@@ -259,7 +260,6 @@
import aiohttp
import asyncio
- import async_timeout
from unittest import TestCase
from mocket.plugins.httpretty import httpretty, httprettified
@@ -276,13 +276,14 @@
)
async def main(l):
- async with aiohttp.ClientSession(loop=l) as session:
- with async_timeout.timeout(3):
- async with session.get(url) as get_response:
- assert get_response.status == 200
- assert await get_response.text() == '{"origin": "127.0.0.1"}'
+ async with aiohttp.ClientSession(
+ loop=l, timeout=aiohttp.ClientTimeout(total=3)
+ ) as session:
+ async with session.get(url) as get_response:
+ assert get_response.status == 200
+ assert await get_response.text() == '{"origin": "127.0.0.1"}'
- loop = asyncio.get_event_loop()
+ loop = asyncio.new_event_loop()
loop.set_debug(True)
loop.run_until_complete(main(loop))
@@ -305,18 +306,18 @@
Entry.single_register(Entry.POST, url, body=body*2, status=201)
async def main(l):
- async with aiohttp.ClientSession(loop=l) as session:
- with async_timeout.timeout(3):
- async with session.get(url) as get_response:
- assert get_response.status == 404
- assert await get_response.text() == body
-
- with async_timeout.timeout(3):
- async with session.post(url, data=body * 6) as post_response:
- assert post_response.status == 201
- assert await post_response.text() == body * 2
+ async with aiohttp.ClientSession(
+ loop=l, timeout=aiohttp.ClientTimeout(total=3)
+ ) as session:
+ async with session.get(url) as get_response:
+ assert get_response.status == 404
+ assert await get_response.text() == body
+
+ async with session.post(url, data=body * 6) as post_response:
+ assert post_response.status == 201
+ assert await post_response.text() == body * 2
- loop = asyncio.get_event_loop()
+ loop = asyncio.new_event_loop()
loop.run_until_complete(main(loop))
# or again with a unittest.IsolatedAsyncioTestCase
@@ -330,18 +331,18 @@
Entry.single_register(Entry.GET, url, body=body, status=404)
Entry.single_register(Entry.POST, url, body=body * 2, status=201)
- async with aiohttp.ClientSession() as session:
- with async_timeout.timeout(3):
- async with session.get(url) as get_response:
- assert get_response.status == 404
- assert await get_response.text() == body
-
- with async_timeout.timeout(3):
- async with session.post(url, data=body * 6) as post_response:
- assert post_response.status == 201
- assert await post_response.text() == body * 2
- assert Mocket.last_request().method == 'POST'
- assert Mocket.last_request().body == body * 6
+ async with aiohttp.ClientSession(
+ timeout=aiohttp.ClientTimeout(total=3)
+ ) as session:
+ async with session.get(url) as get_response:
+ assert get_response.status == 404
+ assert await get_response.text() == body
+
+ async with session.post(url, data=body * 6) as post_response:
+ assert post_response.status == 201
+ assert await post_response.text() == body * 2
+ assert Mocket.last_request().method == 'POST'
+ assert Mocket.last_request().body == body * 6
Works well with others
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mocket-3.10.9/README.rst new/mocket-3.11.0/README.rst
--- old/mocket-3.10.9/README.rst 2022-12-03 23:22:22.000000000 +0100
+++ new/mocket-3.11.0/README.rst 2023-02-19 16:55:48.000000000 +0100
@@ -231,7 +231,6 @@
import aiohttp
import asyncio
- import async_timeout
from unittest import TestCase
from mocket.plugins.httpretty import httpretty, httprettified
@@ -248,13 +247,14 @@
)
async def main(l):
- async with aiohttp.ClientSession(loop=l) as session:
- with async_timeout.timeout(3):
- async with session.get(url) as get_response:
- assert get_response.status == 200
- assert await get_response.text() == '{"origin": "127.0.0.1"}'
+ async with aiohttp.ClientSession(
+ loop=l, timeout=aiohttp.ClientTimeout(total=3)
+ ) as session:
+ async with session.get(url) as get_response:
+ assert get_response.status == 200
+ assert await get_response.text() == '{"origin": "127.0.0.1"}'
- loop = asyncio.get_event_loop()
+ loop = asyncio.new_event_loop()
loop.set_debug(True)
loop.run_until_complete(main(loop))
@@ -277,18 +277,18 @@
Entry.single_register(Entry.POST, url, body=body*2, status=201)
async def main(l):
- async with aiohttp.ClientSession(loop=l) as session:
- with async_timeout.timeout(3):
- async with session.get(url) as get_response:
- assert get_response.status == 404
- assert await get_response.text() == body
-
- with async_timeout.timeout(3):
- async with session.post(url, data=body * 6) as post_response:
- assert post_response.status == 201
- assert await post_response.text() == body * 2
+ async with aiohttp.ClientSession(
+ loop=l, timeout=aiohttp.ClientTimeout(total=3)
+ ) as session:
+ async with session.get(url) as get_response:
+ assert get_response.status == 404
+ assert await get_response.text() == body
+
+ async with session.post(url, data=body * 6) as post_response:
+ assert post_response.status == 201
+ assert await post_response.text() == body * 2
- loop = asyncio.get_event_loop()
+ loop = asyncio.new_event_loop()
loop.run_until_complete(main(loop))
# or again with a unittest.IsolatedAsyncioTestCase
@@ -302,18 +302,18 @@
Entry.single_register(Entry.GET, url, body=body, status=404)
Entry.single_register(Entry.POST, url, body=body * 2, status=201)
- async with aiohttp.ClientSession() as session:
- with async_timeout.timeout(3):
- async with session.get(url) as get_response:
- assert get_response.status == 404
- assert await get_response.text() == body
-
- with async_timeout.timeout(3):
- async with session.post(url, data=body * 6) as post_response:
- assert post_response.status == 201
- assert await post_response.text() == body * 2
- assert Mocket.last_request().method == 'POST'
- assert Mocket.last_request().body == body * 6
+ async with aiohttp.ClientSession(
+ timeout=aiohttp.ClientTimeout(total=3)
+ ) as session:
+ async with session.get(url) as get_response:
+ assert get_response.status == 404
+ assert await get_response.text() == body
+
+ async with session.post(url, data=body * 6) as post_response:
+ assert post_response.status == 201
+ assert await post_response.text() == body * 2
+ assert Mocket.last_request().method == 'POST'
+ assert Mocket.last_request().body == body * 6
Works well with others
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mocket-3.10.9/mocket/__init__.py new/mocket-3.11.0/mocket/__init__.py
--- old/mocket-3.10.9/mocket/__init__.py 2022-12-03 23:22:22.000000000 +0100
+++ new/mocket-3.11.0/mocket/__init__.py 2023-02-19 16:55:48.000000000 +0100
@@ -3,4 +3,4 @@
__all__ = ("async_mocketize", "mocketize", "Mocket", "MocketEntry", "Mocketizer")
-__version__ = "3.10.9"
+__version__ = "3.11.0"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mocket-3.10.9/mocket/mockhttp.py new/mocket-3.11.0/mocket/mockhttp.py
--- old/mocket-3.10.9/mocket/mockhttp.py 2021-12-01 19:57:28.000000000 +0100
+++ new/mocket-3.11.0/mocket/mockhttp.py 2023-02-19 16:55:48.000000000 +0100
@@ -3,13 +3,10 @@
from http.server import BaseHTTPRequestHandler
from urllib.parse import parse_qs, unquote, urlsplit
-from .compat import decode_from_bytes, do_the_magic, encode_to_bytes
-from .mocket import Mocket, MocketEntry
+from httptools.parser import HttpRequestParser
-try:
- from http_parser.parser import HttpParser
-except ImportError:
- from http_parser.pyparser import HttpParser
+from .compat import ENCODING, decode_from_bytes, do_the_magic, encode_to_bytes
+from .mocket import Mocket, MocketEntry
try:
import magic
@@ -21,31 +18,59 @@
CRLF = "\r\n"
+class Protocol:
+ def __init__(self):
+ self.url = None
+ self.body = None
+ self.headers = {}
+
+ def on_header(self, name: bytes, value: bytes):
+ self.headers[name.decode("ascii")] = value.decode("ascii")
+
+ def on_body(self, body: bytes):
+ try:
+ self.body = body.decode(ENCODING)
+ except UnicodeDecodeError:
+ self.body = body
+
+ def on_url(self, url: bytes):
+ self.url = url.decode("ascii")
+
+
class Request:
- parser = None
- _body = None
+ _protocol = None
+ _parser = None
def __init__(self, data):
- self.parser = HttpParser()
- self.parser.execute(data, len(data))
-
- self.method = self.parser.get_method()
- self.path = self.parser.get_path()
- self.headers = self.parser.get_headers()
- self.querystring = parse_qs(
- unquote(self.parser.get_query_string()), keep_blank_values=True
- )
- if self.querystring:
- self.path += "?{}".format(self.parser.get_query_string())
+ self._protocol = Protocol()
+ self._parser = HttpRequestParser(self._protocol)
+ self.add_data(data)
def add_data(self, data):
- self.parser.execute(data, len(data))
+ self._parser.feed_data(data)
+
+ @property
+ def method(self):
+ return self._parser.get_method().decode("ascii")
+
+ @property
+ def path(self):
+ return self._protocol.url
+
+ @property
+ def headers(self):
+ return self._protocol.headers
+
+ @property
+ def querystring(self):
+ parts = self._protocol.url.split("?", 1)
+ if len(parts) == 2:
+ return parse_qs(unquote(parts[1]), keep_blank_values=True)
+ return {}
@property
def body(self):
- if self._body is None:
- self._body = decode_from_bytes(self.parser.recv_body())
- return self._body
+ return self._protocol.body
def __str__(self):
return "{} - {} - {}".format(self.method, self.path, self.headers)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mocket-3.10.9/mocket/plugins/httpretty/__init__.py new/mocket-3.11.0/mocket/plugins/httpretty/__init__.py
--- old/mocket-3.10.9/mocket/plugins/httpretty/__init__.py 2022-01-08 17:50:17.000000000 +0100
+++ new/mocket-3.11.0/mocket/plugins/httpretty/__init__.py 2023-02-19 16:55:48.000000000 +0100
@@ -1,6 +1,6 @@
from mocket import Mocket, mocketize
from mocket.async_mocket import async_mocketize
-from mocket.compat import byte_type, text_type
+from mocket.compat import ENCODING, byte_type, text_type
from mocket.mockhttp import Entry as MocketHttpEntry
from mocket.mockhttp import Request as MocketHttpRequest
from mocket.mockhttp import Response as MocketHttpResponse
@@ -13,9 +13,11 @@
class Request(MocketHttpRequest):
@property
def body(self):
- if self._body is None:
- self._body = self.parser.recv_body()
- return self._body
+ return super().body.encode(ENCODING)
+
+ @property
+ def headers(self):
+ return httprettifier_headers(super().headers)
class Response(MocketHttpResponse):
@@ -116,6 +118,7 @@
__all__ = (
"HTTPretty",
+ "httpretty",
"activate",
"async_httprettified",
"httprettified",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mocket-3.10.9/mocket/plugins/pook_mock_engine.py new/mocket-3.11.0/mocket/plugins/pook_mock_engine.py
--- old/mocket-3.10.9/mocket/plugins/pook_mock_engine.py 2022-05-18 14:31:33.000000000 +0200
+++ new/mocket-3.11.0/mocket/plugins/pook_mock_engine.py 2023-02-19 16:55:48.000000000 +0100
@@ -1,71 +1,76 @@
-from pook.engine import MockEngine
-from pook.interceptors.base import BaseInterceptor
+import platform
-from mocket.mocket import Mocket
-from mocket.mockhttp import Entry, Response
-
-
-class MocketPookEntry(Entry):
- pook_request = None
- pook_engine = None
-
- def can_handle(self, data):
- can_handle = super(MocketPookEntry, self).can_handle(data)
-
- if can_handle:
- self.pook_engine.match(self.pook_request)
- return can_handle
-
- @classmethod
- def single_register(cls, method, uri, body='', status=200, headers=None, match_querystring=True):
- entry = cls(
- uri, method, Response(
- body=body, status=status, headers=headers
- ), match_querystring=match_querystring
- )
- Mocket.register(entry)
- return entry
-
-
-class MocketInterceptor(BaseInterceptor):
- @staticmethod
- def activate():
- Mocket.disable()
- Mocket.enable()
-
- @staticmethod
- def disable():
- Mocket.disable()
-
-
-class MocketEngine(MockEngine):
-
- def __init__(self, engine):
- def mocket_mock_fun(*args, **kwargs):
- mock = self.pook_mock_fun(*args, **kwargs)
-
- request = mock._request
- method = request.method
- url = request.rawurl
-
- response = mock._response
- body = response._body
- status = response._status
- headers = response._headers
-
- entry = MocketPookEntry.single_register(method, url, body, status, headers)
- entry.pook_engine = self.engine
- entry.pook_request = request
-
- return mock
-
- # Store plugins engine
- self.engine = engine
- # Store HTTP client interceptors
- self.interceptors = []
- # Self-register MocketInterceptor
- self.add_interceptor(MocketInterceptor)
-
- # mocking pook.mock()
- self.pook_mock_fun = self.engine.mock
- self.engine.mock = mocket_mock_fun
+if not platform.python_version().startswith("3.11."):
+ # it looks like `pook` is not compatible with Python 3.11
+ from pook.engine import MockEngine
+ from pook.interceptors.base import BaseInterceptor
+
+ from mocket.mocket import Mocket
+ from mocket.mockhttp import Entry, Response
+
+ class MocketPookEntry(Entry):
+ pook_request = None
+ pook_engine = None
+
+ def can_handle(self, data):
+ can_handle = super(MocketPookEntry, self).can_handle(data)
+
+ if can_handle:
+ self.pook_engine.match(self.pook_request)
+ return can_handle
+
+ @classmethod
+ def single_register(
+ cls, method, uri, body="", status=200, headers=None, match_querystring=True
+ ):
+ entry = cls(
+ uri,
+ method,
+ Response(body=body, status=status, headers=headers),
+ match_querystring=match_querystring,
+ )
+ Mocket.register(entry)
+ return entry
+
+ class MocketInterceptor(BaseInterceptor):
+ @staticmethod
+ def activate():
+ Mocket.disable()
+ Mocket.enable()
+
+ @staticmethod
+ def disable():
+ Mocket.disable()
+
+ class MocketEngine(MockEngine):
+ def __init__(self, engine):
+ def mocket_mock_fun(*args, **kwargs):
+ mock = self.pook_mock_fun(*args, **kwargs)
+
+ request = mock._request
+ method = request.method
+ url = request.rawurl
+
+ response = mock._response
+ body = response._body
+ status = response._status
+ headers = response._headers
+
+ entry = MocketPookEntry.single_register(
+ method, url, body, status, headers
+ )
+ entry.pook_engine = self.engine
+ entry.pook_request = request
+
+ return mock
+
+ # Store plugins engine
+ self.engine = engine
+ # Store HTTP client interceptors
+ self.interceptors = []
+ # Self-register MocketInterceptor
+ self.add_interceptor(MocketInterceptor)
+
+ # mocking pook.mock()
+ self.pook_mock_fun = self.engine.mock
+ self.engine.mock = mocket_mock_fun
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mocket-3.10.9/mocket.egg-info/PKG-INFO new/mocket-3.11.0/mocket.egg-info/PKG-INFO
--- old/mocket-3.10.9/mocket.egg-info/PKG-INFO 2022-12-03 23:22:43.000000000 +0100
+++ new/mocket-3.11.0/mocket.egg-info/PKG-INFO 2023-02-19 16:56:36.000000000 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: mocket
-Version: 3.10.9
+Version: 3.11.0
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
@@ -15,6 +15,7 @@
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
+Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Software Development
@@ -259,7 +260,6 @@
import aiohttp
import asyncio
- import async_timeout
from unittest import TestCase
from mocket.plugins.httpretty import httpretty, httprettified
@@ -276,13 +276,14 @@
)
async def main(l):
- async with aiohttp.ClientSession(loop=l) as session:
- with async_timeout.timeout(3):
- async with session.get(url) as get_response:
- assert get_response.status == 200
- assert await get_response.text() == '{"origin": "127.0.0.1"}'
+ async with aiohttp.ClientSession(
+ loop=l, timeout=aiohttp.ClientTimeout(total=3)
+ ) as session:
+ async with session.get(url) as get_response:
+ assert get_response.status == 200
+ assert await get_response.text() == '{"origin": "127.0.0.1"}'
- loop = asyncio.get_event_loop()
+ loop = asyncio.new_event_loop()
loop.set_debug(True)
loop.run_until_complete(main(loop))
@@ -305,18 +306,18 @@
Entry.single_register(Entry.POST, url, body=body*2, status=201)
async def main(l):
- async with aiohttp.ClientSession(loop=l) as session:
- with async_timeout.timeout(3):
- async with session.get(url) as get_response:
- assert get_response.status == 404
- assert await get_response.text() == body
-
- with async_timeout.timeout(3):
- async with session.post(url, data=body * 6) as post_response:
- assert post_response.status == 201
- assert await post_response.text() == body * 2
+ async with aiohttp.ClientSession(
+ loop=l, timeout=aiohttp.ClientTimeout(total=3)
+ ) as session:
+ async with session.get(url) as get_response:
+ assert get_response.status == 404
+ assert await get_response.text() == body
+
+ async with session.post(url, data=body * 6) as post_response:
+ assert post_response.status == 201
+ assert await post_response.text() == body * 2
- loop = asyncio.get_event_loop()
+ loop = asyncio.new_event_loop()
loop.run_until_complete(main(loop))
# or again with a unittest.IsolatedAsyncioTestCase
@@ -330,18 +331,18 @@
Entry.single_register(Entry.GET, url, body=body, status=404)
Entry.single_register(Entry.POST, url, body=body * 2, status=201)
- async with aiohttp.ClientSession() as session:
- with async_timeout.timeout(3):
- async with session.get(url) as get_response:
- assert get_response.status == 404
- assert await get_response.text() == body
-
- with async_timeout.timeout(3):
- async with session.post(url, data=body * 6) as post_response:
- assert post_response.status == 201
- assert await post_response.text() == body * 2
- assert Mocket.last_request().method == 'POST'
- assert Mocket.last_request().body == body * 6
+ async with aiohttp.ClientSession(
+ timeout=aiohttp.ClientTimeout(total=3)
+ ) as session:
+ async with session.get(url) as get_response:
+ assert get_response.status == 404
+ assert await get_response.text() == body
+
+ async with session.post(url, data=body * 6) as post_response:
+ assert post_response.status == 201
+ assert await post_response.text() == body * 2
+ assert Mocket.last_request().method == 'POST'
+ assert Mocket.last_request().body == body * 6
Works well with others
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mocket-3.10.9/mocket.egg-info/requires.txt new/mocket-3.11.0/mocket.egg-info/requires.txt
--- old/mocket-3.10.9/mocket.egg-info/requires.txt 2022-12-03 23:22:43.000000000 +0100
+++ new/mocket-3.11.0/mocket.egg-info/requires.txt 2023-02-19 16:56:36.000000000 +0100
@@ -1,7 +1,7 @@
python-magic>=0.4.5
decorator>=4.0.0
urllib3>=1.25.3
-http-parser>=0.9.0
+httptools
[dev]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mocket-3.10.9/requirements.txt new/mocket-3.11.0/requirements.txt
--- old/mocket-3.10.9/requirements.txt 2022-12-03 23:22:40.000000000 +0100
+++ new/mocket-3.11.0/requirements.txt 2023-02-19 16:56:32.000000000 +0100
@@ -1,4 +1,4 @@
python-magic>=0.4.5
decorator>=4.0.0
urllib3>=1.25.3
-http-parser>=0.9.0
+httptools
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mocket-3.10.9/setup.py new/mocket-3.11.0/setup.py
--- old/mocket-3.10.9/setup.py 2022-08-11 14:47:42.000000000 +0200
+++ new/mocket-3.11.0/setup.py 2023-02-19 16:55:48.000000000 +0100
@@ -57,6 +57,7 @@
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
+ "Programming Language :: Python :: 3.11",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Software Development",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mocket-3.10.9/tests/main/test_http.py new/mocket-3.11.0/tests/main/test_http.py
--- old/mocket-3.10.9/tests/main/test_http.py 2022-05-17 21:03:18.000000000 +0200
+++ new/mocket-3.11.0/tests/main/test_http.py 2023-02-19 16:55:48.000000000 +0100
@@ -13,17 +13,15 @@
import pytest
import requests
-from mocket import Mocket, mocketize
+from mocket import Mocket, Mocketizer, mocketize
from mocket.mockhttp import Entry, Response
-recording_directory = tempfile.mkdtemp()
-
class HttpTestCase(TestCase):
def assertEqualHeaders(self, first, second, msg=None):
first = {k.lower(): v for k, v in first.items()}
second = {k.lower(): v for k, v in second.items()}
- self.assertEqual(first, second, msg)
+ self.assertDictEqual(first, second, msg)
@pytest.mark.skipif('os.getenv("SKIP_TRUE_HTTP", False)')
@@ -36,57 +34,63 @@
resp = requests.get(url)
self.assertEqual(resp.status_code, 200)
- @mocketize(truesocket_recording_dir=recording_directory)
def test_truesendall_with_recording(self):
- url = "http://httpbin.org/ip"
-
- urlopen(url)
- requests.get(url)
- resp = urlopen(url)
- self.assertEqual(resp.code, 200)
- resp = requests.get(url)
- self.assertEqual(resp.status_code, 200)
- assert "origin" in resp.json()
-
- dump_filename = os.path.join(
- Mocket.get_truesocket_recording_dir(), Mocket.get_namespace() + ".json"
- )
- with io.open(dump_filename) as f:
- responses = json.load(f)
+ with tempfile.TemporaryDirectory() as temp_dir:
+ with Mocketizer(truesocket_recording_dir=temp_dir):
+ url = "http://httpbin.org/ip"
+
+ urlopen(url)
+ requests.get(url)
+ resp = urlopen(url)
+ self.assertEqual(resp.code, 200)
+ resp = requests.get(url)
+ self.assertEqual(resp.status_code, 200)
+ assert "origin" in resp.json()
+
+ dump_filename = os.path.join(
+ Mocket.get_truesocket_recording_dir(),
+ Mocket.get_namespace() + ".json",
+ )
+ with io.open(dump_filename) as f:
+ responses = json.load(f)
- self.assertEqual(len(responses["httpbin.org"]["80"].keys()), 2)
+ self.assertEqual(len(responses["httpbin.org"]["80"].keys()), 2)
- @mocketize(truesocket_recording_dir=recording_directory)
def test_truesendall_with_gzip_recording(self):
- url = "http://httpbin.org/gzip"
+ with tempfile.TemporaryDirectory() as temp_dir:
+ with Mocketizer(truesocket_recording_dir=temp_dir):
+ url = "http://httpbin.org/gzip"
+
+ requests.get(url)
+ resp = requests.get(url)
+ self.assertEqual(resp.status_code, 200)
+
+ dump_filename = os.path.join(
+ Mocket.get_truesocket_recording_dir(),
+ Mocket.get_namespace() + ".json",
+ )
+ with io.open(dump_filename) as f:
+ responses = json.load(f)
- requests.get(url)
- resp = requests.get(url)
- self.assertEqual(resp.status_code, 200)
-
- dump_filename = os.path.join(
- Mocket.get_truesocket_recording_dir(), Mocket.get_namespace() + ".json"
- )
- with io.open(dump_filename) as f:
- responses = json.load(f)
-
- assert len(responses["httpbin.org"]["80"].keys()) == 1
+ assert len(responses["httpbin.org"]["80"].keys()) == 1
- @mocketize(truesocket_recording_dir=recording_directory)
def test_truesendall_with_chunk_recording(self):
- url = "http://httpbin.org/range/70000?chunk_size=65536"
-
- requests.get(url)
- resp = requests.get(url)
- self.assertEqual(resp.status_code, 200)
-
- dump_filename = os.path.join(
- Mocket.get_truesocket_recording_dir(), Mocket.get_namespace() + ".json"
- )
- with io.open(dump_filename) as f:
- responses = json.load(f)
+ with tempfile.TemporaryDirectory() as temp_dir:
+ with Mocketizer(truesocket_recording_dir=temp_dir):
+ url = "http://httpbin.org/range/70000?chunk_size=65536"
+
+ requests.get(url)
+ resp = requests.get(url)
+ self.assertEqual(resp.status_code, 200)
+
+ dump_filename = os.path.join(
+ Mocket.get_truesocket_recording_dir(),
+ Mocket.get_namespace() + ".json",
+ )
+ with io.open(dump_filename) as f:
+ responses = json.load(f)
- assert len(responses["httpbin.org"]["80"].keys()) == 1
+ assert len(responses["httpbin.org"]["80"].keys()) == 1
@mocketize
def test_wrongpath_truesendall(self):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mocket-3.10.9/tests/main/test_http_aiohttp.py new/mocket-3.11.0/tests/main/test_http_aiohttp.py
--- old/mocket-3.10.9/tests/main/test_http_aiohttp.py 2022-01-08 17:50:17.000000000 +0100
+++ new/mocket-3.11.0/tests/main/test_http_aiohttp.py 2023-02-19 16:55:48.000000000 +0100
@@ -1,82 +1,79 @@
-import asyncio
import json
-from unittest import TestCase
import aiohttp
-import async_timeout
+import pytest
+from asgiref.sync import async_to_sync
from mocket.mocket import Mocket, mocketize
from mocket.mockhttp import Entry
-from mocket.plugins.httpretty import HTTPretty, httprettified
+from mocket.plugins.httpretty import httprettified, httpretty
+timeout = aiohttp.ClientTimeout(total=3)
-class AioHttpEntryTestCase(TestCase):
- @mocketize
- def test_http_session(self):
- url = "http://httpbin.org/ip"
- body = "asd" * 100
- Entry.single_register(Entry.GET, url, body=body, status=404)
- Entry.single_register(Entry.POST, url, body=body * 2, status=201)
-
- async def main(_loop):
- async with aiohttp.ClientSession(loop=_loop) as session:
- with async_timeout.timeout(3):
- async with session.get(url) as get_response:
- assert get_response.status == 404
- assert await get_response.text() == body
-
- with async_timeout.timeout(3):
- async with session.post(url, data=body * 6) as post_response:
- assert post_response.status == 201
- assert await post_response.text() == body * 2
- assert Mocket.last_request().method == "POST"
- assert Mocket.last_request().body == body * 6
-
- loop = asyncio.get_event_loop()
- loop.set_debug(True)
- loop.run_until_complete(main(loop))
- self.assertEqual(len(Mocket.request_list()), 2)
-
- @mocketize
- def test_https_session(self):
- url = "https://httpbin.org/ip"
- body = "asd" * 100
- Entry.single_register(Entry.GET, url, body=body, status=404)
- Entry.single_register(Entry.POST, url, body=body * 2, status=201)
-
- async def main(_loop):
- async with aiohttp.ClientSession(loop=_loop) as session:
- with async_timeout.timeout(3):
- async with session.get(url) as get_response:
- assert get_response.status == 404
- assert await get_response.text() == body
-
- with async_timeout.timeout(3):
- async with session.post(url, data=body * 6) as post_response:
- assert post_response.status == 201
- assert await post_response.text() == body * 2
-
- loop = asyncio.get_event_loop()
- loop.set_debug(True)
- loop.run_until_complete(main(loop))
- self.assertEqual(len(Mocket.request_list()), 2)
-
- @httprettified
- def test_httprettish_session(self):
- url = "https://httpbin.org/ip"
- HTTPretty.register_uri(
- HTTPretty.GET,
- url,
- body=json.dumps(dict(origin="127.0.0.1")),
- )
-
- async def main(_loop):
- async with aiohttp.ClientSession(loop=_loop) as session:
- with async_timeout.timeout(3):
- async with session.get(url) as get_response:
- assert get_response.status == 200
- assert await get_response.text() == '{"origin": "127.0.0.1"}'
-
- loop = asyncio.get_event_loop()
- loop.set_debug(True)
- loop.run_until_complete(main(loop))
+
+@mocketize
+def test_http_session():
+ url = "http://httpbin.org/ip"
+ body = "asd" * 100
+ Entry.single_register(Entry.GET, url, body=body, status=404)
+ Entry.single_register(Entry.POST, url, body=body * 2, status=201)
+
+ @async_to_sync
+ async def perform_aiohttp_transactions():
+ async with aiohttp.ClientSession(timeout=timeout) as session:
+ async with session.get(url) as get_response:
+ assert get_response.status == 404
+ assert await get_response.text() == body
+
+ async with session.post(url, data=body * 6) as post_response:
+ assert post_response.status == 201
+ assert await post_response.text() == body * 2
+ assert Mocket.last_request().method == "POST"
+ assert Mocket.last_request().body == body * 6
+
+ perform_aiohttp_transactions()
+ assert len(Mocket.request_list()) == 2
+
+
+(a)pytest.mark.xfail
+@mocketize
+def test_https_session():
+ url = "https://httpbin.org/ip"
+ body = "asd" * 100
+ Entry.single_register(Entry.GET, url, body=body, status=404)
+ Entry.single_register(Entry.POST, url, body=body * 2, status=201)
+
+ @async_to_sync
+ async def perform_aiohttp_transactions():
+ async with aiohttp.ClientSession(timeout=timeout) as session:
+ async with session.get(url) as get_response:
+ assert get_response.status == 404
+ assert await get_response.text() == body
+
+ async with session.post(url, data=body * 6) as post_response:
+ assert post_response.status == 201
+ assert await post_response.text() == body * 2
+
+ perform_aiohttp_transactions()
+ assert len(Mocket.request_list()) == 2
+
+
+(a)pytest.mark.xfail
+@httprettified
+def test_httprettish_session():
+ url = "https://httpbin.org/ip"
+ httpretty.register_uri(
+ httpretty.GET,
+ url,
+ body=json.dumps(dict(origin="127.0.0.1")),
+ )
+
+ @async_to_sync
+ async def perform_aiohttp_transactions():
+ async with aiohttp.ClientSession(timeout=timeout) as session:
+ async with session.get(url) as get_response:
+ assert get_response.status == 200
+ assert await get_response.text() == '{"origin": "127.0.0.1"}'
+
+ perform_aiohttp_transactions()
+ assert len(httpretty.latest_requests) == 1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mocket-3.10.9/tests/main/test_https.py new/mocket-3.11.0/tests/main/test_https.py
--- old/mocket-3.10.9/tests/main/test_https.py 2022-01-08 13:36:13.000000000 +0100
+++ new/mocket-3.11.0/tests/main/test_https.py 2023-02-19 16:55:48.000000000 +0100
@@ -42,22 +42,23 @@
@pytest.mark.skipif('os.getenv("SKIP_TRUE_HTTP", False)')
-@mocketize(truesocket_recording_dir=recording_directory)
def test_truesendall_with_recording_https():
- url = "https://httpbin.org/ip"
+ with tempfile.TemporaryDirectory() as temp_dir:
+ with Mocketizer(truesocket_recording_dir=temp_dir):
+ url = "https://httpbin.org/ip"
+
+ requests.get(url, headers={"Accept": "application/json"})
+ resp = requests.get(url, headers={"Accept": "application/json"})
+ assert resp.status_code == 200
+
+ dump_filename = os.path.join(
+ Mocket.get_truesocket_recording_dir(),
+ Mocket.get_namespace() + ".json",
+ )
+ with io.open(dump_filename) as f:
+ responses = json.load(f)
- requests.get(url, headers={"Accept": "application/json"})
- resp = requests.get(url, headers={"Accept": "application/json"})
- assert resp.status_code == 200
-
- dump_filename = os.path.join(
- Mocket.get_truesocket_recording_dir(),
- Mocket.get_namespace() + ".json",
- )
- with io.open(dump_filename) as f:
- responses = json.load(f)
-
- assert len(responses["httpbin.org"]["443"].keys()) == 1
+ assert len(responses["httpbin.org"]["443"].keys()) == 1
@pytest.mark.skipif('os.getenv("SKIP_TRUE_HTTP", False)')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mocket-3.10.9/tests/main/test_mocket.py new/mocket-3.11.0/tests/main/test_mocket.py
--- old/mocket-3.10.9/tests/main/test_mocket.py 2022-04-25 08:49:46.000000000 +0200
+++ new/mocket-3.11.0/tests/main/test_mocket.py 2023-02-19 16:55:48.000000000 +0100
@@ -174,13 +174,13 @@
@pytest.fixture
-def fixture():
+def two():
return 2
@mocketize
-def test_mocketize_with_fixture(fixture):
- assert 2 == fixture
+def test_mocketize_with_fixture(two):
+ assert 2 == two
@mocketize
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mocket-3.10.9/tests/main/test_pook.py new/mocket-3.11.0/tests/main/test_pook.py
--- old/mocket-3.10.9/tests/main/test_pook.py 2021-03-20 19:51:56.000000000 +0100
+++ new/mocket-3.11.0/tests/main/test_pook.py 2023-02-19 16:55:48.000000000 +0100
@@ -1,30 +1,33 @@
-import pook
-import requests
+import platform
-from mocket.plugins.pook_mock_engine import MocketEngine
-
-pook.set_mock_engine(MocketEngine)
-
-
-(a)pook.on
-def test_pook_engine():
-
- url = "http://twitter.com/api/1/foobar"
- status = 404
- response_json = {"error": "foo"}
-
- mock = pook.get(
- url,
- headers={"content-type": "application/json"},
- reply=status,
- response_json=response_json,
- )
- mock.persist()
-
- requests.get(url)
- assert mock.calls == 1
-
- resp = requests.get(url)
- assert resp.status_code == status
- assert resp.json() == response_json
- assert mock.calls == 2
+if not platform.python_version().startswith("3.11."):
+ # it looks like `pook` is not compatible with Python 3.11
+ import pook
+ import requests
+
+ from mocket.plugins.pook_mock_engine import MocketEngine
+
+ pook.set_mock_engine(MocketEngine)
+
+ @pook.on
+ def test_pook_engine():
+
+ url = "http://twitter.com/api/1/foobar"
+ status = 404
+ response_json = {"error": "foo"}
+
+ mock = pook.get(
+ url,
+ headers={"content-type": "application/json"},
+ reply=status,
+ response_json=response_json,
+ )
+ mock.persist()
+
+ requests.get(url)
+ assert mock.calls == 1
+
+ resp = requests.get(url)
+ assert resp.status_code == status
+ assert resp.json() == response_json
+ assert mock.calls == 2
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mocket-3.10.9/tests/tests37/test_asyncio.py new/mocket-3.11.0/tests/tests37/test_asyncio.py
--- old/mocket-3.10.9/tests/tests37/test_asyncio.py 2021-08-31 12:37:51.000000000 +0200
+++ new/mocket-3.11.0/tests/tests37/test_asyncio.py 2023-02-19 16:55:48.000000000 +0100
@@ -2,47 +2,39 @@
import glob
import io
import json
-import shutil
import socket
import tempfile
-from unittest import TestCase
-from mocket.mocket import mocketize
+from mocket import Mocketizer
-class AsyncIoRecordTestCase(TestCase):
- temp_dir = tempfile.mkdtemp()
+def test_asyncio_record_replay(event_loop):
+ async def test_asyncio_connection():
+ reader, writer = await asyncio.open_connection(
+ host="google.com",
+ port=80,
+ family=socket.AF_INET,
+ proto=socket.IPPROTO_TCP,
+ ssl=None,
+ server_hostname=None,
+ )
+
+ buf = "GET / HTTP/1.1\r\nHost: google.com\r\n\r\n"
+ writer.write(buf.encode())
+ await writer.drain()
+
+ await reader.readline()
+ writer.close()
+ await writer.wait_closed()
+
+ with tempfile.TemporaryDirectory() as temp_dir:
+ with Mocketizer(truesocket_recording_dir=temp_dir):
+ event_loop.run_until_complete(test_asyncio_connection())
- @mocketize(truesocket_recording_dir=temp_dir)
- def test_asyncio_record_replay(self):
- async def test_asyncio_connection():
- reader, writer = await asyncio.open_connection(
- host="google.com",
- port=80,
- family=socket.AF_INET,
- proto=socket.IPPROTO_TCP,
- ssl=None,
- server_hostname=None,
- )
-
- buf = "GET / HTTP/1.1\r\nHost: google.com\r\n\r\n"
- writer.write(buf.encode())
- await writer.drain()
-
- await reader.readline()
- writer.close()
- await writer.wait_closed()
-
- loop = asyncio.get_event_loop()
- loop.set_debug(True)
- loop.run_until_complete(test_asyncio_connection())
-
- files = glob.glob(f"{self.temp_dir}/*.json")
- self.assertEqual(len(files), 1)
+ files = glob.glob(f"{temp_dir}/*.json")
+ assert len(files) == 1
with io.open(files[0]) as f:
responses = json.load(f)
- self.assertEqual(len(responses["google.com"]["80"].keys()), 1)
-
- shutil.rmtree(self.temp_dir)
+ assert len(responses["google.com"]["80"].keys()) == 1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mocket-3.10.9/tests/tests38/test_http_aiohttp.py new/mocket-3.11.0/tests/tests38/test_http_aiohttp.py
--- old/mocket-3.10.9/tests/tests38/test_http_aiohttp.py 2022-01-08 17:50:17.000000000 +0100
+++ new/mocket-3.11.0/tests/tests38/test_http_aiohttp.py 2023-02-19 16:55:48.000000000 +0100
@@ -2,7 +2,8 @@
from unittest import IsolatedAsyncioTestCase
import aiohttp
-import async_timeout
+import httpx
+import pytest
from mocket.async_mocket import async_mocketize
from mocket.mocket import Mocket
@@ -11,59 +12,70 @@
class AioHttpEntryTestCase(IsolatedAsyncioTestCase):
+ timeout = aiohttp.ClientTimeout(total=3)
+ target_url = "http://httpbin.org/ip"
+
@async_mocketize
async def test_http_session(self):
- url = "http://httpbin.org/ip"
body = "asd" * 100
- Entry.single_register(Entry.GET, url, body=body, status=404)
- Entry.single_register(Entry.POST, url, body=body * 2, status=201)
+ Entry.single_register(Entry.GET, self.target_url, body=body, status=404)
+ Entry.single_register(Entry.POST, self.target_url, body=body * 2, status=201)
- async with aiohttp.ClientSession() as session:
- with async_timeout.timeout(3):
- async with session.get(url) as get_response:
- assert get_response.status == 404
- assert await get_response.text() == body
-
- with async_timeout.timeout(3):
- async with session.post(url, data=body * 6) as post_response:
- assert post_response.status == 201
- assert await post_response.text() == body * 2
- assert Mocket.last_request().method == "POST"
- assert Mocket.last_request().body == body * 6
+ async with aiohttp.ClientSession(timeout=self.timeout) as session:
+ async with session.get(self.target_url) as get_response:
+ assert get_response.status == 404
+ assert await get_response.text() == body
+
+ async with session.post(self.target_url, data=body * 6) as post_response:
+ assert post_response.status == 201
+ assert await post_response.text() == body * 2
+ assert Mocket.last_request().method == "POST"
+ assert Mocket.last_request().body == body * 6
self.assertEqual(len(Mocket.request_list()), 2)
@async_mocketize
async def test_https_session(self):
- url = "https://httpbin.org/ip"
body = "asd" * 100
- Entry.single_register(Entry.GET, url, body=body, status=404)
- Entry.single_register(Entry.POST, url, body=body * 2, status=201)
+ Entry.single_register(Entry.GET, self.target_url, body=body, status=404)
+ Entry.single_register(Entry.POST, self.target_url, body=body * 2, status=201)
- async with aiohttp.ClientSession() as session:
- with async_timeout.timeout(3):
- async with session.get(url) as get_response:
- assert get_response.status == 404
- assert await get_response.text() == body
-
- with async_timeout.timeout(3):
- async with session.post(url, data=body * 6) as post_response:
- assert post_response.status == 201
- assert await post_response.text() == body * 2
+ async with aiohttp.ClientSession(timeout=self.timeout) as session:
+ async with session.get(self.target_url) as get_response:
+ assert get_response.status == 404
+ assert await get_response.text() == body
+
+ async with session.post(self.target_url, data=body * 6) as post_response:
+ assert post_response.status == 201
+ assert await post_response.text() == body * 2
self.assertEqual(len(Mocket.request_list()), 2)
+ @pytest.mark.xfail
@async_httprettified
async def test_httprettish_session(self):
- url = "https://httpbin.org/ip"
HTTPretty.register_uri(
HTTPretty.GET,
- url,
+ self.target_url,
body=json.dumps(dict(origin="127.0.0.1")),
)
- async with aiohttp.ClientSession() as session:
- with async_timeout.timeout(3):
- async with session.get(url) as get_response:
- assert get_response.status == 200
- assert await get_response.text() == '{"origin": "127.0.0.1"}'
+ async with aiohttp.ClientSession(timeout=self.timeout) as session:
+ async with session.get(self.target_url) as get_response:
+ assert get_response.status == 200
+ assert await get_response.text() == '{"origin": "127.0.0.1"}'
+
+ @async_httprettified
+ async def test_httprettish_httpx_session(self):
+ expected_response = {"origin": "127.0.0.1"}
+
+ HTTPretty.register_uri(
+ HTTPretty.GET,
+ self.target_url,
+ body=json.dumps(expected_response),
+ )
+
+ async with httpx.AsyncClient() as client:
+ response = await client.get(self.target_url)
+ assert response.status_code == 200
+ assert response.json() == expected_response
1
0