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 = '<link href="/icon.png" rel="shortcut icon" />'
+
+
class FakeStatsProvider:
def get_stats(self):
stats = {'stats': {}, 'counters': {}}
d = self.GET("/")
def _check(res):
self.failUnlessIn('Welcome To Tahoe-LAFS', res)
+ self.failUnlessIn(FAVICON_MARKUP, res)
self.s.basedir = 'web/test_welcome'
fileutil.make_dirs("web/test_welcome")
d = self.GET("/provisioning/")
def _check(res):
self.failUnlessIn('Provisioning Tool', res)
+ self.failUnlessIn(FAVICON_MARKUP, res)
fields = {'filled': True,
"num_users": int(50e3),
d.addCallback(_check)
def _check2(res):
self.failUnlessIn('Provisioning Tool', res)
+ self.failUnlessIn(FAVICON_MARKUP, res)
self.failUnlessIn("Share space consumed: 167.01TB", res)
fields = {'filled': True,
self.failUnlessIn('input checked="checked" type="radio" id="mkdir-sdmf" value="sdmf" name="format"', html)
self.failUnlessIn('input type="radio" id="mkdir-mdmf" value="mdmf" name="format"', html)
+ self.failUnlessIn(FAVICON_MARKUP, html)
+
def test_GET_DIRECTORY_html(self):
d = self.GET(self.public_url + "/foo", followRedirect=True)
def _check(html):
self.failUnlessIn("<td>sub</td>", manifest)
self.failUnlessIn(self._sub_uri, manifest)
self.failUnlessIn("<td>sub/baz.txt</td>", manifest)
+ self.failUnlessIn(FAVICON_MARKUP, manifest)
d.addCallback(_got_html)
# both t=status and unadorned GET should be identical
def _check_html(res):
self.failUnlessIn("Objects Checked: <span>10</span>", res)
self.failUnlessIn("Objects Healthy: <span>10</span>", res)
+ self.failUnlessIn(FAVICON_MARKUP, res)
d.addCallback(_check_html)
d.addCallback(lambda res:
self.failUnlessIn("Objects Healthy (after repair): <span>10</span>", res)
self.failUnlessIn("Objects Unhealthy (after repair): <span>0</span>", res)
self.failUnlessIn("Corrupt Shares (after repair): <span>0</span>", res)
+
+ self.failUnlessIn(FAVICON_MARKUP, res)
d.addCallback(_check_html)
return d
def _check(res):
self.failUnlessIn('name="when_done" value="."', res)
self.failUnless(re.search(r'name="from_name" value="bar\.txt"', res))
+ self.failUnlessIn(FAVICON_MARKUP, res)
d.addCallback(_check)
return d
def test_incident(self):
d = self.POST("/report_incident", details="eek")
def _done(res):
- self.failUnless("Thank you for your report!" in res, res)
+ self.failIfIn("<html>", res)
+ self.failUnlessIn("Thank you for your report!", res)
d.addCallback(_done)
return d
def _got_html_good(res):
self.failUnlessIn("Healthy", res)
self.failIfIn("Not Healthy", res)
+ self.failUnlessIn(FAVICON_MARKUP, res)
d.addCallback(_got_html_good)
d.addCallback(self.CHECK, "good", "t=check&return_to=somewhere")
def _got_html_good_return_to(res):
self.failUnlessIn("Healthy", res)
self.failIfIn("Not Healthy", res)
self.failUnlessIn("No repair necessary", res)
+ self.failUnlessIn(FAVICON_MARKUP, res)
d.addCallback(_got_html_good)
d.addCallback(self.CHECK, "sick", "t=check&repair=true")