[arch-commits] Commit in python-vcrpy/repos/community-staging-any (3 files)

Felix Yan felixonmars at gemini.archlinux.org
Thu Dec 2 18:24:42 UTC 2021


    Date: Thursday, December 2, 2021 @ 18:24:42
  Author: felixonmars
Revision: 1062130

archrelease: copy trunk to community-staging-any

Added:
  python-vcrpy/repos/community-staging-any/PKGBUILD
    (from rev 1062129, python-vcrpy/trunk/PKGBUILD)
  python-vcrpy/repos/community-staging-any/fix-urllib-redirect-tests.patch
    (from rev 1062129, python-vcrpy/trunk/fix-urllib-redirect-tests.patch)
Deleted:
  python-vcrpy/repos/community-staging-any/PKGBUILD

---------------------------------+
 PKGBUILD                        |   67 ++++++++++++++++++++------------------
 fix-urllib-redirect-tests.patch |   60 ++++++++++++++++++++++++++++++++++
 2 files changed, 97 insertions(+), 30 deletions(-)

Deleted: PKGBUILD
===================================================================
--- PKGBUILD	2021-12-02 18:24:32 UTC (rev 1062129)
+++ PKGBUILD	2021-12-02 18:24:42 UTC (rev 1062130)
@@ -1,30 +0,0 @@
-# Maintainer: Felix Yan <felixonmars at archlinux.org>
-
-pkgname=python-vcrpy
-pkgver=4.1.1
-pkgrel=4
-pkgdesc='Automatically mock your HTTP interactions to simplify and speed up testing'
-arch=('any')
-license=('MIT')
-url='https://github.com/kevin1024/vcrpy'
-depends=('python-yaml' 'python-wrapt' 'python-six' 'python-yarl')
-makedepends=('python-setuptools')
-checkdepends=('python-pytest-runner' 'python-pytest-httpbin' 'python-mock')
-source=("$pkgname-$pkgver.tar.gz::https://github.com/kevin1024/vcrpy/archive/v$pkgver.tar.gz")
-sha512sums=('afa1904bff37bfd2d278ed49fa3982a357eb6bb113818b532044da0f11a9dd877cc152d7f0d81d88bdc0f870521b1241f6aecf959f668211904e3c6c7cea4ad8')
-
-build() {
-  cd vcrpy-$pkgver
-  python setup.py build
-}
-
-check() {
-  cd vcrpy-$pkgver
-  python setup.py pytest
-}
-
-package() {
-  cd vcrpy-$pkgver
-  python setup.py install --root="$pkgdir" --optimize=1
-  install -D -m644 LICENSE.txt "$pkgdir"/usr/share/licenses/$pkgname/LICENSE.txt
-}

Copied: python-vcrpy/repos/community-staging-any/PKGBUILD (from rev 1062129, python-vcrpy/trunk/PKGBUILD)
===================================================================
--- PKGBUILD	                        (rev 0)
+++ PKGBUILD	2021-12-02 18:24:42 UTC (rev 1062130)
@@ -0,0 +1,37 @@
+# Maintainer: Felix Yan <felixonmars at archlinux.org>
+
+pkgname=python-vcrpy
+pkgver=4.1.1
+pkgrel=5
+pkgdesc='Automatically mock your HTTP interactions to simplify and speed up testing'
+arch=('any')
+license=('MIT')
+url='https://github.com/kevin1024/vcrpy'
+depends=('python-yaml' 'python-wrapt' 'python-six' 'python-yarl')
+makedepends=('python-setuptools')
+checkdepends=('python-pytest-runner' 'python-pytest-httpbin' 'python-mock')
+source=("$pkgname-$pkgver.tar.gz::https://github.com/kevin1024/vcrpy/archive/v$pkgver.tar.gz"
+        fix-urllib-redirect-tests.patch)
+sha512sums=('afa1904bff37bfd2d278ed49fa3982a357eb6bb113818b532044da0f11a9dd877cc152d7f0d81d88bdc0f870521b1241f6aecf959f668211904e3c6c7cea4ad8'
+            'abe9cbb99e83e8bc521ec7e744f52580b410ed88c1dfaa441174ced526460389ffba0decccc4483e50fd9ec68c94388ec5cc1abd668abd88ce057db25a8e9b8d')
+
+prepare() {
+  cd vcrpy-$pkgver
+  patch -Np1 -i ../fix-urllib-redirect-tests.patch
+}
+
+build() {
+  cd vcrpy-$pkgver
+  python setup.py build
+}
+
+check() {
+  cd vcrpy-$pkgver
+  python setup.py pytest
+}
+
+package() {
+  cd vcrpy-$pkgver
+  python setup.py install --root="$pkgdir" --optimize=1
+  install -D -m644 LICENSE.txt "$pkgdir"/usr/share/licenses/$pkgname/LICENSE.txt
+}

