Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(164152)

Unified Diff: Lib/test/test_httpservers.py

Issue 23670: Modifications to support iOS as a development platform
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Lib/test/test_gdb.py ('k') | Lib/test/test_import/__init__.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Lib/test/test_httpservers.py Tue Mar 01 10:26:10 2016 +0200
+++ b/Lib/test/test_httpservers.py Wed Mar 02 00:01:35 2016 +0000
@@ -11,16 +11,17 @@ from http import server, HTTPStatus
import os
import sys
import re
import base64
import shutil
import urllib.parse
import html
import http.client
+import subprocess
import tempfile
from io import BytesIO
import unittest
from test import support
threading = support.import_module('threading')
class NoLogRequestHandler:
@@ -326,17 +327,17 @@ class SimpleHTTPServerTestCase(BaseTestC
@unittest.skipUnless(support.TESTFN_UNDECODABLE,
'need support.TESTFN_UNDECODABLE')
def test_undecodable_filename(self):
enc = sys.getfilesystemencoding()
filename = os.fsdecode(support.TESTFN_UNDECODABLE) + '.txt'
with open(os.path.join(self.tempdir, filename), 'wb') as f:
f.write(support.TESTFN_UNDECODABLE)
response = self.request(self.tempdir_name + '/')
- if sys.platform == 'darwin':
+ if sys.platform in ('darwin', 'ios'):
# On Mac OS the HFS+ filesystem replaces bytes that aren't valid
# UTF-8 into a percent-encoded value.
for name in os.listdir(self.tempdir):
if name != 'test': # Ignore a filename created in setUp().
filename = name
break
body = self.check_status_and_reason(response, HTTPStatus.OK)
quotedname = urllib.parse.quote(filename, errors='surrogatepass')
@@ -433,16 +434,17 @@ print("Content-type: text/html")
print()
print(os.environ["%s"])
"""
@unittest.skipIf(hasattr(os, 'geteuid') and os.geteuid() == 0,
"This test can't be run reliably as root (issue #13308).")
+@unittest.skipUnless(hasattr(subprocess, 'Popen'), "test requires subprocess.Popen()")
class CGIHTTPServerTestCase(BaseTestCase):
class request_handler(NoLogRequestHandler, CGIHTTPRequestHandler):
pass
linesep = os.linesep.encode('ascii')
def setUp(self):
BaseTestCase.setUp(self)
« no previous file with comments | « Lib/test/test_gdb.py ('k') | Lib/test/test_import/__init__.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+