commit c97da4fa1a6a7daae7c0a6da76710abebb3e9ac780c5d35e98192f3d037ffbbd Author: Tomáš Chvátal Date: Wed Sep 18 07:40:00 2019 +0000 Accepting request 731639 from home:jayvdb:py-new add patch to fix py2 bug OBS-URL: https://build.opensuse.org/request/show/731639 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-mocket?expand=0&rev=1 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/mocket-3.7.2.tar.gz b/mocket-3.7.2.tar.gz new file mode 100644 index 0000000..cc1ca1d --- /dev/null +++ b/mocket-3.7.2.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1637b5b7878a9d6fc90c124f059a78c824a3972932e821fd8069532dc57aec8e +size 68728 diff --git a/partial-wildcards.patch b/partial-wildcards.patch new file mode 100644 index 0000000..f8027eb --- /dev/null +++ b/partial-wildcards.patch @@ -0,0 +1,22 @@ +From 98b3302d9f7bef7becaacd0a86b2ba48e90ddcfb Mon Sep 17 00:00:00 2001 +From: Giorgio Salluzzo +Date: Wed, 18 Sep 2019 08:12:54 +0200 +Subject: [PATCH] Partial wildcards fix. + +--- + mocket/mocket.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/mocket/mocket.py b/mocket/mocket.py +index 2cfe43d..df00813 100644 +--- a/mocket/mocket.py ++++ b/mocket/mocket.py +@@ -210,7 +210,7 @@ def getpeercert(self, *args, **kwargs): + return { + "notAfter": shift.strftime("%b %d %H:%M:%S GMT"), + "subjectAltName": ( +- ("DNS", "*%s" % self._host), ++ ("DNS", "*.%s" % self._host), + ("DNS", self._host), + ("DNS", "*"), + ), diff --git a/python-mocket.changes b/python-mocket.changes new file mode 100644 index 0000000..6059051 --- /dev/null +++ b/python-mocket.changes @@ -0,0 +1,10 @@ +------------------------------------------------------------------- +Wed Sep 18 04:08:03 UTC 2019 - John Vandenberg + +- Activate test suite +- Update to v3.7.2 + +------------------------------------------------------------------- +Fri Apr 19 11:41:58 AM UTC 2019 - John Vandenberg + +- Initial spec for v2.7.2 diff --git a/python-mocket.spec b/python-mocket.spec new file mode 100644 index 0000000..89b0548 --- /dev/null +++ b/python-mocket.spec @@ -0,0 +1,108 @@ +# +# spec file for package python-mocket +# +# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%{?!python_module:%define python_module() python-%{**} python3-%{**}} +Name: python-mocket +Version: 3.7.2 +Release: 0 +Summary: Python socket mock framework +License: BSD-3-Clause +Group: Development/Languages/Python +URL: https://github.com/mindflayer/python-mocket +Source: https://github.com/mindflayer/python-mocket/archive/%{version}.tar.gz#/mocket-%{version}.tar.gz +# https://github.com/mindflayer/python-mocket/issues/102 +Patch0: https://github.com/mindflayer/python-mocket/commit/98b3302d9.patch#/partial-wildcards.patch +BuildRequires: %{python_module setuptools} +BuildRequires: fdupes +BuildRequires: python-rpm-macros +Requires: python-decorator +Requires: python-hexdump +Requires: python-python-magic +Requires: python-six +Requires: python-urllib3 +Suggests: python-gevent +Suggests: python-pook >= 0.2.1 +Suggests: python-redis +Suggests: python-requests +Suggests: python-xxhash +BuildArch: noarch +# SECTION test requirements +BuildRequires: %{python_module cryptography} +BuildRequires: %{python_module decorator} +BuildRequires: %{python_module gevent} +BuildRequires: %{python_module hexdump} +BuildRequires: %{python_module mock} +BuildRequires: %{python_module pyOpenSSL} +BuildRequires: %{python_module PySocks} +BuildRequires: %{python_module pytest} +BuildRequires: %{python_module python-magic} +BuildRequires: %{python_module redis} +BuildRequires: %{python_module requests} +BuildRequires: %{python_module six} +BuildRequires: %{python_module sure} +BuildRequires: %{python_module urllib3} +BuildRequires: %{python_module xxhash} +BuildRequires: ca-certificates-mozilla +BuildRequires: python3-aiohttp +BuildRequires: python3-async_timeout +# /SECTION +%python_subpackages + +%description +Socket Mock Framework - for all kinds of socket animals, web-clients +included, with gevent/asyncio/SSL support. + +%prep +%setup -q -n python-mocket-%{version} +%patch0 -p1 + +rm -f setup.cfg pytest.ini tox.ini + +touch conftest.py + +rm tests/tests27/test_pook.py + +%build +export LANG=en_US.UTF-8 +%python_build + +%install +export LANG=en_US.UTF-8 +%python_install +%{python_expand rm -r %{buildroot}%{$python_sitelib}/tests +%fdupes %{buildroot}%{$python_sitelib} +} + +%check +export LANG=en_US.UTF-8 +export PYTHONPATH=${PWD} +export SKIP_TRUE_HTTP=1 +%{python_expand # +if [ $python = python2 ]; then + $python -m pytest tests/main mocket tests/tests27/ -vv -k 'not RedisTestCase' +else + $python -m pytest tests/main mocket tests/tests27/ tests/tests35/ -vv -k 'not RedisTestCase' +fi +} + +%files %{python_files} +%doc README.rst +%license LICENSE +%{python_sitelib}/* + +%changelog