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

Side by Side Diff: appengine/findit/waterfall/test/process_base_swarming_task_result_pipeline_test.py

Issue 2130543004: Waterfall components of regression range finder. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: addressed comments Created 4 years, 4 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 import datetime
2
3 from waterfall.test import wf_testcase
4 from waterfall.process_base_swarming_task_result_pipeline import (
5 ProcessBaseSwarmingTaskResultPipeline)
6
7 class ProcessBaseSwarmingTaskResultPipelineTest(wf_testcase.WaterfallTestCase):
8 def setUp(self):
9 super(ProcessBaseSwarmingTaskResultPipelineTest, self).setUp()
10 self.pipeline = ProcessBaseSwarmingTaskResultPipeline()
11 self.master_name = 'm'
12 self.builder_name = 'b'
13 self.build_number = 121
14 self.step_name = 'abc_tests on platform'
15 self.test_name = 'test'
16
17 def testConvertDateTime(self):
18 fmt = '%Y-%m-%dT%H:%M:%S.%f'
19 time_string = '2016-02-10T18:32:06.538220'
20 test_time = self.pipeline._ConvertDateTime(time_string)
21 time = datetime.datetime.strptime(time_string, fmt)
22 self.assertEqual(test_time, time)
23
24 def testConvertDateTimeNone(self):
25 time_string = ''
26 test_time = self.pipeline._ConvertDateTime(time_string)
27 self.assertIsNone(test_time)
28
29 def testConvertDateTimefailure(self):
30 time_string = 'abc'
31 try:
32 #pylint: disable=unused-variable
33 test_time = self.pipeline._ConvertDateTime(time_string)
lijeffrey 2016/07/29 05:18:39 ah you're trying to get a raises. There should be
caiw 2016/07/29 19:55:52 Done.
34 self.assertEqual(1,2) # pragma: no cover
35 except ValueError:
36 pass
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698