From: Leif Ryge Date: Sat, 27 Apr 2013 08:49:07 +0000 (+0000) Subject: make tests pass with redesigned directory pages X-Git-Tag: allmydata-tahoe-1.10.1a1~151^2~2 X-Git-Url: https://git.rkrishnan.org/COPYING.TGPPL.html?a=commitdiff_plain;h=61395328c38573f6250b9aba70ae4b020c391e26;p=tahoe-lafs%2Ftahoe-lafs.git make tests pass with redesigned directory pages --- diff --git a/src/allmydata/test/test_web.py b/src/allmydata/test/test_web.py index 077ea028..66e7fd15 100644 --- a/src/allmydata/test/test_web.py +++ b/src/allmydata/test/test_web.py @@ -50,7 +50,7 @@ unknown_rocap = u"ro.lafs://readonly_from_the_future_ro_\u263A".encode('utf-8') unknown_immcap = u"imm.lafs://immutable_from_the_future_imm_\u263A".encode('utf-8') FAVICON_MARKUP = '' - +DIR_HTML_TAG = '' class FakeStatsProvider: def get_stats(self): @@ -1522,7 +1522,7 @@ class Web(WebMixin, WebErrorMixin, testutil.StallMixin, testutil.ReallyEqualMixi def test_GET_DIRECTORY_html(self): d = self.GET(self.public_url + "/foo", followRedirect=True) def _check(html): - self.failUnlessIn('
Return to Welcome page
', html) + self.failUnlessIn('
  • Return to Welcome page
  • ', html) self._check_upload_and_mkdir_forms(html) self.failUnlessIn("quux", html) d.addCallback(_check) @@ -5590,7 +5590,7 @@ class Grid(GridTestMixin, WebErrorMixin, ShouldFailMixin, testutil.ReallyEqualMi d.addCallback(lambda ignored: self.GET(self.fileurls["dir-0share"])) def _check_0shares_dir_html(body): - self.failUnlessIn("", body) + self.failUnlessIn(DIR_HTML_TAG, body) # we should see the regular page, but without the child table or # the dirops forms body = " ".join(body.strip().split()) @@ -5613,7 +5613,7 @@ class Grid(GridTestMixin, WebErrorMixin, ShouldFailMixin, testutil.ReallyEqualMi # and some-shares like we did for immutable files (since there # are different sorts of advice to offer in each case). For now, # they present the same way. - self.failUnlessIn("", body) + self.failUnlessIn(DIR_HTML_TAG, body) body = " ".join(body.strip().split()) self.failUnlessIn('href="?t=info">More info on this directory', body) @@ -5740,7 +5740,7 @@ class Grid(GridTestMixin, WebErrorMixin, ShouldFailMixin, testutil.ReallyEqualMi d.addCallback(_stash_dir) d.addCallback(lambda ign: self.GET(self.dir_url, followRedirect=True)) def _check_dir_html(body): - self.failUnlessIn("", body) + self.failUnlessIn(DIR_HTML_TAG, body) self.failUnlessIn("blacklisted.txt", body) d.addCallback(_check_dir_html) d.addCallback(lambda ign: self.GET(self.url)) @@ -5764,7 +5764,7 @@ class Grid(GridTestMixin, WebErrorMixin, ShouldFailMixin, testutil.ReallyEqualMi # We should still be able to list the parent directory, in HTML... d.addCallback(lambda ign: self.GET(self.dir_url, followRedirect=True)) def _check_dir_html2(body): - self.failUnlessIn("", body) + self.failUnlessIn(DIR_HTML_TAG, body) self.failUnlessIn("blacklisted.txt", body) d.addCallback(_check_dir_html2) @@ -5815,7 +5815,7 @@ class Grid(GridTestMixin, WebErrorMixin, ShouldFailMixin, testutil.ReallyEqualMi self.child_url = "uri/"+dn.get_readonly_uri()+"/child" d.addCallback(_get_dircap) d.addCallback(lambda ign: self.GET(self.dir_url_base, followRedirect=True)) - d.addCallback(lambda body: self.failUnlessIn("", body)) + d.addCallback(lambda body: self.failUnlessIn(DIR_HTML_TAG, body)) d.addCallback(lambda ign: self.GET(self.dir_url_json1)) d.addCallback(lambda res: simplejson.loads(res)) # just check it decodes d.addCallback(lambda ign: self.GET(self.dir_url_json2))