Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 # Use of this source code is governed by a BSD-style license that can be | |
| 3 # found in the LICENSE file. | |
| 4 | |
| 5 from datetime import datetime | |
| 6 import webapp2 | |
| 7 | |
| 8 from handlers import try_job_dashboard | |
| 9 | |
| 10 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
| |
| 11 | |
| 12 | |
| 13 class TryJobDashboardTest(testing.AppengineTestCase): | |
| 14 app_module = webapp2.WSGIApplication([ | |
| 15 ('/try-job-dashboard', try_job_dashboard.TryJobDashboard), | |
| 16 ], debug=True) | |
| 17 | |
| 18 def testRemoveMicrosecondsFromDelta(self): | |
| 19 date1 = datetime(2016, 5, 1, 1, 1, 1, 1) | |
| 20 date2 = datetime(2016, 5, 1, 1, 1, 1, 2) | |
| 21 delta = date2 - date1 | |
| 22 | |
| 23 self.assertEqual( | |
| 24 try_job_dashboard._RemoveMicrosecondsFromDelta(delta).microseconds, | |
| 25 0) | |
| 26 | |
| 27 def testRemoveMicrosecondsFromDatetime(self): | |
| 28 date = datetime(2016, 5, 1, 0, 0, 0, 12345) | |
| 29 self.assertEqual( | |
| 30 try_job_dashboard._RemoveMicrosecondsFromDatetime(date), | |
| 31 datetime(2016, 5, 1, 0, 0, 0, 0)) | |
| 32 self.assertIsNone(try_job_dashboard._RemoveMicrosecondsFromDatetime(None)) | |
| OLD | NEW |