Index: pylibs/buildbot/test/test_web_status_json.py |
diff --git a/pylibs/buildbot/test/test_web_status_json.py b/pylibs/buildbot/test/test_web_status_json.py |
index d51efded328a877c9e0a6b8bd961ffc9b0c47022..ad7aac27f8dbcd9d0849628dd5ff3c462289a7e2 100644 |
--- a/pylibs/buildbot/test/test_web_status_json.py |
+++ b/pylibs/buildbot/test/test_web_status_json.py |
@@ -50,6 +50,10 @@ BuildmasterConfig = c = { |
c['builders'] = [ |
BuilderConfig(name='builder1', slavename='bot1name', factory=BuildFactory()), |
] |
+c['slavePortnum'] = 0 |
+c['projectUrl'] = 'example.com/yay' |
+c['projectName'] = 'Pouet' |
+c['buildbotURL'] = 'build.example.com/yo' |
""" |
@@ -90,11 +94,42 @@ class TestStatusJson(unittest.TestCase): |
def testPresence(self): |
def _check(page): |
data = json.loads(page) |
- self.assertEqual(len(data), 4) |
- self.assertEqual(len(data['builders']), 1) |
- self.assertEqual(len(data['change_sources']), 1) |
- self.assertEqual(len(data['project']), 2) |
- self.assertEqual(len(data['slaves']), 1) |
+ EXPECTED = { |
+ 'builders': { |
+ 'builder1': { |
+ 'basedir': 'builder1', |
+ 'cachedBuilds': [], |
+ 'category': None, |
+ 'currentBuilds': [], |
+ 'pendingBuilds': [], |
+ 'slaves': ['bot1name'], |
+ 'state': 'offline' |
+ } |
+ }, |
+ 'change_sources': { |
+ '0': { |
+ 'description': 'PBChangeSource listener on all-purpose slaveport' |
+ } |
+ }, |
+ 'project': { |
+ 'buildbotURL': 'build.example.com/yo', |
+ 'projectName': 'Pouet', |
+ 'projectURL': None |
+ }, |
+ 'slaves': { |
+ 'bot1name': { |
+ 'access_uri': None, |
+ 'admin': None, |
+ 'builders': {u'builder1': []}, |
+ 'connected': False, |
+ 'host': None, |
+ 'name': u'bot1name', |
+ 'runningBuilds': [], |
+ 'version': None |
+ } |
+ } |
+ } |
+ self.assertEqual(EXPECTED, data) |
return self.getPage('/json', _check) |
def testHelp(self): |