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

Side by Side 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 unified diff | Download patch
OLDNEW
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 from datetime import datetime 6 from datetime import datetime
7 import json 7 import json
8 import re 8 import re
9 9
10 from testing_utils import testing 10 from testing_utils import testing
(...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after
592 return None 592 return None
593 593
594 self.mock(git_repository.GitRepository, 'GetCommitsBetweenRevisions', 594 self.mock(git_repository.GitRepository, 'GetCommitsBetweenRevisions',
595 self._MockGetCommitsBetweenRevisions) 595 self._MockGetCommitsBetweenRevisions)
596 self.mock(git_repository.GitRepository, 'GetChangeLog', 596 self.mock(git_repository.GitRepository, 'GetChangeLog',
597 _MockGetChangeLog) 597 _MockGetChangeLog)
598 598
599 self.assertRaisesRegexp( 599 self.assertRaisesRegexp(
600 Exception, 'Failed to pull changelog for revision 2', 600 Exception, 'Failed to pull changelog for revision 2',
601 self.git_repo.GetChangeLogs, '0', '2') 601 self.git_repo.GetChangeLogs, '0', '2')
602
603 def testGetRevisionForChromeVersion(self):
604
605 def _MockGetChangeLog(*_):
606 changelog = ChangeLog.FromDict(DUMMY_CHANGELOG_JSON)
607 changelog.revision = '123a'
608 return changelog
609
610 self.mock(git_repository.GitRepository, 'GetChangeLog', _MockGetChangeLog)
611
612 git_repo = git_repository.GitRepository(self.repo_url,
613 self.http_client_for_git)
614 self.assertEqual(git_repo.GetRevisionForChromeVersion('50.0.1234.0'),
615 '123a')
616
617 def testGetRevisionForChromeVersionFailToGetChangeLog(self):
618
619 def _MockGetChangeLog(*_):
620 return None
621
622 self.mock(git_repository.GitRepository, 'GetChangeLog', _MockGetChangeLog)
623
624 git_repo = git_repository.GitRepository(self.repo_url,
625 self.http_client_for_git)
626 self.assertIsNone(git_repo.GetRevisionForChromeVersion('50.0.1234.0'))
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698