Restore 103787 (fix git progress message), and update test expectations.
Review URL: http://codereview.chromium.org/8161009
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@104504 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/tests/gclient_scm_test.py b/tests/gclient_scm_test.py
index 21da096..6d5e380 100755
--- a/tests/gclient_scm_test.py
+++ b/tests/gclient_scm_test.py
@@ -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'),