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

Side by Side Diff: appengine/findit/model/flake/test/flake_swarming_task_test.py

Issue 2345093002: [Findit] Extending versioned_model.py to support versioning multiple entities of the same class. (Closed)
Patch Set: Ignore this patch, uploaded unrelated change to wrong branch Created 4 years, 2 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
1 # Copyright 2016 The Chromium Authors. All rights reserved. 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 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 from datetime import datetime
6
5 import unittest 7 import unittest
6 8
7 from model.flake.flake_swarming_task import FlakeSwarmingTask 9 from model.flake.flake_swarming_task import FlakeSwarmingTask
8 10
9 11
10 class FlakeSwarmingTaskTest(unittest.TestCase): 12 class FlakeSwarmingTaskTest(unittest.TestCase):
11 13
12 def testStepTestName(self): 14 def testStepTestName(self):
13 task = FlakeSwarmingTask.Create('m', 'b', 121, 'browser_tests', 'test1') 15 task = FlakeSwarmingTask.Create('m', 'b', 121, 'browser_tests', 'test1')
14 self.assertEqual('browser_tests', task.step_name) 16 self.assertEqual('browser_tests', task.step_name)
15 self.assertEqual('test1', task.test_name) 17 self.assertEqual('test1', task.test_name)
18
19 def testResultsToDict(self):
20 build_number = 121
21 created_time = datetime(2016, 9, 26, 12, 0, 0, 000000)
22 started_time = datetime(2016, 9, 26, 12, 1, 0, 000000)
23 end_time = datetime(2016, 9, 26, 12, 2, 0, 000000)
24 tries = 100
25 successes = 100
26
27 task = FlakeSwarmingTask.Create(
28 'm', 'b', build_number, 'browser_tests', 'test1')
29 task.created_time = created_time
30 task.started_time = started_time
31 task.completed_time = end_time
32 task.tries = tries
33 task.successes = successes
34
35 expected_result_dict = {
36 'created_time': created_time,
37 'started_time': started_time,
38 'completed_time': end_time,
39 'build_number': build_number,
40 'number_of_iterations': tries,
41 'number_of_passes': successes
42 }
43
44 self.assertEqual(expected_result_dict, task.ResultsToDict())
OLDNEW
« no previous file with comments | « appengine/findit/model/flake/master_flake_analysis_data.py ('k') | appengine/findit/model/test/versioned_model_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698