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

Unified Diff: tests/trychange_unittest.py

Issue 501166: Remove more logic out of trychange.py into scm.py. (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/scm_unittest.py ('k') | trychange.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/trychange_unittest.py
diff --git a/tests/trychange_unittest.py b/tests/trychange_unittest.py
index e0832f4a2106a8dd148d12a9c7b2d07fa6621d10..298865cb8de7166d83f11fcdcc37784bd5eadba9 100644
--- a/tests/trychange_unittest.py
+++ b/tests/trychange_unittest.py
@@ -19,6 +19,8 @@ class TryChangeTestsBase(SuperMoxTestBase):
self.mox.StubOutWithMock(trychange.gclient_utils, 'CheckCall')
self.mox.StubOutWithMock(trychange.scm.GIT, 'Capture')
self.mox.StubOutWithMock(trychange.scm.GIT, 'GenerateDiff')
+ self.mox.StubOutWithMock(trychange.scm.GIT, 'GetCheckoutRoot')
+ self.mox.StubOutWithMock(trychange.scm.GIT, 'GetPatchName')
self.mox.StubOutWithMock(trychange.scm.GIT, 'GetEmail')
self.mox.StubOutWithMock(trychange.scm.SVN, 'DiffItem')
self.mox.StubOutWithMock(trychange.scm.SVN, 'GenerateDiff')
@@ -79,13 +81,11 @@ class GITUnittest(TryChangeTestsBase):
self.compareMembers(trychange.GIT, members)
def testBasic(self):
- trychange.gclient_utils.CheckCall(
- ['git', 'rev-parse', '--show-cdup']).AndReturn(self.fake_root)
- trychange.os.path.abspath(self.fake_root).AndReturn(self.fake_root)
+ trychange.os.getcwd().AndReturn(self.fake_root)
+ trychange.scm.GIT.GetCheckoutRoot(self.fake_root).AndReturn(self.fake_root)
trychange.scm.GIT.GenerateDiff(self.fake_root).AndReturn('a diff')
- trychange.gclient_utils.CheckCall(
- ['git', 'symbolic-ref', 'HEAD']).AndReturn('refs/heads/random branch')
- trychange.scm.GIT.GetEmail('.').AndReturn('georges@example.com')
+ trychange.scm.GIT.GetPatchName(self.fake_root).AndReturn('bleh-1233')
+ trychange.scm.GIT.GetEmail(self.fake_root).AndReturn('georges@example.com')
self.mox.ReplayAll()
git = trychange.GIT(self.options)
self.assertEqual(git.GetFileNames(), self.expected_files)
« no previous file with comments | « tests/scm_unittest.py ('k') | trychange.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698