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

Unified Diff: tests/gclient_test.py

Issue 8135019: Move all mutations into a specific place. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: address review comments 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.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/gclient_test.py
diff --git a/tests/gclient_test.py b/tests/gclient_test.py
index d883fc76126270819a6c9a6bd3cfcc7375559ac7..a3b0c115b176ccb5c73ae498c710d27888f9502e 100755
--- a/tests/gclient_test.py
+++ b/tests/gclient_test.py
@@ -212,33 +212,37 @@ class GclientTest(trial_dir.TestCase):
self.assertEquals('proto://host/path@revision', d.url)
def testStr(self):
- # Make sure __str__() works fine.
- # pylint: disable=W0212
parser = gclient.Parser()
options, _ = parser.parse_args([])
obj = gclient.GClient('foo', options)
- obj._dependencies.append(
- gclient.Dependency(obj, 'foo', 'url', None, None, None, None, 'DEPS',
- True))
- obj._dependencies.append(
- gclient.Dependency(obj, 'bar', 'url', None, None, None, None, 'DEPS',
- True))
- obj.dependencies[0]._dependencies.append(
- gclient.Dependency(
- obj.dependencies[0], 'foo/dir1', 'url', None, None, None, None,
- 'DEPS', True))
- obj.dependencies[0]._dependencies.append(
- gclient.Dependency(
- obj.dependencies[0], 'foo/dir2',
- gclient.GClientKeywords.FromImpl('bar'), None, None, None, None,
- 'DEPS', True))
- obj.dependencies[0]._dependencies.append(
- gclient.Dependency(
- obj.dependencies[0], 'foo/dir3',
- gclient.GClientKeywords.FileImpl('url'), None, None, None, None,
- 'DEPS', True))
+ obj.add_dependencies_and_close(
+ [
+ gclient.Dependency(
+ obj, 'foo', 'url', None, None, None, None, 'DEPS', True),
+ gclient.Dependency(
+ obj, 'bar', 'url', None, None, None, None, 'DEPS', True),
+ ],
+ [])
+ obj.dependencies[0].add_dependencies_and_close(
+ [
+ gclient.Dependency(
+ obj.dependencies[0], 'foo/dir1', 'url', None, None, None, None,
+ 'DEPS', True),
+ gclient.Dependency(
+ obj.dependencies[0], 'foo/dir2',
+ gclient.GClientKeywords.FromImpl('bar'), None, None, None, None,
+ 'DEPS', True),
+ gclient.Dependency(
+ obj.dependencies[0], 'foo/dir3',
+ gclient.GClientKeywords.FileImpl('url'), None, None, None, None,
+ 'DEPS', True),
+ ],
+ [])
+ # Make sure __str__() works fine.
+ # pylint: disable=W0212
obj.dependencies[0]._file_list.append('foo')
- self.assertEquals(434, len(str(obj)), '%d\n%s' % (len(str(obj)), str(obj)))
+ str_obj = str(obj)
+ self.assertEquals(472, len(str_obj), '%d\n%s' % (len(str_obj), str_obj))
if __name__ == '__main__':
« no previous file with comments | « gclient.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698