mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-30 01:38:55 +00:00
just delete test_welcome
This commit is contained in:
parent
b44980ca01
commit
fdb3399edb
@ -845,97 +845,6 @@ class Web(WebMixin, WebErrorMixin, testutil.StallMixin, testutil.ReallyEqualMixi
|
||||
d.addCallback(_check)
|
||||
return d
|
||||
|
||||
@inlineCallbacks
|
||||
def test_welcome(self):
|
||||
data = yield self.GET("/")
|
||||
soup = BeautifulSoup(data, 'html5lib')
|
||||
assert_soup_has_favicon(self, soup)
|
||||
assert_soup_has_tag_with_content(self, soup, u"title", u"Tahoe-LAFS - Welcome")
|
||||
assert_soup_has_tag_with_attributes_and_content(
|
||||
self, soup, u"a",
|
||||
u"Recent and Active Operations",
|
||||
{u"href": u"status"},
|
||||
)
|
||||
assert_soup_has_tag_with_attributes_and_content(
|
||||
self, soup, u"a",
|
||||
u"Operational Statistics",
|
||||
{u"href": u"statistics"},
|
||||
)
|
||||
assert_soup_has_tag_with_attributes(
|
||||
self, soup, u"input",
|
||||
{u"type": u"hidden", u"name": u"t", u"value": u"report-incident"},
|
||||
)
|
||||
assert_soup_has_tag_with_content(self, soup, u"td", u"fake_nickname \u263A")
|
||||
assert_soup_has_tag_with_attributes_and_content(
|
||||
self, soup, u"div",
|
||||
u"other_nickname \u263B",
|
||||
{u"class": u"nickname"},
|
||||
)
|
||||
assert_soup_has_tag_with_content(
|
||||
self, soup, u"h2",
|
||||
u"Connected to 1 of 2 known storage servers"
|
||||
)
|
||||
divs = soup.find_all(u"div")
|
||||
found_status = False
|
||||
for div in divs:
|
||||
if u"status-indicator" in div.attrs.get(u"class", []):
|
||||
imgs = div.find_all(u"img")
|
||||
if imgs and imgs[0].attrs.get(u"src", u"") == u"img/connected-yes.png":
|
||||
found_status = True
|
||||
sib = div.find_next_siblings()[0]
|
||||
self.assertIn(u"nickname", sib.attrs[u"class"])
|
||||
self.assertIn(u"other_nickname \u263B", sib.contents)
|
||||
self.assertTrue(found_status, "no status-indicator found")
|
||||
|
||||
if self.have_working_tzset():
|
||||
assert_soup_has_tag_with_attributes_and_content(
|
||||
self, soup, u"a",
|
||||
u"1d\u00A00h\u00A00m\u00A050s",
|
||||
{u"class": u"timestamp", u"title": u"1970-01-01 13:00:10" }
|
||||
)
|
||||
|
||||
found_status = False
|
||||
for div in divs:
|
||||
if u"status-indicator" in div.attrs.get(u"class", []):
|
||||
imgs = div.find_all(u"img")
|
||||
if imgs and imgs[0].attrs.get(u"src", u"") == u"img/connected-no.png" and imgs[0].attrs.get(u"alt", u"") == u"Disconnected":
|
||||
# since we don't connect to any introducer, we
|
||||
# find that one first .. but we want to look for
|
||||
# the disconnected storage node..
|
||||
sib = div.find_next_siblings()[0]
|
||||
if u"No introducers connected" in sib.contents:
|
||||
continue
|
||||
found_status = True
|
||||
self.assertIn(u"nickname", sib.attrs.get(u"class", []))
|
||||
self.assertIn(u"disconnected_nickname \u263B", sib.contents)
|
||||
self.assertTrue(found_status, "no status-indicator found")
|
||||
|
||||
|
||||
assert_soup_has_tag_with_attributes_and_content(
|
||||
self, soup, u"a",
|
||||
u"N/A",
|
||||
{u"class": u"timestamp", u"title": u"N/A"},
|
||||
)
|
||||
stamps = []
|
||||
timestamps = []
|
||||
for t in soup.find_all(u"td"):
|
||||
if u"service-last-received-data" in t.attrs.get(u"class", []):
|
||||
a = t.find_all(u"a")
|
||||
stamps.append(a[0].contents[0])
|
||||
timestamps.append(a[0].attrs.get(u"title", u""))
|
||||
self.assertIn(u"1d\u00A00h\u00A00m\u00A030s", stamps)
|
||||
self.assertIn(u"1d\u00A00h\u00A00m\u00A025s", stamps) # huh? should be 35s .. i think?
|
||||
self.assertIn(u'1970-01-01 13:00:30', timestamps)
|
||||
self.assertIn(u'1970-01-01 13:00:35', timestamps)
|
||||
|
||||
assert_soup_has_tag_with_content(self, soup, u"h3", u"Available")
|
||||
assert_soup_has_text(self, soup, u"123.5kB")
|
||||
|
||||
# wait, WTF? why is this in a TEST?
|
||||
self.s.basedir = 'web/test_welcome'
|
||||
fileutil.make_dirs("web/test_welcome")
|
||||
fileutil.make_dirs("web/test_welcome/private")
|
||||
|
||||
def test_introducer_status(self):
|
||||
class MockIntroducerClient(object):
|
||||
def __init__(self, connected):
|
||||
|
Loading…
Reference in New Issue
Block a user