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

Side by Side Diff: tests/gclient_test.py

Issue 113288: Add a flag not print errors in CaptureSVN() (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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « gclient.py ('k') | no next file » | 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 # 2 #
3 # Copyright 2008-2009 Google Inc. All Rights Reserved. 3 # Copyright 2008-2009 Google Inc. All Rights Reserved.
4 # 4 #
5 # Licensed under the Apache License, Version 2.0 (the "License"); 5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License. 6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at 7 # You may obtain a copy of the License at
8 # 8 #
9 # http://www.apache.org/licenses/LICENSE-2.0 9 # http://www.apache.org/licenses/LICENSE-2.0
10 # 10 #
(...skipping 1255 matching lines...) Expand 10 before | Expand all | Expand 10 after
1266 <wc-info> 1266 <wc-info>
1267 <schedule>add</schedule> 1267 <schedule>add</schedule>
1268 <depth>infinity</depth> 1268 <depth>infinity</depth>
1269 <copy-from-url>http://src.chromium.org/svn/trunk/src/chrome/app/DEPS</copy-from- url> 1269 <copy-from-url>http://src.chromium.org/svn/trunk/src/chrome/app/DEPS</copy-from- url>
1270 <copy-from-rev>14628</copy-from-rev> 1270 <copy-from-rev>14628</copy-from-rev>
1271 <checksum>369f59057ba0e6d9017e28f8bdfb1f43</checksum> 1271 <checksum>369f59057ba0e6d9017e28f8bdfb1f43</checksum>
1272 </wc-info> 1272 </wc-info>
1273 </entry> 1273 </entry>
1274 </info> 1274 </info>
1275 """ % self.url 1275 """ % self.url
1276 gclient.CaptureSVN(['info', '--xml', self.url], '.').AndReturn(xml_text) 1276 gclient.CaptureSVN(['info', '--xml', self.url],
1277 '.', True).AndReturn(xml_text)
1277 expected = { 1278 expected = {
1278 'URL': 'http://src.chromium.org/svn/trunk/src/chrome/app/d', 1279 'URL': 'http://src.chromium.org/svn/trunk/src/chrome/app/d',
1279 'UUID': None, 1280 'UUID': None,
1280 'Repository Root': 'http://src.chromium.org/svn', 1281 'Repository Root': 'http://src.chromium.org/svn',
1281 'Schedule': 'add', 1282 'Schedule': 'add',
1282 'Copied From URL': 'http://src.chromium.org/svn/trunk/src/chrome/app/DEPS' , 1283 'Copied From URL': 'http://src.chromium.org/svn/trunk/src/chrome/app/DEPS' ,
1283 'Copied From Rev': '14628', 1284 'Copied From Rev': '14628',
1284 'Path': self.url, 1285 'Path': self.url,
1285 'Revision': 14628, 1286 'Revision': 14628,
1286 'Node Kind': 'file', 1287 'Node Kind': 'file',
1287 } 1288 }
1288 self.mox.ReplayAll() 1289 self.mox.ReplayAll()
1289 file_info = self._CaptureSVNInfo(self.url, '.') 1290 file_info = self._CaptureSVNInfo(self.url, '.', True)
1290 self.assertEquals(sorted(file_info.items()), sorted(expected.items())) 1291 self.assertEquals(sorted(file_info.items()), sorted(expected.items()))
1291 self.mox.VerifyAll() 1292 self.mox.VerifyAll()
1292 1293
1293 def testCaptureSvnInfo(self): 1294 def testCaptureSvnInfo(self):
1294 xml_text = """<?xml version="1.0"?> 1295 xml_text = """<?xml version="1.0"?>
1295 <info> 1296 <info>
1296 <entry 1297 <entry
1297 kind="dir" 1298 kind="dir"
1298 path="." 1299 path="."
1299 revision="35"> 1300 revision="35">
1300 <url>%s</url> 1301 <url>%s</url>
1301 <repository> 1302 <repository>
1302 <root>%s</root> 1303 <root>%s</root>
1303 <uuid>7b9385f5-0452-0410-af26-ad4892b7a1fb</uuid> 1304 <uuid>7b9385f5-0452-0410-af26-ad4892b7a1fb</uuid>
1304 </repository> 1305 </repository>
1305 <wc-info> 1306 <wc-info>
1306 <schedule>normal</schedule> 1307 <schedule>normal</schedule>
1307 <depth>infinity</depth> 1308 <depth>infinity</depth>
1308 </wc-info> 1309 </wc-info>
1309 <commit 1310 <commit
1310 revision="35"> 1311 revision="35">
1311 <author>maruel</author> 1312 <author>maruel</author>
1312 <date>2008-12-04T20:12:19.685120Z</date> 1313 <date>2008-12-04T20:12:19.685120Z</date>
1313 </commit> 1314 </commit>
1314 </entry> 1315 </entry>
1315 </info> 1316 </info>
1316 """ % (self.url, self.root_dir) 1317 """ % (self.url, self.root_dir)
1317 gclient.CaptureSVN(['info', '--xml', self.url], '.').AndReturn(xml_text) 1318 gclient.CaptureSVN(['info', '--xml', self.url],
1319 '.', True).AndReturn(xml_text)
1318 self.mox.ReplayAll() 1320 self.mox.ReplayAll()
1319 file_info = self._CaptureSVNInfo(self.url, '.') 1321 file_info = self._CaptureSVNInfo(self.url, '.', True)
1320 expected = { 1322 expected = {
1321 'URL': self.url, 1323 'URL': self.url,
1322 'UUID': '7b9385f5-0452-0410-af26-ad4892b7a1fb', 1324 'UUID': '7b9385f5-0452-0410-af26-ad4892b7a1fb',
1323 'Revision': 35, 1325 'Revision': 35,
1324 'Repository Root': self.root_dir, 1326 'Repository Root': self.root_dir,
1325 'Schedule': 'normal', 1327 'Schedule': 'normal',
1326 'Copied From URL': None, 1328 'Copied From URL': None,
1327 'Copied From Rev': None, 1329 'Copied From Rev': None,
1328 'Path': '.', 1330 'Path': '.',
1329 'Node Kind': 'dir', 1331 'Node Kind': 'dir',
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
1383 gclient.SubprocessCallAndCapture(command, in_directory, fail_status, 1385 gclient.SubprocessCallAndCapture(command, in_directory, fail_status,
1384 pattern, capture_list) 1386 pattern, capture_list)
1385 self.assertEquals(capture_list, ['cc', 'dd']) 1387 self.assertEquals(capture_list, ['cc', 'dd'])
1386 self.mox.VerifyAll() 1388 self.mox.VerifyAll()
1387 1389
1388 1390
1389 if __name__ == '__main__': 1391 if __name__ == '__main__':
1390 unittest.main() 1392 unittest.main()
1391 1393
1392 # vim: ts=2:sw=2:tw=80:et: 1394 # vim: ts=2:sw=2:tw=80:et:
OLDNEW
« 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