blob: 31e8be86ea2f5060e64ac551143b4e89a5e549f0 [file] [log] [blame]
Xixuan Wu865fa282017-09-05 15:23:19 -07001# Copyright 2017 The Chromium OS Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5"""Module for tests for handlers."""
6
Craig Bergstrom3212fb42018-04-17 19:24:15 -06007import config_reader
8import file_getter
Xixuan Wu865fa282017-09-05 15:23:19 -07009import swarming_lib
10
11import webapp2
12
13
14class TestSwarmingAPI(webapp2.RequestHandler):
15
16 def get(self):
Craig Bergstrom3212fb42018-04-17 19:24:15 -060017 lab_config = config_reader.LabConfig(config_reader.ConfigReader(
18 file_getter.LAB_CONFIG_FILE))
19 afe_server = lab_config.get_dedicated_afe()
Xixuan Wu5d700dc2018-08-21 15:13:10 -070020 swarming_runner = swarming_lib.SwarmingRunner(
21 afe_server,
22 swarming_lib.CHROME_STAGING_SWARMING_SERVER)
Xixuan Wu865fa282017-09-05 15:23:19 -070023 response = swarming_runner.dummy_run()
24 swarming_task_info = swarming_runner.query_task(response['task_id'])
25 self.response.write(swarming_task_info.name)
26
27
28app = webapp2.WSGIApplication([
29 ('/test_push/swarming', TestSwarmingAPI),
30 ], debug=True)