summaryrefslogtreecommitdiff
path: root/Lib/test/test_httpservers.py
diff options
context:
space:
mode:
authorHai Shi <shihai1992@gmail.com>2020-07-06 17:15:08 +0800
committerGitHub <noreply@github.com>2020-07-06 11:15:08 +0200
commita089d21df1ea502b995d8e8a3bcc937cce030802 (patch)
tree0ca48d704e4b63bd7090483a24879a09e1f911eb /Lib/test/test_httpservers.py
parent883bc638335a57a6e6a6344c2fc132c4f9a0ec42 (diff)
downloadcpython-git-a089d21df1ea502b995d8e8a3bcc937cce030802.tar.gz
bpo-40275: Use new test.support helper submodules in tests (GH-21315)
Diffstat (limited to 'Lib/test/test_httpservers.py')
-rw-r--r--Lib/test/test_httpservers.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/Lib/test/test_httpservers.py b/Lib/test/test_httpservers.py
index 71a0511e53..0c871afca3 100644
--- a/Lib/test/test_httpservers.py
+++ b/Lib/test/test_httpservers.py
@@ -30,6 +30,7 @@ from io import BytesIO
import unittest
from test import support
+from test.support import os_helper
from test.support import threading_helper
@@ -391,13 +392,13 @@ class SimpleHTTPServerTestCase(BaseTestCase):
'undecodable name cannot always be decoded on macOS')
@unittest.skipIf(sys.platform == 'win32',
'undecodable name cannot be decoded on win32')
- @unittest.skipUnless(support.TESTFN_UNDECODABLE,
- 'need support.TESTFN_UNDECODABLE')
+ @unittest.skipUnless(os_helper.TESTFN_UNDECODABLE,
+ 'need os_helper.TESTFN_UNDECODABLE')
def test_undecodable_filename(self):
enc = sys.getfilesystemencoding()
- filename = os.fsdecode(support.TESTFN_UNDECODABLE) + '.txt'
+ filename = os.fsdecode(os_helper.TESTFN_UNDECODABLE) + '.txt'
with open(os.path.join(self.tempdir, filename), 'wb') as f:
- f.write(support.TESTFN_UNDECODABLE)
+ f.write(os_helper.TESTFN_UNDECODABLE)
response = self.request(self.base_url + '/')
if sys.platform == 'darwin':
# On Mac OS the HFS+ filesystem replaces bytes that aren't valid
@@ -414,7 +415,7 @@ class SimpleHTTPServerTestCase(BaseTestCase):
.encode(enc, 'surrogateescape'), body)
response = self.request(self.base_url + '/' + quotedname)
self.check_status_and_reason(response, HTTPStatus.OK,
- data=support.TESTFN_UNDECODABLE)
+ data=os_helper.TESTFN_UNDECODABLE)
def test_get(self):
#constructs the path relative to the root directory of the HTTPServer