Commit 14862eda authored by Vladimir Bashkirtsev's avatar Vladimir Bashkirtsev

Fixed urllib2 tests

parent 58b0fe6e
all:
tar xf Python-3.9.5.tar.xz
patch -Np1 -d Python-3.9.5 < Python-3.9.5-fix_test.patch
cd Python-3.9.5 && ./configure --build=$(CLFS_TARGET) --prefix=/usr --enable-shared --with-system-expat --with-system-ffi --with-ensurepip=yes --enable-optimizations
$(MAKE) -C Python-3.9.5
if [[ ! "$(BUILD_OPTIONS)" =~ no-tests ]] ; then \
......
diff -uNr Python-3.9.5/Lib/test/test_urllib2.py Python-3.9.5-fix_test/Lib/test/test_urllib2.py
--- Python-3.9.5/Lib/test/test_urllib2.py 2021-05-04 00:54:42.000000000 +1000
+++ Python-3.9.5-fix_test/Lib/test/test_urllib2.py 2024-09-20 00:00:33.023735408 +1000
@@ -1786,22 +1786,6 @@
self.opener_has_handler(o, MyHTTPHandler)
self.opener_has_handler(o, MyOtherHTTPHandler)
- @unittest.skipUnless(support.is_resource_enabled('network'),
- 'test requires network access')
- def test_issue16464(self):
- with socket_helper.transient_internet("http://www.example.com/"):
- opener = urllib.request.build_opener()
- request = urllib.request.Request("http://www.example.com/")
- self.assertEqual(None, request.data)
-
- opener.open(request, "1".encode("us-ascii"))
- self.assertEqual(b"1", request.data)
- self.assertEqual("1", request.get_header("Content-length"))
-
- opener.open(request, "1234567890".encode("us-ascii"))
- self.assertEqual(b"1234567890", request.data)
- self.assertEqual("10", request.get_header("Content-length"))
-
def test_HTTPError_interface(self):
"""
Issue 13211 reveals that HTTPError didn't implement the URLError
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment