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

Side by Side Diff: appengine/findit/handlers/test/culprit_test.py

Issue 2085513003: [Findit] Show the list of failed build cycles that a culprit is responsible for. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@group_same_failures
Patch Set: Add unittests. Created 4 years, 6 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 unified diff | Download patch
« no previous file with comments | « appengine/findit/handlers/culprit.py ('k') | appengine/findit/templates/waterfall/culprit.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # Copyright 2016 The Chromium 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 from datetime import datetime
6
7 import webapp2
8
9 from testing_utils import testing
10
11 from handlers import culprit
12 from model import analysis_status as status
13 from model.wf_culprit import WfCulprit
14
15
16 class CulpritTest(testing.AppengineTestCase):
17 app_module = webapp2.WSGIApplication(
18 [('/culprit', culprit.Culprit), ], debug=True)
19
20 def testGetCulpritSuccess(self):
21 wf_culprit = WfCulprit.Create('chromium', 'r1')
22 wf_culprit.builds.append(['m', 'b1', 1])
23 wf_culprit.builds.append(['m', 'b2', 2])
24 wf_culprit.cr_notification_status = status.COMPLETED
25 wf_culprit.cr_notification_time = datetime(2016, 06, 24, 10, 03, 00)
26 wf_culprit.put()
27
28 expected_result = {
29 'project_name': 'chromium',
30 'revision': 'r1',
31 'cr_notified': True,
32 'cr_notification_time': '2016-06-24 10:03:00 UTC',
33 'builds': [
34 {
35 'master_name': 'm',
36 'builder_name': 'b1',
37 'build_number': 1,
38 },
39 {
40 'master_name': 'm',
41 'builder_name': 'b2',
42 'build_number': 2,
43 },
44 ],
45 }
46
47 response = self.test_app.get(
48 '/culprit?key=%s&format=json' % wf_culprit.key.urlsafe())
49 self.assertEqual(200, response.status_int)
50 self.assertEqual(expected_result, response.json_body)
OLDNEW
« no previous file with comments | « appengine/findit/handlers/culprit.py ('k') | appengine/findit/templates/waterfall/culprit.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698