| 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 base64 | 5 import base64 |
| 6 import collections | 6 import collections |
| 7 | 7 |
| 8 from testing_utils import testing | 8 from testing_utils import testing |
| 9 | 9 |
| 10 from common import chrome_dependency_fetcher | 10 from common import chrome_dependency_fetcher |
| 11 from common import deps_parser | 11 from common import deps_parser |
| 12 from common import http_client_appengine | 12 from common import http_client_appengine |
| 13 from common.dependency import Dependency, DependencyRoll | 13 from common.dependency import Dependency, DependencyRoll |
| 14 from lib.gitiles.git_repository import GitRepository | 14 from libs.gitiles.git_repository import GitRepository |
| 15 from lib.gitiles import gitiles_repository | 15 from libs.gitiles import gitiles_repository |
| 16 from libs.http import retry_http_client | 16 from libs.http import retry_http_client |
| 17 | 17 |
| 18 | 18 |
| 19 class MockGitilesRepository(GitRepository): | 19 class MockGitilesRepository(GitRepository): |
| 20 """A class for mocking GitilesRepository. | 20 """A class for mocking GitilesRepository. |
| 21 | 21 |
| 22 N.B., in order to use this class for mocking, every module we want to | 22 N.B., in order to use this class for mocking, every module we want to |
| 23 test with a mock GitilesRepository must not import that class directly. | 23 test with a mock GitilesRepository must not import that class directly. |
| 24 Instead they must import the gitiles_repository module and rely on | 24 Instead they must import the gitiles_repository module and rely on |
| 25 dynamic dispatch to resolve the GitilesRepository attribute. Otherwise | 25 dynamic dispatch to resolve the GitilesRepository attribute. Otherwise |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 'src/', | 287 'src/', |
| 288 'https://chromium.googlesource.com/chromium/src.git', '4', '5'), | 288 'https://chromium.googlesource.com/chromium/src.git', '4', '5'), |
| 289 } | 289 } |
| 290 self.assertEqual(self.chrome_dep_fetcher.GetDependencyRollsDict( | 290 self.assertEqual(self.chrome_dep_fetcher.GetDependencyRollsDict( |
| 291 '4', '5', 'all'), expected_deps_rolls_dict) | 291 '4', '5', 'all'), expected_deps_rolls_dict) |
| 292 | 292 |
| 293 def testIsChromeVersion(self): | 293 def testIsChromeVersion(self): |
| 294 self.assertTrue(chrome_dependency_fetcher.IsChromeVersion('50.0.1234.1')) | 294 self.assertTrue(chrome_dependency_fetcher.IsChromeVersion('50.0.1234.1')) |
| 295 self.assertFalse(chrome_dependency_fetcher.IsChromeVersion('a.b.c.e')) | 295 self.assertFalse(chrome_dependency_fetcher.IsChromeVersion('a.b.c.e')) |
| 296 self.assertFalse(chrome_dependency_fetcher.IsChromeVersion('5.021.2.0.123')) | 296 self.assertFalse(chrome_dependency_fetcher.IsChromeVersion('5.021.2.0.123')) |
| OLD | NEW |