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

Unified Diff: tests/gclient_test.py

Issue 115264: Deprecate gcl.GetSVNStatus() for gclient.CaptureSVNStatus() and fix some stat... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools/
Patch Set: '' Created 11 years, 7 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 | « tests/gcl_unittest.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
===================================================================
--- tests/gclient_test.py (revision 15891)
+++ tests/gclient_test.py (working copy)
@@ -1159,8 +1159,8 @@
gclient.os.path.isdir = self.mox.CreateMockAnything()
gclient.os.path.isdir(base_path).AndReturn(True)
items = [
- gclient.FileStatus('a', 'M', ' ', ' ', ' '),
- gclient.FileStatus('b', 'A', ' ', ' ', ' '),
+ ('M ', 'a'),
+ ('A ', 'b'),
]
gclient.CaptureSVNStatus(base_path).AndReturn(items)
@@ -1387,7 +1387,74 @@
self.assertEquals(capture_list, ['cc', 'dd'])
self.mox.VerifyAll()
+ def testCaptureSVNStatus(self):
+ x = self
+ def CaptureSVNMock(command):
+ x.assertEquals(['status', '--xml', '.'], command)
+ return r"""<?xml version="1.0"?>
+<status>
+<target path=".">
+<entry path="unversionned_file.txt">
+<wc-status props="none" item="unversioned"></wc-status>
+</entry>
+<entry path="build\internal\essential.vsprops">
+<wc-status props="normal" item="modified" revision="14628">
+<commit revision="13818">
+<author>ajwong@chromium.org</author>
+<date>2009-04-16T00:42:06.872358Z</date>
+</commit>
+</wc-status>
+</entry>
+<entry path="chrome\app\d">
+<wc-status props="none" copied="true" tree-conflicted="true" item="added">
+</wc-status>
+</entry>
+<entry path="chrome\app\DEPS">
+<wc-status props="modified" item="modified" revision="14628">
+<commit revision="1279">
+<author>brettw@google.com</author>
+<date>2008-08-23T17:16:42.090152Z</date>
+</commit>
+</wc-status>
+</entry>
+<entry path="scripts\master\factory\gclient_factory.py">
+<wc-status props="normal" item="conflicted" revision="14725">
+<commit revision="14633">
+<author>nsylvain@chromium.org</author>
+<date>2009-04-27T19:37:17.977400Z</date>
+</commit>
+</wc-status>
+</entry>
+</target>
+</status>
+"""
+ gclient.CaptureSVN = CaptureSVNMock
+ info = gclient.CaptureSVNStatus('.')
+ expected = [
+ ('? ', 'unversionned_file.txt'),
+ ('M ', 'build\\internal\\essential.vsprops'),
+ ('A + ', 'chrome\\app\\d'),
+ ('MM ', 'chrome\\app\\DEPS'),
+ ('C ', 'scripts\\master\\factory\\gclient_factory.py'),
+ ]
+ self.assertEquals(sorted(info), sorted(expected))
+ def testCaptureSVNStatusEmpty(self):
+ x = self
+ def CaptureSVNMock(command):
+ x.assertEquals(['status', '--xml'], command)
+ return r"""<?xml version="1.0"?>
+<status>
+<target
+ path="perf">
+</target>
+</status>
+"""
+ gclient.CaptureSVN = CaptureSVNMock
+ info = gclient.CaptureSVNStatus(None)
+ self.assertEquals(info, [])
+
+
if __name__ == '__main__':
unittest.main()
« no previous file with comments | « tests/gcl_unittest.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698