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

Unified Diff: tests/trychange_git_unittest.py

Issue 1003733006: Splitting trychange for git_try and removing no longer needed support for: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « git_try.py ('k') | trychange_git.py » ('j') | trychange_git.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/trychange_git_unittest.py
diff --git a/tests/trychange_unittest.py b/tests/trychange_git_unittest.py
similarity index 73%
copy from tests/trychange_unittest.py
copy to tests/trychange_git_unittest.py
index d4e54e3abe746ad63d807a33ce761cc5299610f2..8b508343d5366271b819108ad4ad206e1ccf71ca 100755
--- a/tests/trychange_unittest.py
+++ b/tests/trychange_git_unittest.py
@@ -14,7 +14,7 @@ sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from testing_support.super_mox import SuperMoxTestBase
import subprocess2
-import trychange
+import trychange_git as trychange
class TryChangeTestsBase(SuperMoxTestBase):
@@ -47,13 +47,11 @@ class TryChangeUnittest(TryChangeTestsBase):
def testMembersChanged(self):
members = [
'DieWithError', 'EPILOG', 'Escape', 'GIT', 'GIT_PATCH_DIR_BASENAME',
- 'GetMungedDiff', 'GuessVCS', 'GIT_BRANCH_FILE',
- 'HELP_STRING', 'Error', 'InvalidScript', 'NoTryServerAccess',
+ 'GetMungedDiff', 'DetectGit', 'GIT_BRANCH_FILE', 'git_cl',
+ 'HELP_STRING', 'Error', 'NoTryServerAccess',
'OptionParser', 'PrintSuccess',
- 'RunCommand', 'RunGit', 'SCM', 'SVN', 'TryChange', 'USAGE', 'contextlib',
- 'breakpad',
- 'datetime', 'errno', 'fix_encoding', 'gcl', 'gclient_utils',
- 'gerrit_util', 'gen_parser',
+ 'RunCommand', 'RunGit', 'TryChange_Git', 'USAGE', 'contextlib',
+ 'datetime', 'errno', 'gclient_utils', 'gen_parser',
'getpass', 'itertools', 'json', 'logging', 'optparse', 'os', 'posixpath',
're', 'scm', 'shutil', 'subprocess2', 'sys', 'tempfile', 'urllib',
'urllib2', 'urlparse']
@@ -103,38 +101,12 @@ class TryChangeSimpleTest(unittest.TestCase):
pass
-class SVNUnittest(TryChangeTestsBase):
- """trychange.SVN tests."""
- def testMembersChanged(self):
- members = [
- 'AutomagicalSettings', 'CaptureStatus', 'GetCodeReviewSetting',
- 'ReadRootFile', 'GenerateDiff', 'GetFileNames', 'files', 'file_tuples',
- ]
- # If this test fails, you should add the relevant test.
- self.compareMembers(trychange.SVN, members)
-
- def testBasic(self):
- # pylint: disable=E1103
- trychange.os.path.abspath(self.fake_root).AndReturn(self.fake_root)
- trychange.scm.SVN.GetCheckoutRoot(self.fake_root).AndReturn(self.fake_root)
- trychange.scm.SVN.GenerateDiff(['foo.txt', 'bar.txt'],
- self.fake_root,
- full_move=True,
- revision=None).AndReturn('A diff')
- trychange.scm.SVN.GetEmail(self.fake_root).AndReturn('georges@example.com')
- self.mox.ReplayAll()
- svn = trychange.SVN(self.options, self.fake_root, self.options.files)
- self.assertEqual(svn.GetFileNames(), self.expected_files)
- self.assertEqual(svn.checkout_root, self.fake_root)
- self.assertEqual(svn.GenerateDiff(), 'A diff')
-
-
class GITUnittest(TryChangeTestsBase):
"""trychange.GIT tests."""
def testMembersChanged(self):
members = [
'AutomagicalSettings', 'CaptureStatus', 'GetCodeReviewSetting',
- 'ReadRootFile', 'GenerateDiff', 'GetFileNames', 'files', 'file_tuples',
+ 'ReadRootFile', 'GenerateDiff', 'files', 'file_tuples',
]
# If this test fails, you should add the relevant test.
self.compareMembers(trychange.GIT, members)
@@ -153,7 +125,7 @@ class GITUnittest(TryChangeTestsBase):
trychange.scm.GIT.GetEmail(self.fake_root).AndReturn('georges@example.com')
self.mox.ReplayAll()
git = trychange.GIT(self.options, self.fake_root, self.options.files)
- self.assertEqual(git.GetFileNames(), self.expected_files)
+ self.assertEqual(git.files, self.expected_files)
self.assertEqual(git.checkout_root, self.fake_root)
self.assertEqual(git.GenerateDiff(), 'A diff')
« no previous file with comments | « git_try.py ('k') | trychange_git.py » ('j') | trychange_git.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698