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

Side by Side Diff: tests/gclient_scm_test.py

Issue 24950002: Delete nag_max and nag_timer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 7 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « gclient_utils.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Unit tests for gclient_scm.py.""" 6 """Unit tests for gclient_scm.py."""
7 7
8 # pylint: disable=E1103 8 # pylint: disable=E1103
9 9
10 # Import before super_mox to keep valid references. 10 # Import before super_mox to keep valid references.
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 'BinaryExists', 102 'BinaryExists',
103 'FullUrlForRelativeUrl', 103 'FullUrlForRelativeUrl',
104 'GetCheckoutRoot', 104 'GetCheckoutRoot',
105 'GetRevisionDate', 105 'GetRevisionDate',
106 'GetUsableRev', 106 'GetUsableRev',
107 'Svnversion', 107 'Svnversion',
108 'RunCommand', 108 'RunCommand',
109 'cleanup', 109 'cleanup',
110 'diff', 110 'diff',
111 'name', 111 'name',
112 'nag_max',
113 'nag_timer',
114 'pack', 112 'pack',
115 'relpath', 113 'relpath',
116 'revert', 114 'revert',
117 'revinfo', 115 'revinfo',
118 'runhooks', 116 'runhooks',
119 'status', 117 'status',
120 'update', 118 'update',
121 'updatesingle', 119 'updatesingle',
122 'url', 120 'url',
123 ] 121 ]
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
509 507
510 # Verify no locked files. 508 # Verify no locked files.
511 dotted_path = join(self.base_path, '.') 509 dotted_path = join(self.base_path, '.')
512 gclient_scm.scm.SVN.CaptureStatus(None, dotted_path).AndReturn([]) 510 gclient_scm.scm.SVN.CaptureStatus(None, dotted_path).AndReturn([])
513 511
514 # When checking out a single file, we issue an svn checkout and svn update. 512 # When checking out a single file, we issue an svn checkout and svn update.
515 files_list = self.mox.CreateMockAnything() 513 files_list = self.mox.CreateMockAnything()
516 gclient_scm.gclient_utils.CheckCallAndFilterAndHeader( 514 gclient_scm.gclient_utils.CheckCallAndFilterAndHeader(
517 ['svn', 'checkout', '--depth', 'empty', self.url, self.base_path], 515 ['svn', 'checkout', '--depth', 'empty', self.url, self.base_path],
518 always=True, 516 always=True,
519 nag_max=30,
520 nag_timer=30,
521 cwd=self.root_dir) 517 cwd=self.root_dir)
522 gclient_scm.scm.SVN.RunAndGetFileList( 518 gclient_scm.scm.SVN.RunAndGetFileList(
523 options.verbose, 519 options.verbose,
524 ['update', 'DEPS', '--ignore-externals'], 520 ['update', 'DEPS', '--ignore-externals'],
525 cwd=self.base_path, 521 cwd=self.base_path,
526 file_list=files_list) 522 file_list=files_list)
527 523
528 # Now we fall back on scm.update(). 524 # Now we fall back on scm.update().
529 gclient_scm.os.path.exists(join(self.base_path, '.git')).AndReturn(False) 525 gclient_scm.os.path.exists(join(self.base_path, '.git')).AndReturn(False)
530 gclient_scm.os.path.exists(join(self.base_path, '.hg')).AndReturn(False) 526 gclient_scm.os.path.exists(join(self.base_path, '.hg')).AndReturn(False)
(...skipping 17 matching lines...) Expand all
548 # Checks to make sure that we support svn co --depth. 544 # Checks to make sure that we support svn co --depth.
549 gclient_scm.scm.SVN.current_version = None 545 gclient_scm.scm.SVN.current_version = None
550 gclient_scm.scm.SVN.Capture(['--version', '--quiet'], None 546 gclient_scm.scm.SVN.Capture(['--version', '--quiet'], None
551 ).AndReturn('1.4.4') 547 ).AndReturn('1.4.4')
552 gclient_scm.os.path.exists(self.base_path).AndReturn(True) 548 gclient_scm.os.path.exists(self.base_path).AndReturn(True)
553 549
554 # When checking out a single file with svn 1.4, we use svn export 550 # When checking out a single file with svn 1.4, we use svn export
555 files_list = self.mox.CreateMockAnything() 551 files_list = self.mox.CreateMockAnything()
556 gclient_scm.gclient_utils.CheckCallAndFilterAndHeader( 552 gclient_scm.gclient_utils.CheckCallAndFilterAndHeader(
557 ['svn', 'export', join(self.url, 'DEPS'), join(self.base_path, 'DEPS')], 553 ['svn', 'export', join(self.url, 'DEPS'), join(self.base_path, 'DEPS')],
558 nag_timer=30, nag_max=30, always=True, cwd=self.root_dir) 554 always=True, cwd=self.root_dir)
559 555
560 self.mox.ReplayAll() 556 self.mox.ReplayAll()
561 scm = self._scm_wrapper(url=self.url, root_dir=self.root_dir, 557 scm = self._scm_wrapper(url=self.url, root_dir=self.root_dir,
562 relpath=self.relpath) 558 relpath=self.relpath)
563 scm.updatesingle(options, ['DEPS'], files_list) 559 scm.updatesingle(options, ['DEPS'], files_list)
564 560
565 def testUpdateSingleCheckoutSVNUpgrade(self): 561 def testUpdateSingleCheckoutSVNUpgrade(self):
566 options = self.Options(verbose=True) 562 options = self.Options(verbose=True)
567 file_info = { 563 file_info = {
568 'URL': self.url, 564 'URL': self.url,
(...skipping 12 matching lines...) Expand all
581 577
582 # Verify no locked files. 578 # Verify no locked files.
583 gclient_scm.scm.SVN.CaptureStatus( 579 gclient_scm.scm.SVN.CaptureStatus(
584 None, join(self.base_path, '.')).AndReturn([]) 580 None, join(self.base_path, '.')).AndReturn([])
585 581
586 # When checking out a single file, we issue an svn checkout and svn update. 582 # When checking out a single file, we issue an svn checkout and svn update.
587 files_list = self.mox.CreateMockAnything() 583 files_list = self.mox.CreateMockAnything()
588 gclient_scm.gclient_utils.CheckCallAndFilterAndHeader( 584 gclient_scm.gclient_utils.CheckCallAndFilterAndHeader(
589 ['svn', 'checkout', '--depth', 'empty', self.url, self.base_path], 585 ['svn', 'checkout', '--depth', 'empty', self.url, self.base_path],
590 always=True, 586 always=True,
591 nag_max=30,
592 nag_timer=30,
593 cwd=self.root_dir) 587 cwd=self.root_dir)
594 gclient_scm.scm.SVN.RunAndGetFileList( 588 gclient_scm.scm.SVN.RunAndGetFileList(
595 options.verbose, 589 options.verbose,
596 ['update', 'DEPS', '--ignore-externals'], 590 ['update', 'DEPS', '--ignore-externals'],
597 cwd=self.base_path, 591 cwd=self.base_path,
598 file_list=files_list) 592 file_list=files_list)
599 593
600 # Now we fall back on scm.update(). 594 # Now we fall back on scm.update().
601 gclient_scm.os.path.exists(join(self.base_path, '.git')).AndReturn(False) 595 gclient_scm.os.path.exists(join(self.base_path, '.git')).AndReturn(False)
602 gclient_scm.os.path.exists(join(self.base_path, '.hg')).AndReturn(False) 596 gclient_scm.os.path.exists(join(self.base_path, '.hg')).AndReturn(False)
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
820 'FullUrlForRelativeUrl', 814 'FullUrlForRelativeUrl',
821 'GetCheckoutRoot', 815 'GetCheckoutRoot',
822 'GetRevisionDate', 816 'GetRevisionDate',
823 'GetUsableRev', 817 'GetUsableRev',
824 'RunCommand', 818 'RunCommand',
825 'cache_dir', 819 'cache_dir',
826 'cache_locks', 820 'cache_locks',
827 'cleanup', 821 'cleanup',
828 'diff', 822 'diff',
829 'name', 823 'name',
830 'nag_max',
831 'nag_timer',
832 'pack', 824 'pack',
833 'UpdateSubmoduleConfig', 825 'UpdateSubmoduleConfig',
834 'relpath', 826 'relpath',
835 'revert', 827 'revert',
836 'revinfo', 828 'revinfo',
837 'runhooks', 829 'runhooks',
838 'status', 830 'status',
839 'update', 831 'update',
840 'url', 832 'url',
841 ] 833 ]
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
1208 1200
1209 if __name__ == '__main__': 1201 if __name__ == '__main__':
1210 if '-v' in sys.argv: 1202 if '-v' in sys.argv:
1211 logging.basicConfig( 1203 logging.basicConfig(
1212 level=logging.DEBUG, 1204 level=logging.DEBUG,
1213 format='%(asctime).19s %(levelname)s %(filename)s:' 1205 format='%(asctime).19s %(levelname)s %(filename)s:'
1214 '%(lineno)s %(message)s') 1206 '%(lineno)s %(message)s')
1215 unittest.main() 1207 unittest.main()
1216 1208
1217 # vim: ts=2:sw=2:tw=80:et: 1209 # vim: ts=2:sw=2:tw=80:et:
OLDNEW
« no previous file with comments | « gclient_utils.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698