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

Side by Side Diff: tests/trychange_unittest.py

Issue 501171: Add full_move flag to GIT.GenerateDiff and Factor out FindGclientRootDir into gclient_utils. (Closed)
Patch Set: Created 10 years, 12 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
« no previous file with comments | « tests/gclient_utils_test.py ('k') | trychange.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 # Copyright (c) 2009 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2009 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 trychange.py.""" 6 """Unit tests for trychange.py."""
7 7
8 import optparse 8 import optparse
9 9
10 # Local imports 10 # Local imports
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 def testMembersChanged(self): 76 def testMembersChanged(self):
77 members = [ 77 members = [
78 'GetBots', 'GetFileNames', 'GetLocalRoot', 78 'GetBots', 'GetFileNames', 'GetLocalRoot',
79 ] 79 ]
80 # If this test fails, you should add the relevant test. 80 # If this test fails, you should add the relevant test.
81 self.compareMembers(trychange.GIT, members) 81 self.compareMembers(trychange.GIT, members)
82 82
83 def testBasic(self): 83 def testBasic(self):
84 trychange.os.getcwd().AndReturn(self.fake_root) 84 trychange.os.getcwd().AndReturn(self.fake_root)
85 trychange.scm.GIT.GetCheckoutRoot(self.fake_root).AndReturn(self.fake_root) 85 trychange.scm.GIT.GetCheckoutRoot(self.fake_root).AndReturn(self.fake_root)
86 trychange.scm.GIT.GenerateDiff(self.fake_root).AndReturn('a diff') 86 trychange.scm.GIT.GenerateDiff(self.fake_root,
87 full_move=True).AndReturn('a diff')
87 trychange.scm.GIT.GetPatchName(self.fake_root).AndReturn('bleh-1233') 88 trychange.scm.GIT.GetPatchName(self.fake_root).AndReturn('bleh-1233')
88 trychange.scm.GIT.GetEmail(self.fake_root).AndReturn('georges@example.com') 89 trychange.scm.GIT.GetEmail(self.fake_root).AndReturn('georges@example.com')
89 self.mox.ReplayAll() 90 self.mox.ReplayAll()
90 git = trychange.GIT(self.options) 91 git = trychange.GIT(self.options)
91 self.assertEqual(git.GetFileNames(), self.expected_files) 92 self.assertEqual(git.GetFileNames(), self.expected_files)
92 self.assertEqual(git.GetLocalRoot(), self.fake_root) 93 self.assertEqual(git.GetLocalRoot(), self.fake_root)
93 94
94 95
95 if __name__ == '__main__': 96 if __name__ == '__main__':
96 import unittest 97 import unittest
97 unittest.main() 98 unittest.main()
OLDNEW
« no previous file with comments | « tests/gclient_utils_test.py ('k') | trychange.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698