Use BeautifulSoup to check favicon in storage page

This commit is contained in:
Sajith Sasidharan 2020-02-14 10:10:48 -05:00 committed by Sajith Sasidharan
parent 56e2fa3f24
commit 1469af0f3b
1 changed files with 3 additions and 2 deletions

View File

@ -954,8 +954,9 @@ class Web(WebMixin, WebErrorMixin, testutil.StallMixin, testutil.ReallyEqualMixi
def test_storage(self): def test_storage(self):
d = self.GET("/storage") d = self.GET("/storage")
def _check(res): def _check(res):
self.failUnlessIn('Storage Server Status', res) soup = BeautifulSoup(res, 'html5lib')
self.failUnlessIn(FAVICON_MARKUP, res) assert_soup_has_text(self, soup, 'Storage Server Status')
assert_soup_has_favicon(self, soup)
res_u = res.decode('utf-8') res_u = res.decode('utf-8')
self.failUnlessIn(u'<li>Server Nickname: <span class="nickname mine">fake_nickname \u263A</span></li>', res_u) self.failUnlessIn(u'<li>Server Nickname: <span class="nickname mine">fake_nickname \u263A</span></li>', res_u)
d.addCallback(_check) d.addCallback(_check)