Chromium Code Reviews| 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)) |