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

Unified Diff: tests/gclient_scm_test.py

Issue 8161009: Restore 103787 (fix git progress message), and update test expectations. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools/
Patch Set: '' Created 9 years, 2 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 | « gclient_utils.py ('k') | tests/gclient_smoketest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/gclient_scm_test.py
===================================================================
--- tests/gclient_scm_test.py (revision 104354)
+++ tests/gclient_scm_test.py (working copy)
@@ -571,13 +571,13 @@
file_list = []
scm.diff(options, self.args, file_list)
self.assertEquals(file_list, [])
- self.checkstdout(
- ('\n_____ . at refs/heads/master\nUpdating 069c602..a7142dc\n'
+ 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, '.'))
+ 'HEAD is now at a7142dc Personalized\n') % join(self.root_dir, '.')
+ self.assertTrue(sys.stdout.getvalue().startswith(expectation))
+ sys.stdout.close()
def testRevertNone(self):
if not self.enabled:
@@ -618,13 +618,13 @@
self.assertEquals(file_list, [])
self.assertEquals(scm.revinfo(options, self.args, None),
'a7142dc9f0009350b96a11f372b6ea658592aa95')
- self.checkstdout(
- ('\n_____ . at refs/heads/master\nUpdating 069c602..a7142dc\n'
+ 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, '.'))
+ 'HEAD is now at a7142dc Personalized\n') % join(self.root_dir, '.')
+ self.assertTrue(sys.stdout.getvalue().startswith(expectation))
+ sys.stdout.close()
def testRevertNew(self):
if not self.enabled:
@@ -648,13 +648,13 @@
self.assertEquals(file_list, [])
self.assertEquals(scm.revinfo(options, self.args, None),
'a7142dc9f0009350b96a11f372b6ea658592aa95')
- self.checkstdout(
- ('\n_____ . at refs/heads/master\nUpdating 069c602..a7142dc\n'
+ 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, '.'))
+ 'HEAD is now at a7142dc Personalized\n') % join(self.root_dir, '.')
+ self.assertTrue(sys.stdout.getvalue().startswith(expectation))
+ sys.stdout.close()
def testStatusNew(self):
if not self.enabled:
@@ -713,7 +713,8 @@
rmtree(root_dir)
msg1 = (
"\n_____ foo at refs/heads/master\n\n"
- "________ running 'git clone -b master --verbose %s %s' in '%s'\n"
+ "________ running 'git clone --progress -b master --verbose %s %s' "
+ "in '%s'\n"
"Initialized empty Git repository in %s\n") % (
join(self.root_dir, '.', '.git'),
join(root_dir, 'foo'),
@@ -721,7 +722,8 @@
join(gclient_scm.os.path.realpath(root_dir), 'foo', '.git') + '/')
msg2 = (
"\n_____ foo at refs/heads/master\n\n"
- "________ running 'git clone -b master --verbose %s %s' in '%s'\n"
+ "________ running 'git clone --progress -b master --verbose %s %s'"
+ " in '%s'\n"
"Cloning into %s...\ndone.\n") % (
join(self.root_dir, '.', '.git'),
join(root_dir, 'foo'),
@@ -848,7 +850,8 @@
rmtree(root_dir)
msg1 = (
"\n_____ foo at refs/heads/master\n\n"
- "________ running 'git clone -b master --verbose %s %s' in '%s'\n"
+ "________ running 'git clone --progress -b master --verbose %s %s'"
+ " in '%s'\n"
"Initialized empty Git repository in %s\n") % (
join(self.root_dir, '.', '.git'),
join(root_dir, 'foo'),
@@ -856,7 +859,8 @@
join(gclient_scm.os.path.realpath(root_dir), 'foo', '.git') + '/')
msg2 = (
"\n_____ foo at refs/heads/master\n\n"
- "________ running 'git clone -b master --verbose %s %s' in '%s'\n"
+ "________ running 'git clone --progress -b master --verbose %s %s'"
+ " in '%s'\n"
"Cloning into %s...\ndone.\n") % (
join(self.root_dir, '.', '.git'),
join(root_dir, 'foo'),
« no previous file with comments | « gclient_utils.py ('k') | tests/gclient_smoketest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698