OLD | NEW |
1 # Copyright 2017 The Chromium Authors. All rights reserved. | 1 # Copyright 2017 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import json | 5 import json |
6 import unittest | 6 import unittest |
7 | 7 |
8 import webapp2 | 8 import webapp2 |
9 import webtest | 9 import webtest |
10 | 10 |
(...skipping 22 matching lines...) Expand all Loading... |
33 def tearDown(self): | 33 def tearDown(self): |
34 self.testbed.deactivate() | 34 self.testbed.deactivate() |
35 | 35 |
36 def testPost_ValidRequest(self): | 36 def testPost_ValidRequest(self): |
37 # Create job. | 37 # Create job. |
38 job = job_module.Job.New( | 38 job = job_module.Job.New( |
39 configuration='Mac', | 39 configuration='Mac', |
40 test_suite='suite', | 40 test_suite='suite', |
41 test='filter', | 41 test='filter', |
42 metric='metric', | 42 metric='metric', |
43 auto_explore=True) | 43 auto_explore=True, |
| 44 bug_id=None) |
44 job.put() | 45 job.put() |
45 | 46 |
46 data = json.loads(self.testapp.post('/jobs').body) | 47 data = json.loads(self.testapp.post('/jobs').body) |
47 | 48 |
48 self.assertEqual(1, data['jobs_count']) | 49 self.assertEqual(1, data['jobs_count']) |
49 self.assertEqual(1, len(data['jobs_list'])) | 50 self.assertEqual(1, len(data['jobs_list'])) |
50 self.assertEqual(job.AsDict(), data['jobs_list'][0]) | 51 self.assertEqual(job.AsDict(), data['jobs_list'][0]) |
OLD | NEW |