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

Unified 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, 5 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 side-by-side diff with in-line comments
Download patch
Index: appengine/findit/waterfall/test/process_base_swarming_task_result_pipeline_test.py
diff --git a/appengine/findit/waterfall/test/process_base_swarming_task_result_pipeline_test.py b/appengine/findit/waterfall/test/process_base_swarming_task_result_pipeline_test.py
new file mode 100644
index 0000000000000000000000000000000000000000..f06865fe0d4b44e9b637f10efa0b5294b23c6ab9
--- /dev/null
+++ b/appengine/findit/waterfall/test/process_base_swarming_task_result_pipeline_test.py
@@ -0,0 +1,36 @@
+import datetime
+
+from waterfall.test import wf_testcase
+from waterfall.process_base_swarming_task_result_pipeline import (
+ ProcessBaseSwarmingTaskResultPipeline)
+
+class ProcessBaseSwarmingTaskResultPipelineTest(wf_testcase.WaterfallTestCase):
+ def setUp(self):
+ super(ProcessBaseSwarmingTaskResultPipelineTest, self).setUp()
+ self.pipeline = ProcessBaseSwarmingTaskResultPipeline()
+ self.master_name = 'm'
+ self.builder_name = 'b'
+ self.build_number = 121
+ self.step_name = 'abc_tests on platform'
+ self.test_name = 'test'
+
+ def testConvertDateTime(self):
+ fmt = '%Y-%m-%dT%H:%M:%S.%f'
+ time_string = '2016-02-10T18:32:06.538220'
+ test_time = self.pipeline._ConvertDateTime(time_string)
+ time = datetime.datetime.strptime(time_string, fmt)
+ self.assertEqual(test_time, time)
+
+ def testConvertDateTimeNone(self):
+ time_string = ''
+ test_time = self.pipeline._ConvertDateTime(time_string)
+ self.assertIsNone(test_time)
+
+ def testConvertDateTimefailure(self):
+ time_string = 'abc'
+ try:
+ #pylint: disable=unused-variable
+ 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.
+ self.assertEqual(1,2) # pragma: no cover
+ except ValueError:
+ pass

Powered by Google App Engine
This is Rietveld 408576698