Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(100)

Unified Diff: appengine/findit/common/test/git_repository_test.py

Issue 1950123003: [Findit] Fetch DEPS from buildspec/ instead of trunk for chrome official builds. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: appengine/findit/common/test/git_repository_test.py
diff --git a/appengine/findit/common/test/git_repository_test.py b/appengine/findit/common/test/git_repository_test.py
index a0991742638da9b6fac6acdb7840e21c327aed83..d870f81d4aceabbd1a7fe3eca63a56aaf0adc567 100644
--- a/appengine/findit/common/test/git_repository_test.py
+++ b/appengine/findit/common/test/git_repository_test.py
@@ -599,3 +599,28 @@ class GitRepositoryTest(testing.AppengineTestCase):
self.assertRaisesRegexp(
Exception, 'Failed to pull changelog for revision 2',
self.git_repo.GetChangeLogs, '0', '2')
+
+ def testGetRevisionForChromeVersion(self):
+
+ def _MockGetChangeLog(*_):
+ changelog = ChangeLog.FromDict(DUMMY_CHANGELOG_JSON)
+ changelog.revision = '123a'
+ return changelog
+
+ self.mock(git_repository.GitRepository, 'GetChangeLog', _MockGetChangeLog)
+
+ git_repo = git_repository.GitRepository(self.repo_url,
+ self.http_client_for_git)
+ self.assertEqual(git_repo.GetRevisionForChromeVersion('50.0.1234.0'),
+ '123a')
+
+ def testGetRevisionForChromeVersionFailToGetChangeLog(self):
+
+ def _MockGetChangeLog(*_):
+ return None
+
+ self.mock(git_repository.GitRepository, 'GetChangeLog', _MockGetChangeLog)
+
+ git_repo = git_repository.GitRepository(self.repo_url,
+ self.http_client_for_git)
+ self.assertIsNone(git_repo.GetRevisionForChromeVersion('50.0.1234.0'))

Powered by Google App Engine
This is Rietveld 408576698