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

Side by Side Diff: appengine/chromium_cq_status/handlers/test/builder_timeline_data_test.py

Issue 2056663002: Removed timeline code (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: 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
OLDNEW
(Empty)
1 # Copyright 2015 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 import os
6 import json
7 import main
8
9 from third_party.testing_utils import testing
10 from handlers.builder_timeline_data import create_events
11
12 class BuilderTimelineDataTest(testing.AppengineTestCase):
13 app_module = main.app
14
15 def test_simple_data(self):
16 data = load_json('builder_simple.json')
17 master = 'tryserver'
18 builder = 'test builder'
19 buildId = 1
20 attempt_string = 'Attempt 1'
21 events = create_events(data, master, builder, buildId, attempt_string)
22 bCount = 0
23 eCount = 0
24 for event in events:
25 self.assertEqual(master, event.cat)
26 self.assertEqual(builder, event.tid)
27 self.assertEqual(attempt_string, event.pid)
28 self.assertEqual(buildId, event.args['id'])
29 if event.ph == 'B':
30 bCount += 1
31 if event.ph == 'E':
32 eCount += 1
33 self.assertEqual(bCount, eCount)
34
35 def load_json(filename):
36 path = os.path.join(os.path.dirname(__file__), 'resources', filename)
37 return json.loads(open(path).read())
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698