blob: 20ff697dfe1ad4939d22925ca45a47f85bd24602 [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()
20 swarming_runner = swarming_lib.SwarmingRunner(afe_server)
Xixuan Wu865fa282017-09-05 15:23:19 -070021 response = swarming_runner.dummy_run()
22 swarming_task_info = swarming_runner.query_task(response['task_id'])
23 self.response.write(swarming_task_info.name)
24
25
26app = webapp2.WSGIApplication([
27 ('/test_push/swarming', TestSwarmingAPI),
28 ], debug=True)