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

Side by Side Diff: tests/gclient_scm_test.py

Issue 507061: Move GenerateDiff into a common function. (Closed)
Patch Set: mult Created 11 years 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
« no previous file with comments | « scm.py ('k') | tests/gclient_utils_test.py » ('j') | 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/python 1 #!/usr/bin/python
2 # 2 #
3 # Copyright 2008-2009 Google Inc. All Rights Reserved. 3 # Copyright 2008-2009 Google Inc. All Rights Reserved.
4 # 4 #
5 # Licensed under the Apache License, Version 2.0 (the "License"); 5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License. 6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at 7 # You may obtain a copy of the License at
8 # 8 #
9 # http://www.apache.org/licenses/LICENSE-2.0 9 # http://www.apache.org/licenses/LICENSE-2.0
10 # 10 #
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 def setUp(self): 58 def setUp(self):
59 BaseTestCase.setUp(self) 59 BaseTestCase.setUp(self)
60 self.root_dir = self.Dir() 60 self.root_dir = self.Dir()
61 self.args = self.Args() 61 self.args = self.Args()
62 self.url = self.Url() 62 self.url = self.Url()
63 self.relpath = 'asf' 63 self.relpath = 'asf'
64 64
65 def testDir(self): 65 def testDir(self):
66 members = [ 66 members = [
67 'COMMAND', 'Capture', 'CaptureHeadRevision', 'CaptureInfo', 67 'COMMAND', 'Capture', 'CaptureHeadRevision', 'CaptureInfo',
68 'CaptureStatus', 'DiffItem', 'GetCheckoutRoot', 'GetEmail', 68 'CaptureStatus', 'DiffItem', 'GenerateDiff', 'GetCheckoutRoot',
69 'GetFileProperty', 'IsMoved', 'ReadSimpleAuth', 'Run', 69 'GetEmail', 'GetFileProperty', 'IsMoved', 'ReadSimpleAuth', 'Run',
70 'RunAndFilterOutput', 'RunAndGetFileList', 70 'RunAndFilterOutput', 'RunAndGetFileList',
71 'RunCommand', 'cleanup', 'diff', 'export', 'pack', 'relpath', 'revert', 71 'RunCommand', 'cleanup', 'diff', 'export', 'pack', 'relpath', 'revert',
72 'revinfo', 'runhooks', 'scm_name', 'status', 'update', 'url', 72 'revinfo', 'runhooks', 'scm_name', 'status', 'update', 'url',
73 ] 73 ]
74 74
75 # If you add a member, be sure to add the relevant test! 75 # If you add a member, be sure to add the relevant test!
76 self.compareMembers(self._scm_wrapper(), members) 76 self.compareMembers(self._scm_wrapper(), members)
77 77
78 def testUnsupportedSCM(self): 78 def testUnsupportedSCM(self):
79 args = [self.url, self.root_dir, self.relpath] 79 args = [self.url, self.root_dir, self.relpath]
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 self.base_path = gclient_scm.os.path.join(self.root_dir, self.relpath) 352 self.base_path = gclient_scm.os.path.join(self.root_dir, self.relpath)
353 self.enabled = self.CreateGitRepo(self.sample_git_import, self.base_path) 353 self.enabled = self.CreateGitRepo(self.sample_git_import, self.base_path)
354 SuperMoxBaseTestBase.setUp(self) 354 SuperMoxBaseTestBase.setUp(self)
355 355
356 def tearDown(self): 356 def tearDown(self):
357 SuperMoxBaseTestBase.tearDown(self) 357 SuperMoxBaseTestBase.tearDown(self)
358 shutil.rmtree(self.root_dir) 358 shutil.rmtree(self.root_dir)
359 359
360 def testDir(self): 360 def testDir(self):
361 members = [ 361 members = [
362 'COMMAND', 'Capture', 'CaptureStatus', 'GetEmail', 362 'COMMAND', 'Capture', 'CaptureStatus', 'FetchUpstreamTuple',
363 'GenerateDiff', 'GetBranchRef', 'GetEmail', 'GetSVNBranch',
364 'GetUpstream', 'IsGitSvn', 'ShortBranchName',
363 'RunCommand', 'cleanup', 'diff', 'export', 'relpath', 'revert', 365 'RunCommand', 'cleanup', 'diff', 'export', 'relpath', 'revert',
364 'revinfo', 'runhooks', 'scm_name', 'status', 'update', 'url', 366 'revinfo', 'runhooks', 'scm_name', 'status', 'update', 'url',
365 ] 367 ]
366 368
367 # If you add a member, be sure to add the relevant test! 369 # If you add a member, be sure to add the relevant test!
368 self.compareMembers(gclient_scm.CreateSCM(url=self.url), members) 370 self.compareMembers(gclient_scm.CreateSCM(url=self.url), members)
369 371
370 def testRevertMissing(self): 372 def testRevertMissing(self):
371 if not self.enabled: 373 if not self.enabled:
372 return 374 return
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
528 relpath=self.relpath) 530 relpath=self.relpath)
529 rev_info = scm.revinfo(options, (), None) 531 rev_info = scm.revinfo(options, (), None)
530 self.assertEquals(rev_info, '069c602044c5388d2d15c3f875b057c852003458') 532 self.assertEquals(rev_info, '069c602044c5388d2d15c3f875b057c852003458')
531 533
532 534
533 if __name__ == '__main__': 535 if __name__ == '__main__':
534 import unittest 536 import unittest
535 unittest.main() 537 unittest.main()
536 538
537 # vim: ts=2:sw=2:tw=80:et: 539 # vim: ts=2:sw=2:tw=80:et:
OLDNEW
« no previous file with comments | « scm.py ('k') | tests/gclient_utils_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698