| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2015 The LUCI Authors. All rights reserved. | 2 # Copyright 2015 The LUCI Authors. All rights reserved. |
| 3 # Use of this source code is governed under the Apache License, Version 2.0 | 3 # Use of this source code is governed under the Apache License, Version 2.0 |
| 4 # that can be found in the LICENSE file. | 4 # that can be found in the LICENSE file. |
| 5 | 5 |
| 6 from test_env import future | 6 from test_env import future |
| 7 import test_env | 7 import test_env |
| 8 test_env.setup_test_env() | 8 test_env.setup_test_env() |
| 9 | 9 |
| 10 from components.config.proto import service_config_pb2 | 10 from components.config.proto import service_config_pb2 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 ], | 68 ], |
| 69 ) | 69 ) |
| 70 self.assertEqual( | 70 self.assertEqual( |
| 71 projects.get_refs(['chromium']), {'chromium': expected.refs}) | 71 projects.get_refs(['chromium']), {'chromium': expected.refs}) |
| 72 | 72 |
| 73 def test_get_refs_of_non_existent_project(self): | 73 def test_get_refs_of_non_existent_project(self): |
| 74 self.mock(projects, '_filter_existing', lambda pids: []) | 74 self.mock(projects, '_filter_existing', lambda pids: []) |
| 75 self.assertEqual(projects.get_refs(['chromium']), {'chromium': None}) | 75 self.assertEqual(projects.get_refs(['chromium']), {'chromium': None}) |
| 76 | 76 |
| 77 def test_repo_info(self): | 77 def test_repo_info(self): |
| 78 self.assertEqual(projects.get_repos(['x']), {'x': (None, None)}) | 78 self.assertEqual( |
| 79 projects.get_repos_async(['x']).get_result(), |
| 80 {'x': (None, None)}) |
| 79 projects.update_import_info( | 81 projects.update_import_info( |
| 80 'x', projects.RepositoryType.GITILES, 'http://localhost/x') | 82 'x', projects.RepositoryType.GITILES, 'http://localhost/x') |
| 81 # Second time for coverage. | 83 # Second time for coverage. |
| 82 projects.update_import_info( | 84 projects.update_import_info( |
| 83 'x', projects.RepositoryType.GITILES, 'http://localhost/x') | 85 'x', projects.RepositoryType.GITILES, 'http://localhost/x') |
| 84 self.assertEqual( | 86 self.assertEqual( |
| 85 projects.get_repos(['x']), | 87 projects.get_repos_async(['x']).get_result(), |
| 86 {'x': (projects.RepositoryType.GITILES, 'http://localhost/x')}) | 88 {'x': (projects.RepositoryType.GITILES, 'http://localhost/x')}) |
| 87 | 89 |
| 88 # Change it | 90 # Change it |
| 89 projects.update_import_info( | 91 projects.update_import_info( |
| 90 'x', projects.RepositoryType.GITILES, 'http://localhost/y') | 92 'x', projects.RepositoryType.GITILES, 'http://localhost/y') |
| 91 | 93 |
| 92 | 94 |
| 93 if __name__ == '__main__': | 95 if __name__ == '__main__': |
| 94 test_env.main() | 96 test_env.main() |
| OLD | NEW |