Copied: python-vcrpy/repos/community-staging-any/fix-urllib-redirect-tests.patch (from rev 1062129, python-vcrpy/trunk/fix-urllib-redirect-tests.patch)
===================================================================
--- fix-urllib-redirect-tests.patch	                        (rev 0)
+++ fix-urllib-redirect-tests.patch	2021-12-02 18:24:42 UTC (rev 1062130)
@@ -0,0 +1,60 @@
+From cd722780620dfcd6d3cec813ff45c30ce7892342 Mon Sep 17 00:00:00 2001
+From: Jair Henrique <jair.henrique at gmail.com>
+Date: Tue, 2 Nov 2021 16:15:04 -0300
+Subject: [PATCH] Fix urllib redirect tests
+
+---
+ tests/integration/test_urllib2.py |  7 ++++---
+ tests/integration/test_urllib3.py | 10 ++++++----
+ 2 files changed, 10 insertions(+), 7 deletions(-)
+
+diff --git a/tests/integration/test_urllib2.py b/tests/integration/test_urllib2.py
+index 2582e0cb..dd74bd58 100644
+--- a/tests/integration/test_urllib2.py
++++ b/tests/integration/test_urllib2.py
+@@ -56,12 +56,13 @@ def test_response_headers(httpbin_both, tmpdir):
+         assert sorted(open1) == sorted(open2)
+ 
+ 
+-def test_effective_url(httpbin_both, tmpdir):
++def test_effective_url(tmpdir):
+     """Ensure that the effective_url is captured"""
+-    url = httpbin_both.url + "/redirect-to?url=/html"
++    url = "http://mockbin.org/redirect/301"
++
+     with vcr.use_cassette(str(tmpdir.join("headers.yaml"))):
+         effective_url = urlopen_with_cafile(url).geturl()
+-        assert effective_url == httpbin_both.url + "/html"
++        assert effective_url == "http://mockbin.org/redirect/301/0"
+ 
+     with vcr.use_cassette(str(tmpdir.join("headers.yaml"))):
+         assert effective_url == urlopen_with_cafile(url).geturl()
+diff --git a/tests/integration/test_urllib3.py b/tests/integration/test_urllib3.py
+index 110c05af..01de5a85 100644
+--- a/tests/integration/test_urllib3.py
++++ b/tests/integration/test_urllib3.py
+@@ -94,9 +94,10 @@ def test_post(tmpdir, httpbin_both, verify_pool_mgr):
+     assert req1 == req2
+ 
+ 
+-def test_redirects(tmpdir, httpbin_both, verify_pool_mgr):
++def test_redirects(tmpdir, verify_pool_mgr):
+     """Ensure that we can handle redirects"""
+-    url = httpbin_both.url + "/redirect-to?url=bytes/1024"
++    url = "http://mockbin.org/redirect/301"
++
+     with vcr.use_cassette(str(tmpdir.join("verify_pool_mgr.yaml"))):
+         content = verify_pool_mgr.request("GET", url).data
+ 
+@@ -104,8 +105,9 @@ def test_redirects(tmpdir, httpbin_both, verify_pool_mgr):
+         assert content == verify_pool_mgr.request("GET", url).data
+         # Ensure that we've now cached *two* responses. One for the redirect
+         # and one for the final fetch
+-        assert len(cass) == 2
+-        assert cass.play_count == 2
++
++    assert len(cass) == 2
++    assert cass.play_count == 2
+ 
+ 
+ def test_cross_scheme(tmpdir, httpbin, httpbin_secure, verify_pool_mgr):



More information about the arch-commits mailing list