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

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

Issue 1949763002: [Findit] Adding try job dashboard (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Fixing bug where fields are missing from data Created 4 years, 8 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/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
new file mode 100644
index 0000000000000000000000000000000000000000..4a1b99ef55d1033e0d6b3e8aa212f2c0281638ae
--- /dev/null
+++ b/appengine/findit/handlers/test/try_job_dashboard_test.py
@@ -0,0 +1,32 @@
+# Copyright 2016 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+from datetime import datetime
+import webapp2
+
+from handlers import try_job_dashboard
+
+from testing_utils import testing
chanli 2016/05/03 23:58:31 After recent change, I think you clould import co
lijeffrey 2016/05/04 20:20:17 Right now it seems that's not necessary since the
+
+
+class TryJobDashboardTest(testing.AppengineTestCase):
+ app_module = webapp2.WSGIApplication([
+ ('/try-job-dashboard', try_job_dashboard.TryJobDashboard),
+ ], debug=True)
+
+ def testRemoveMicrosecondsFromDelta(self):
+ date1 = datetime(2016, 5, 1, 1, 1, 1, 1)
+ date2 = datetime(2016, 5, 1, 1, 1, 1, 2)
+ delta = date2 - date1
+
+ self.assertEqual(
+ try_job_dashboard._RemoveMicrosecondsFromDelta(delta).microseconds,
+ 0)
+
+ def testRemoveMicrosecondsFromDatetime(self):
+ date = datetime(2016, 5, 1, 0, 0, 0, 12345)
+ self.assertEqual(
+ try_job_dashboard._RemoveMicrosecondsFromDatetime(date),
+ datetime(2016, 5, 1, 0, 0, 0, 0))
+ self.assertIsNone(try_job_dashboard._RemoveMicrosecondsFromDatetime(None))
« no previous file with comments | « no previous file | appengine/findit/handlers/try_job_dashboard.py » ('j') | appengine/findit/handlers/try_job_dashboard.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698