mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-01-03 03:36:44 +00:00
Add basic unit test for json welcome page
This commit is contained in:
parent
876a7b6602
commit
ecb6651926
@ -184,10 +184,15 @@ class FakeDisplayableServer(StubServer):
|
||||
self.last_loss_time = last_loss_time
|
||||
self.last_rx_time = last_rx_time
|
||||
self.last_connect_time = last_connect_time
|
||||
self.rref = None
|
||||
def on_status_changed(self, cb): # TODO: try to remove me
|
||||
cb(self)
|
||||
def is_connected(self): # TODO: remove me
|
||||
return self.connected
|
||||
def get_version(self):
|
||||
return {
|
||||
"application-version": ""
|
||||
}
|
||||
def get_permutation_seed(self):
|
||||
return ""
|
||||
def get_announcement(self):
|
||||
@ -734,6 +739,15 @@ class Web(WebMixin, WebErrorMixin, testutil.StallMixin, testutil.ReallyEqualMixi
|
||||
def test_create(self):
|
||||
pass
|
||||
|
||||
def test_welcome_json(self):
|
||||
d = self.GET("/?t=json")
|
||||
def _check(res):
|
||||
decoded = simplejson.loads(res)
|
||||
self.failUnless("introducers" in decoded.keys())
|
||||
self.failUnless("servers" in decoded.keys())
|
||||
d.addCallback(_check)
|
||||
return d
|
||||
|
||||
def test_welcome(self):
|
||||
d = self.GET("/")
|
||||
def _check(res):
|
||||
|
Loading…
Reference in New Issue
Block a user