Skip to content

Commit 26c83a5

Browse files
committed
All functional tests pass on py3
1 parent 95b30da commit 26c83a5

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

test-tools/twisted-localserver.py

+4-10
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
from twisted.cred import checkers, portal
2222
from twisted.internet import reactor
2323
from twisted.python import log
24-
from twisted.web import http, resource, server, twcgi
24+
from twisted.web import http, resource, server
2525
from twisted.web.guard import (BasicCredentialFactory, DigestCredentialFactory,
2626
HTTPAuthSessionWrapper)
2727
from twisted.web.resource import IResource, EncodingResourceWrapper
@@ -227,17 +227,11 @@ def make_leaf_page(parent, name, text,
227227

228228
def make_redirect(parent, name, location_relative_ref):
229229
redirect = Redirect(location_relative_ref)
230+
name = name.encode('utf-8')
230231
parent.putChild(name, redirect)
231232
return redirect
232233

233234

234-
def make_cgi_script(parent, name, path, interpreter=sys.executable):
235-
cgi_script = twcgi.FilteredScript(path)
236-
cgi_script.filter = interpreter
237-
parent.putChild(name, cgi_script)
238-
return cgi_script
239-
240-
241235
def require_basic_auth(resource):
242236
p = portal.Portal(TestAuthRealm())
243237
c = checkers.InMemoryUsernamePasswordDatabaseDontUse(john=b'john')
@@ -290,8 +284,8 @@ def main(argv):
290284
make_leaf_page(test_fixtures, "referertest.html", REFERER_TEST_HTML)
291285
make_leaf_page(test_fixtures, "mechanize_reload_test.html",
292286
RELOAD_TEST_HTML)
293-
make_redirect(root, "redirected", "/doesnotexist")
294-
make_redirect(root, "redirected_good", "/test_fixtures")
287+
make_redirect(root, "redirected", b"/doesnotexist")
288+
make_redirect(root, "redirected_good", b"/test_fixtures")
295289
example_html = open(os.path.join(
296290
"examples", "forms", "example.html")).read()
297291
make_leaf_page(mechanize, "example.html", example_html)

0 commit comments

Comments
 (0)