| OLD | NEW |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import os | 5 import os |
| 6 | 6 |
| 7 from testing_utils import testing | 7 from testing_utils import testing |
| 8 | 8 |
| 9 from common import time_util | 9 from lib import time_util |
| 10 | 10 |
| 11 | 11 |
| 12 class FinditTestCase(testing.AppengineTestCase): # pragma: no cover. | 12 class FinditTestCase(testing.AppengineTestCase): # pragma: no cover. |
| 13 # Setup the customized queues. | 13 # Setup the customized queues. |
| 14 taskqueue_stub_root_path = os.path.join( | 14 taskqueue_stub_root_path = os.path.join( |
| 15 os.path.dirname(__file__), os.path.pardir) | 15 os.path.dirname(__file__), os.path.pardir) |
| 16 | 16 |
| 17 def MockPipeline( | 17 def MockPipeline( |
| 18 self, pipeline_class, result, expected_args, expected_kwargs=None): | 18 self, pipeline_class, result, expected_args, expected_kwargs=None): |
| 19 """Mocks a pipeline to return a value and asserts the expected parameters. | 19 """Mocks a pipeline to return a value and asserts the expected parameters. |
| (...skipping 15 matching lines...) Expand all Loading... |
| 35 | 35 |
| 36 self.mock(pipeline_class, 'run', Mocked_run) | 36 self.mock(pipeline_class, 'run', Mocked_run) |
| 37 | 37 |
| 38 def MockUTCNow(self, mocked_utcnow): | 38 def MockUTCNow(self, mocked_utcnow): |
| 39 """Mocks utcnow with the given value for testing.""" | 39 """Mocks utcnow with the given value for testing.""" |
| 40 self.mock(time_util, 'GetUTCNow', lambda: mocked_utcnow) | 40 self.mock(time_util, 'GetUTCNow', lambda: mocked_utcnow) |
| 41 | 41 |
| 42 def MockUTCNowWithTimezone(self, mocked_utcnow): | 42 def MockUTCNowWithTimezone(self, mocked_utcnow): |
| 43 """Mocks utcnow with the given value for testing.""" | 43 """Mocks utcnow with the given value for testing.""" |
| 44 self.mock(time_util, 'GetUTCNowWithTimezone', lambda: mocked_utcnow) | 44 self.mock(time_util, 'GetUTCNowWithTimezone', lambda: mocked_utcnow) |
| OLD | NEW |