fix bug due to vim stripping regex being wrong

This commit is contained in:
Damien Churchill 2011-04-20 18:37:39 +01:00
commit d18becc861

View file

@ -17,7 +17,7 @@ import common
rpath = common.rpath rpath = common.rpath
class TestRedirectResource(Resource): class TestRedirectResource(Resource):
def render(self, request): def render(self, request):
request.redirect("http://localhost:51242/") request.redirect("http://localhost:51242/")
@ -26,7 +26,7 @@ class TestRenameResource(Resource):
def render(self, request): def render(self, request):
filename = request.args.get("filename", ["renamed_file"])[0] filename = request.args.get("filename", ["renamed_file"])[0]
request.setHeader("Content-Type", "text/plain") request.setHeader("Content-Type", "text/plain")
request.setHeader("Content-Disposition", "attachment; filename=" request.setHeader("Content-Disposition", "attachment; filename=" +
filename) filename)
return "This file should be called " + filename return "This file should be called " + filename
@ -107,14 +107,14 @@ class DownloadFileTestCase(unittest.TestCase):
return d return d
def test_download_without_required_cookies(self): def test_download_without_required_cookies(self):
url = "http://localhost:51242/cookie" url = "http://localhost:51242/cookie"
d = download_file(url, "none") d = download_file(url, "none")
d.addCallback(self.fail) d.addCallback(self.fail)
d.addErrback(self.assertIsInstance, Failure) d.addErrback(self.assertIsInstance, Failure)
return d return d
def test_download_with_required_cookies(self): def test_download_with_required_cookies(self):
url = "http://localhost:51242/cookie" url = "http://localhost:51242/cookie"
cookie = { "cookie" : "password=deluge" } cookie = { "cookie" : "password=deluge" }
d = download_file(url, "monster", headers=cookie) d = download_file(url, "monster", headers=cookie)
d.addCallback(self.assertEqual, "monster") d.addCallback(self.assertEqual, "monster")
@ -150,13 +150,13 @@ class DownloadFileTestCase(unittest.TestCase):
return d return d
def test_download_with_gzip_encoding(self): def test_download_with_gzip_encoding(self):
url = "http://localhost:51242/gzip?msg=success" url = "http://localhost:51242/gzip?msg=success"
d = download_file(url, "gzip_encoded") d = download_file(url, "gzip_encoded")
d.addCallback(self.assertContains, "success") d.addCallback(self.assertContains, "success")
return d return d
def test_download_with_gzip_encoding_disabled(self): def test_download_with_gzip_encoding_disabled(self):
url = "http://localhost:51242/gzip?msg=fail" url = "http://localhost:51242/gzip?msg=fail"
d = download_file(url, "gzip_encoded", allow_compression=False) d = download_file(url, "gzip_encoded", allow_compression=False)
d.addCallback(self.failIfContains, "fail") d.addCallback(self.failIfContains, "fail")
return d return d