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

Unified Diff: appengine/swarming/test_env_handlers.py

Issue 2689483004: swarming: Add server-side implementation for supplemental bot_config (Closed)
Patch Set: rebase Created 3 years, 10 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
Index: appengine/swarming/test_env_handlers.py
diff --git a/appengine/swarming/test_env_handlers.py b/appengine/swarming/test_env_handlers.py
index ebbabdacb1175d3753a329b0a6eef7dce8dff346..cab5a5a2794b4a8109b3d0d64910ebc3e5429a95 100644
--- a/appengine/swarming/test_env_handlers.py
+++ b/appengine/swarming/test_env_handlers.py
@@ -141,7 +141,7 @@ class AppTestBase(test_case.TestCase):
# Bot
- def do_handshake(self, bot='bot1'):
+ def do_handshake(self, bot='bot1', status=200):
"""Performs bot handshake, returns data to be sent to bot handlers.
Also populates self.bot_version.
@@ -161,10 +161,16 @@ class AppTestBase(test_case.TestCase):
}
response = self.app.post_json(
'/swarming/api/v1/bot/handshake',
- params=params).json
+ params=params, status=status)
+ if status != 200:
+ return
+ response = response.json
self.bot_version = response['bot_version']
params['version'] = self.bot_version
params['state']['bot_group_cfg_version'] = response['bot_group_cfg_version']
+ # A bit hackish but fine for unit testing purpose.
+ if response.get('bot_config'):
+ params['bot_config'] = response['bot_config']
return params
def bot_poll(self, bot='bot1'):

Powered by Google App Engine
This is Rietveld 408576698