Just make an assertion against the full value

This commit is contained in:
Jean-Paul Calderone 2017-07-25 08:29:52 -04:00
parent e3e49632a5
commit e339130e63

View File

@ -740,12 +740,26 @@ class Web(WebMixin, WebErrorMixin, testutil.StallMixin, testutil.ReallyEqualMixi
pass pass
def test_welcome_json(self): def test_welcome_json(self):
"""
There is a JSON version of the welcome page which can be selected with the
``t`` query argument.
"""
d = self.GET("/?t=json") d = self.GET("/?t=json")
def _check(res): def _check(res):
decoded = simplejson.loads(res) decoded = simplejson.loads(res)
self.assertIn("other_nodeid", decoded['servers']) expected = {
self.assertIn("introducers", decoded) 'introducers': {'statuses': []},
self.assertIn("servers", decoded) 'servers': {
'other_nodeid': {
'available_space': 123456,
'connection_status': 'summary',
'last_received_data': u'',
'nickname': u'other_nickname \u263b',
'version': '1.0',
},
},
}
self.assertEqual(expected, decoded)
d.addCallback(_check) d.addCallback(_check)
return d return d