From: Brian Warner Date: Sat, 19 Jul 2008 01:58:57 +0000 (-0700) Subject: test_web: test that save=true filename=unicode doesn't crash X-Git-Url: https://git.rkrishnan.org/pf/content/en/frontends/flags?a=commitdiff_plain;h=edec917060181ce934d5acfa5eb15648f15775e0;p=tahoe-lafs%2Ftahoe-lafs.git test_web: test that save=true filename=unicode doesn't crash --- diff --git a/src/allmydata/test/test_web.py b/src/allmydata/test/test_web.py index 99095a86..da1b5ec8 100644 --- a/src/allmydata/test/test_web.py +++ b/src/allmydata/test/test_web.py @@ -220,6 +220,7 @@ class WebMixin(object): self._bar_txt_uri) def GET(self, urlpath, followRedirect=False): + assert not isinstance(urlpath, unicode) url = self.webish_url + urlpath return client.getPage(url, method="GET", followRedirect=followRedirect) @@ -508,6 +509,14 @@ class Web(WebMixin, unittest.TestCase): d.addCallback(self.failUnlessIsBarDotTxt) d.addCallback(lambda res: self.GET(base2 + "/@@name=/blah.txt")) d.addCallback(self.failUnlessIsBarDotTxt) + save_url = base + "?save=true&filename=blah.txt" + d.addCallback(lambda res: self.GET(save_url)) + d.addCallback(self.failUnlessIsBarDotTxt) # TODO: check headers + u_filename = u"n\u00e9wer.txt" # n e-acute w e r . t x t + u_fn_e = urllib.quote(u_filename.encode("utf-8")) + u_url = base + "?save=true&filename=" + u_fn_e + d.addCallback(lambda res: self.GET(u_url)) + d.addCallback(self.failUnlessIsBarDotTxt) # TODO: check headers return d def test_PUT_FILEURL_named_bad(self):