diff --git a/modify-the-URL-format-of-the-test-case.patch b/modify-the-URL-format-of-the-test-case.patch new file mode 100644 index 0000000000000000000000000000000000000000..3d7ee2613ca647626ef257a176de27ebd8d693c4 --- /dev/null +++ b/modify-the-URL-format-of-the-test-case.patch @@ -0,0 +1,49 @@ +From e9b5c929b5acea0525859c3437b75ec12dc6a08d Mon Sep 17 00:00:00 2001 +From: zhangpan +Date: Mon, 18 Sep 2023 17:28:49 +0800 +Subject: [PATCH] modify the URL format of the test case. + +--- + tests/test_ftp_proxy.py | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/tests/test_ftp_proxy.py b/tests/test_ftp_proxy.py +index a06a8d4..7cbc140 100644 +--- a/tests/test_ftp_proxy.py ++++ b/tests/test_ftp_proxy.py +@@ -30,7 +30,7 @@ def test_proxy_get(ftpd, proxy, session): + # Create a file in the anonymous root and fetch it through a proxy + with _prepareTestData(ftpd.anon_root) as (testfile, testdata): + testurl = 'ftp://127.0.0.1:%d/%s' % (ftpd.ftp_port, testfile) +- response = session.get(testurl, proxies={'ftp': 'localhost:%d' % proxy.port}) ++ response = session.get(testurl, proxies={'ftp':'//''localhost:%d' % proxy.port}) + + assert response.status_code == requests.codes.ok + +@@ -52,7 +52,7 @@ def test_proxy_connection_refused(ftpd, session): + with socketServer(target) as port: + with pytest.raises(requests.exceptions.ConnectionError): + session.get('ftp://127.0.0.1:%d/' % ftpd.ftp_port, +- proxies={'ftp': 'localhost:%d' % port}) ++ proxies={'ftp':'//''localhost:%d' % port}) + + def test_proxy_read_timeout(ftpd, session): + # Create and accept a socket, but never respond +@@ -68,7 +68,7 @@ def test_proxy_read_timeout(ftpd, session): + with socketServer(target, event) as port: + with pytest.raises(requests.exceptions.ReadTimeout): + session.get('ftp://127.0.0.1:%d' % ftpd.ftp_port, +- proxies={'ftp': 'localhost:%d' % port}, timeout=1) ++ proxies={'ftp':'//''localhost:%d' % port}, timeout=1) + + def test_proxy_connection_close(ftpd, session): + # Create and accept a socket, then close it +@@ -80,4 +80,4 @@ def test_proxy_connection_close(ftpd, session): + with socketServer(target) as port: + with pytest.raises(requests.exceptions.ConnectionError): + session.get('ftp://127.0.0.1:%d/' % ftpd.ftp_port, +- proxies={'ftp': 'localhost:%d' % port}, timeout=1) ++ proxies={'ftp':'//''localhost:%d' % port}, timeout=1) +-- +2.27.0 + diff --git a/python-requests-ftp.spec b/python-requests-ftp.spec index cd36c641bf50605eb972631ca956956010886753..f3a41a6db8b3b874df7b08cbf1426067edde93ae 100644 --- a/python-requests-ftp.spec +++ b/python-requests-ftp.spec @@ -2,7 +2,7 @@ Name: python-requests-ftp Version: 0.3.1 -Release: 18 +Release: 19 Summary: FTP Transport Adapter for Requests License: ASL 2.0 URL: https://github.com/Lukasa/requests-ftp @@ -10,12 +10,13 @@ Source0: https://github.com/Lukasa/requests-ftp/archive/v%{version}.tar.gz BuildArch: noarch -BuildRequires: python3-devel python3-setuptools +BuildRequires: python3-devel python3-setuptools pytest python-requests-ftp python-pyftpdlib Patch1: PR28-01-Adding-2-tests-and-updated-statud_code-build.patch Patch2: PR28-02-Adding-code-3-to-retr4ieve-status_code.patch Patch3: PR28-03-fix-warning-in-interpreting-ftp-status-codes-minor-d.patch Patch5: PR28-05-Improve-logging-in-status-code-extraction.patch +Patch9000: modify-the-URL-format-of-the-test-case.patch %description Requests-FTP is an implementation of a very stupid FTP transport adapter @@ -41,6 +42,9 @@ rm -rf requests_ftp.egg-info %install %py3_install +%check +PYCDLIB_TRACK_WRITES=1 py.test-%{python3_version} -v tests + %files -n python3-%{srcname} %defattr(-,root,root) %license LICENSE @@ -51,6 +55,9 @@ rm -rf requests_ftp.egg-info %doc README.rst %changelog +* Tue Sep 19 2023 zhangpan - 0.3.1-19 +- enable make check + * Wed Oct 26 2022 zhouwenpei - 0.3.1-18 - Rebuild for next release