mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-19 13:07:56 +00:00
Tests for ref #1592.
This commit is contained in:
parent
4618571389
commit
531f562fcf
@ -42,6 +42,9 @@ unknown_rwcap = u"lafs://from_the_future_rw_\u263A".encode('utf-8')
|
||||
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': {}}
|
||||
@ -500,6 +503,7 @@ class Web(WebMixin, WebErrorMixin, testutil.StallMixin, testutil.ReallyEqualMixi
|
||||
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")
|
||||
@ -512,6 +516,7 @@ class Web(WebMixin, WebErrorMixin, testutil.StallMixin, testutil.ReallyEqualMixi
|
||||
d = self.GET("/provisioning/")
|
||||
def _check(res):
|
||||
self.failUnlessIn('Provisioning Tool', res)
|
||||
self.failUnlessIn(FAVICON_MARKUP, res)
|
||||
|
||||
fields = {'filled': True,
|
||||
"num_users": int(50e3),
|
||||
@ -531,6 +536,7 @@ class Web(WebMixin, WebErrorMixin, testutil.StallMixin, testutil.ReallyEqualMixi
|
||||
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,
|
||||
@ -1295,6 +1301,8 @@ class Web(WebMixin, WebErrorMixin, testutil.StallMixin, testutil.ReallyEqualMixi
|
||||
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):
|
||||
@ -1454,6 +1462,7 @@ class Web(WebMixin, WebErrorMixin, testutil.StallMixin, testutil.ReallyEqualMixi
|
||||
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
|
||||
@ -2614,6 +2623,7 @@ class Web(WebMixin, WebErrorMixin, testutil.StallMixin, testutil.ReallyEqualMixi
|
||||
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:
|
||||
@ -2668,6 +2678,8 @@ class Web(WebMixin, WebErrorMixin, testutil.StallMixin, testutil.ReallyEqualMixi
|
||||
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
|
||||
|
||||
@ -3360,6 +3372,7 @@ class Web(WebMixin, WebErrorMixin, testutil.StallMixin, testutil.ReallyEqualMixi
|
||||
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
|
||||
|
||||
@ -3865,7 +3878,8 @@ class Web(WebMixin, WebErrorMixin, testutil.StallMixin, testutil.ReallyEqualMixi
|
||||
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
|
||||
|
||||
@ -4006,6 +4020,7 @@ class Grid(GridTestMixin, WebErrorMixin, ShouldFailMixin, testutil.ReallyEqualMi
|
||||
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):
|
||||
@ -4146,6 +4161,7 @@ class Grid(GridTestMixin, WebErrorMixin, ShouldFailMixin, testutil.ReallyEqualMi
|
||||
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")
|
||||
|
Loading…
Reference in New Issue
Block a user