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

Side by Side Diff: tests/scm_unittest.py

Issue 3117039: Refactor SubprocessCallAndFilter() to remove positional arguments. (Closed)
Patch Set: Created 10 years, 4 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 unified diff | Download patch
« no previous file with comments | « tests/gclient_utils_test.py ('k') | trychange.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 # Copyright (c) 2010 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2010 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Unit tests for scm.py.""" 6 """Unit tests for scm.py."""
7 7
8 from shutil import rmtree 8 from shutil import rmtree
9 import tempfile 9 import tempfile
10 10
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 ('M ', 'build\\internal\\essential.vsprops'), 309 ('M ', 'build\\internal\\essential.vsprops'),
310 ('A + ', 'chrome\\app\\d'), 310 ('A + ', 'chrome\\app\\d'),
311 ('MM ', 'chrome\\app\\DEPS'), 311 ('MM ', 'chrome\\app\\DEPS'),
312 ('C ', 'scripts\\master\\factory\\gclient_factory.py'), 312 ('C ', 'scripts\\master\\factory\\gclient_factory.py'),
313 ] 313 ]
314 self.assertEquals(sorted(info), sorted(expected)) 314 self.assertEquals(sorted(info), sorted(expected))
315 315
316 def testRun(self): 316 def testRun(self):
317 param2 = 'bleh' 317 param2 = 'bleh'
318 scm.gclient_utils.SubprocessCall(['svn', 'foo', 'bar'], 318 scm.gclient_utils.SubprocessCall(['svn', 'foo', 'bar'],
319 param2).AndReturn(None) 319 cwd=param2).AndReturn(None)
320 self.mox.ReplayAll() 320 self.mox.ReplayAll()
321 scm.SVN.Run(['foo', 'bar'], param2) 321 scm.SVN.Run(['foo', 'bar'], cwd=param2)
322 322
323 def testCaptureStatusEmpty(self): 323 def testCaptureStatusEmpty(self):
324 text = r"""<?xml version="1.0"?> 324 text = r"""<?xml version="1.0"?>
325 <status> 325 <status>
326 <target 326 <target
327 path="perf"> 327 path="perf">
328 </target> 328 </target>
329 </status>""" 329 </status>"""
330 proc = self.mox.CreateMockAnything() 330 proc = self.mox.CreateMockAnything()
331 scm.gclient_utils.Popen(['svn', 'status', '--xml'], 331 scm.gclient_utils.Popen(['svn', 'status', '--xml'],
332 cwd=None, 332 cwd=None,
333 stderr=None, 333 stderr=None,
334 stdout=scm.subprocess.PIPE).AndReturn(proc) 334 stdout=scm.subprocess.PIPE).AndReturn(proc)
335 proc.communicate().AndReturn((text, 0)) 335 proc.communicate().AndReturn((text, 0))
336 self.mox.ReplayAll() 336 self.mox.ReplayAll()
337 info = scm.SVN.CaptureStatus(None) 337 info = scm.SVN.CaptureStatus(None)
338 self.assertEquals(info, []) 338 self.assertEquals(info, [])
339 339
340 340
341 if __name__ == '__main__': 341 if __name__ == '__main__':
342 import unittest 342 import unittest
343 unittest.main() 343 unittest.main()
344 344
345 # vim: ts=2:sw=2:tw=80:et: 345 # vim: ts=2:sw=2:tw=80:et:
OLDNEW
« no previous file with comments | « tests/gclient_utils_test.py ('k') | trychange.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698