Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(761)

Unified Diff: pylibs/buildbot/test/test_web_status_json.py

Issue 809001: Rename a few variables and greatly reduce the amount of data sent for steps* events (Closed)
Patch Set: Rebase against trunk and fix the unit test again Created 10 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pylibs/buildbot/test/test_status_push.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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):
« no previous file with comments | « pylibs/buildbot/test/test_status_push.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698