OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 datetime | 5 import datetime |
6 import json | 6 import json |
7 | 7 |
8 from appengine_module.testing_utils import testing | 8 from appengine_module.testing_utils import testing |
9 | 9 |
10 from appengine_module.cr_rev import controller | 10 from appengine_module.cr_rev import controller |
11 from appengine_module.cr_rev import models | 11 from appengine_module.cr_rev import models |
12 from appengine_module.pipeline_utils.\ | 12 from appengine_module.pipeline_utils.\ |
13 appengine_third_party_pipeline_src_pipeline \ | 13 appengine_third_party_pipeline_python_src_pipeline \ |
14 import handlers | 14 import handlers |
15 from appengine_module.pipeline_utils.\ | 15 from appengine_module.pipeline_utils.\ |
16 appengine_third_party_pipeline_src_pipeline \ | 16 appengine_third_party_pipeline_python_src_pipeline \ |
17 import pipeline | 17 import pipeline |
18 from appengine_module.cr_rev.test import model_helpers | 18 from appengine_module.cr_rev.test import model_helpers |
19 | 19 |
20 | 20 |
21 class TestController(testing.AppengineTestCase): | 21 class TestController(testing.AppengineTestCase): |
22 app_module = handlers._APP # pylint: disable=W0212 | 22 app_module = handlers._APP # pylint: disable=W0212 |
23 | 23 |
24 @staticmethod | 24 @staticmethod |
25 def _gitiles_json(data): | 25 def _gitiles_json(data): |
26 """Return json-encoded data with a gitiles header.""" | 26 """Return json-encoded data with a gitiles header.""" |
(...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
683 self._gitiles_json(foofbeef_data)) | 683 self._gitiles_json(foofbeef_data)) |
684 urlfetch.register_handler( | 684 urlfetch.register_handler( |
685 base_url + 'cool_src/+log/%s?format=json&n=2' % ('f00fbeef' * 5,), | 685 base_url + 'cool_src/+log/%s?format=json&n=2' % ('f00fbeef' * 5,), |
686 self._gitiles_json(foofbeef_data)) | 686 self._gitiles_json(foofbeef_data)) |
687 controller.scan_repos() | 687 controller.scan_repos() |
688 self.execute_queued_tasks() | 688 self.execute_queued_tasks() |
689 | 689 |
690 self.assertEqual(7, len(list(models.RevisionMap.query()))) | 690 self.assertEqual(7, len(list(models.RevisionMap.query()))) |
691 my_repo = models.Repo.get_key_by_id(my_project.name, my_repo.repo).get() | 691 my_repo = models.Repo.get_key_by_id(my_project.name, my_repo.repo).get() |
692 self.assertTrue(my_repo.root_commit_scanned) | 692 self.assertTrue(my_repo.root_commit_scanned) |
OLD | NEW |