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

Unified Diff: appengine/findit/handlers/test/try_job_dashboard_test.py

Issue 2035793004: [Findit] Updating try job dashboard to display in queue and execution times (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Fixing unit tests 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | appengine/findit/handlers/try_job_dashboard.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/findit/handlers/test/try_job_dashboard_test.py
diff --git a/appengine/findit/handlers/test/try_job_dashboard_test.py b/appengine/findit/handlers/test/try_job_dashboard_test.py
index 7fff56c82bd7be8ddaa98ddbbd142e381a255d09..00c9bf21414b429f202e28c3dd3c606475e4d3ea 100644
--- a/appengine/findit/handlers/test/try_job_dashboard_test.py
+++ b/appengine/findit/handlers/test/try_job_dashboard_test.py
@@ -43,8 +43,21 @@ class TryJobDashboardTest(testing.AppengineTestCase):
try_job_dashboard._RemoveMicrosecondsFromDelta(delta).microseconds,
0)
+ def testFormatDuration(self):
+ self.assertEqual(try_job_dashboard._FormatDuration(None, None),
+ try_job_dashboard.NOT_AVAILABLE)
+ self.assertEqual(
+ try_job_dashboard._FormatDuration(datetime(2016, 1, 2, 1, 2, 3), None),
+ try_job_dashboard.NOT_AVAILABLE)
+ self.assertEqual(
+ try_job_dashboard._FormatDuration(None, datetime(2016, 1, 2, 1, 2, 3)),
+ try_job_dashboard.NOT_AVAILABLE)
+ self.assertEqual(
+ try_job_dashboard._FormatDuration(datetime(2016, 1, 2, 1, 2, 3),
+ datetime(2016, 1, 2, 1, 2, 4)),
+ '00:00:01')
+
def testFormatTimedelta(self):
- self.assertIsNone(try_job_dashboard._FormatTimedelta(None))
self.assertEqual(try_job_dashboard._FormatTimedelta(timedelta(0, 1)),
'00:00:01')
self.assertEqual(try_job_dashboard._FormatTimedelta(timedelta(0, 60)),
@@ -107,7 +120,6 @@ class TryJobDashboardTest(testing.AppengineTestCase):
'builder_name': 'b',
'build_number': 1,
'try_job_type': 'compile',
- 'start_time': '2016-05-04 00:00:01 UTC',
'request_time': '2016-05-04 00:00:00 UTC',
'try_job_url': 'url1',
'status': 'running'
@@ -118,9 +130,7 @@ class TryJobDashboardTest(testing.AppengineTestCase):
'builder_name': 'b',
'build_number': 2,
'try_job_type': 'compile',
- 'start_time': '2016-05-04 00:00:01 UTC',
'request_time': '2016-05-04 00:00:00 UTC',
- 'end_time': '2016-05-04 00:00:02 UTC',
'try_job_url': 'url2',
'error': 'some error',
}
@@ -130,9 +140,7 @@ class TryJobDashboardTest(testing.AppengineTestCase):
'builder_name': 'b',
'build_number': 3,
'try_job_type': 'compile',
- 'start_time': '2016-05-04 00:00:01 UTC',
'request_time': '2016-05-04 00:00:00 UTC',
- 'end_time': '2016-05-04 00:00:02 UTC',
'try_job_url': 'url3',
'culprit_found': True
}
« no previous file with comments | « no previous file | appengine/findit/handlers/try_job_dashboard.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698