Chromium Code Reviews| Index: tests/gclient_scm_test.py |
| diff --git a/tests/gclient_scm_test.py b/tests/gclient_scm_test.py |
| index b864a85100209d3fe36895a1e97b76eb85a745f6..f93fb74f17fa5b65799535c28cbcc88260fddff6 100755 |
| --- a/tests/gclient_scm_test.py |
| +++ b/tests/gclient_scm_test.py |
| @@ -19,6 +19,7 @@ import __builtin__ |
| from super_mox import mox, StdoutCheck, TestCaseUtils, SuperMoxTestBase |
| import logging |
| +import re |
| import sys |
| import gclient_scm |
| @@ -738,25 +739,20 @@ from :3 |
| '069c602044c5388d2d15c3f875b057c852003458') |
| finally: |
| rmtree(root_dir) |
| - msg1 = ( |
| + msg_re = re.compile( |
| "\n_____ foo at refs/heads/master\n\n" |
| "________ running 'git clone -b master --verbose %s %s' in '%s'\n" |
| - "Initialized empty Git repository in %s\n") % ( |
| - join(self.root_dir, '.', '.git'), |
| - join(root_dir, 'foo'), |
| - root_dir, |
| - 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" |
| - "Cloning into %s...\ndone.\n") % ( |
| - join(self.root_dir, '.', '.git'), |
| - join(root_dir, 'foo'), |
| - root_dir, |
| - join(gclient_scm.os.path.realpath(root_dir), 'foo')) |
| + "(Initialized empty Git repository in " |
| + "|Cloning into )(%s|%s)(...\ndone.)?\n" % ( |
| + re.escape(join(self.root_dir, '.', '.git')), |
| + re.escape(join(root_dir, 'foo')), |
| + re.escape(root_dir), |
| + re.escape(join(gclient_scm.os.path.realpath(root_dir), |
| + 'foo', '.git')) + '/', |
| + re.escape(join(root_dir, 'foo')))) |
| out = sys.stdout.getvalue() |
| sys.stdout.close() |
| - self.assertTrue(out in (msg1, msg2), (out, msg1, msg2)) |
| + self.assertTrue(re.match(msg_re, out)) |
|
evanm
2011/02/28 22:35:11
Might be better to just set the --quiet flag and r
|
| def testUpdateUpdate(self): |
| if not self.enabled: |