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

Unified Diff: tests/gclient_scm_test.py

Issue 10559075: Give up on verifying stdout for most git gclient scm tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: remove dead code Created 8 years, 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/gclient_scm_test.py
diff --git a/tests/gclient_scm_test.py b/tests/gclient_scm_test.py
index 1767f5200c152b602688dfab5f148f106fa9f26d..a8d006317f8c7f466249fd49cb73c1714d9ccb26 100755
--- a/tests/gclient_scm_test.py
+++ b/tests/gclient_scm_test.py
@@ -814,12 +814,6 @@ class ManagedGitWrapperTestCase(BaseGitWrapperTestCase):
file_list = []
scm.diff(options, self.args, file_list)
self.assertEquals(file_list, [])
- expectation = ('\n_____ . at refs/heads/master\nUpdating 069c602..a7142dc\n'
- 'Fast-forward\n a | 1 +\n b | 1 +\n'
- ' 2 files changed, 2 insertions(+), 0 deletions(-)\n\n\n'
- '________ running \'git reset --hard origin/master\' in \'%s\'\n'
- 'HEAD is now at a7142dc Personalized\n') % join(self.root_dir, '.')
- self.assertTrue(sys.stdout.getvalue().startswith(expectation))
sys.stdout.close()
def testRevertNone(self):
@@ -835,13 +829,7 @@ class ManagedGitWrapperTestCase(BaseGitWrapperTestCase):
self.assertEquals(file_list, [])
self.assertEquals(scm.revinfo(options, self.args, None),
'a7142dc9f0009350b96a11f372b6ea658592aa95')
- self.checkstdout(
- ('\n_____ . at refs/heads/master\nUpdating 069c602..a7142dc\n'
- 'Fast-forward\n a | 1 +\n b | 1 +\n'
- ' 2 files changed, 2 insertions(+), 0 deletions(-)\n\n\n'
- '________ running \'git reset --hard origin/master\' in \'%s\'\n'
- 'HEAD is now at a7142dc Personalized\n') %
- join(self.root_dir, '.'))
+ sys.stdout.close()
def testRevertModified(self):
if not self.enabled:
@@ -861,12 +849,6 @@ class ManagedGitWrapperTestCase(BaseGitWrapperTestCase):
self.assertEquals(file_list, [])
self.assertEquals(scm.revinfo(options, self.args, None),
'a7142dc9f0009350b96a11f372b6ea658592aa95')
- expectation = ('\n_____ . at refs/heads/master\nUpdating 069c602..a7142dc\n'
- 'Fast-forward\n a | 1 +\n b | 1 +\n'
- ' 2 files changed, 2 insertions(+), 0 deletions(-)\n\n\n'
- '________ running \'git reset --hard origin/master\' in \'%s\'\n'
- 'HEAD is now at a7142dc Personalized\n') % join(self.root_dir, '.')
- self.assertTrue(sys.stdout.getvalue().startswith(expectation))
sys.stdout.close()
def testRevertNew(self):
@@ -891,12 +873,6 @@ class ManagedGitWrapperTestCase(BaseGitWrapperTestCase):
self.assertEquals(file_list, [])
self.assertEquals(scm.revinfo(options, self.args, None),
'a7142dc9f0009350b96a11f372b6ea658592aa95')
- expectation = ('\n_____ . at refs/heads/master\nUpdating 069c602..a7142dc\n'
- 'Fast-forward\n a | 1 +\n b | 1 +\n'
- ' 2 files changed, 2 insertions(+), 0 deletions(-)\n\n\n'
- '________ running \'git reset --hard origin/master\' in \'%s\'\n'
- 'HEAD is now at a7142dc Personalized\n') % join(self.root_dir, '.')
- self.assertTrue(sys.stdout.getvalue().startswith(expectation))
sys.stdout.close()
def testStatusNew(self):
@@ -947,10 +923,7 @@ class ManagedGitWrapperTestCase(BaseGitWrapperTestCase):
self.assertEquals(file_list, expected_file_list)
self.assertEquals(scm.revinfo(options, (), None),
'a7142dc9f0009350b96a11f372b6ea658592aa95')
- self.checkstdout(
- '\n_____ . at refs/heads/master\n'
- 'Updating 069c602..a7142dc\nFast-forward\n a | 1 +\n b | 1 +\n'
- ' 2 files changed, 2 insertions(+), 0 deletions(-)\n\n')
+ sys.stdout.close()
def testUpdateReset(self):
if not self.enabled:
@@ -971,13 +944,7 @@ class ManagedGitWrapperTestCase(BaseGitWrapperTestCase):
scm.update(options, (), file_list)
self.assert_(gclient_scm.os.path.isdir(dir_path))
self.assert_(gclient_scm.os.path.isfile(file_path))
- self.checkstdout(
- '\n________ running \'git reset --hard HEAD\' in \'%s\''
- '\nHEAD is now at 069c602 A and B\n'
- '\n_____ . at refs/heads/master\n'
- 'Updating 069c602..a7142dc\nFast-forward\n a | 1 +\n b | 1 +\n'
- ' 2 files changed, 2 insertions(+), 0 deletions(-)\n\n'
- % join(self.root_dir, '.'))
+ sys.stdout.close()
def testUpdateResetDeleteUnversionedTrees(self):
if not self.enabled:
@@ -999,14 +966,7 @@ class ManagedGitWrapperTestCase(BaseGitWrapperTestCase):
scm.update(options, (), file_list)
self.assert_(not gclient_scm.os.path.isdir(dir_path))
self.assert_(gclient_scm.os.path.isfile(file_path))
- self.checkstdout(
- '\n________ running \'git reset --hard HEAD\' in \'%s\''
- '\nHEAD is now at 069c602 A and B\n'
- '\n_____ . at refs/heads/master\n'
- 'Updating 069c602..a7142dc\nFast-forward\n a | 1 +\n b | 1 +\n'
- ' 2 files changed, 2 insertions(+), 0 deletions(-)\n\n'
- '\n_____ removing unversioned directory dir/\n' % join(self.root_dir,
- '.'))
+ sys.stdout.close()
def testUpdateUnstagedConflict(self):
if not self.enabled:
@@ -1046,16 +1006,6 @@ class ManagedGitWrapperTestCase(BaseGitWrapperTestCase):
'\tYou have unstaged changes.\n'
'\tPlease commit, stash, or reset.\n')
self.assertRaisesError(exception, scm.update, options, (), [])
- # The hash always changes. Use a cheap trick.
- start = ('\n________ running \'git commit -am test\' in \'%s\'\n'
- '[new ') % join(self.root_dir, '.')
- end = ('] test\n 1 files changed, 1 insertions(+), '
- '1 deletions(-)\n\n_____ . at refs/heads/master\n'
- 'Attempting rebase onto refs/remotes/origin/master...\n')
- self.assertTrue(sys.stdout.getvalue().startswith(start))
- self.assertTrue(sys.stdout.getvalue().endswith(end))
- self.assertEquals(len(sys.stdout.getvalue()),
- len(start) + len(end) + 7)
sys.stdout.close()
def testUpdateNotGit(self):
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698