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

Side by Side Diff: tests/patch_test.py

Issue 7054057: Add support for empty files, __init__.py is a common example. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 9 years, 6 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 | « rietveld.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/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2011 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 patch.py.""" 6 """Unit tests for patch.py."""
7 7
8 import logging 8 import logging
9 import os 9 import os
10 import sys 10 import sys
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 diff = ( 505 diff = (
506 'diff --git a/natsort_test.py b/natsort_test.py\n' 506 'diff --git a/natsort_test.py b/natsort_test.py\n'
507 'new file mode 100755\n' 507 'new file mode 100755\n'
508 '--- /dev/null\n' 508 '--- /dev/null\n'
509 '+++ b/natsort_test.py\n' 509 '+++ b/natsort_test.py\n'
510 '@@ -0,0 +1,1 @@\n' 510 '@@ -0,0 +1,1 @@\n'
511 '+#!/usr/bin/env python\n') 511 '+#!/usr/bin/env python\n')
512 self.assertEquals( 512 self.assertEquals(
513 [('svn:executable', '*')], 513 [('svn:executable', '*')],
514 patch.FilePatchDiff('natsort_test.py', diff, []).svn_properties) 514 patch.FilePatchDiff('natsort_test.py', diff, []).svn_properties)
515 diff = (
516 'diff --git a/natsort_test.py b/natsort_test.py\n'
517 'new file mode 100644\n'
518 '--- /dev/null\n'
519 '+++ b/natsort_test.py\n'
520 '@@ -0,0 +1,1 @@\n'
521 '+#!/usr/bin/env python\n')
522 self.assertEquals(
523 [], patch.FilePatchDiff('natsort_test.py', diff, []).svn_properties)
515 524
516 525
517 if __name__ == '__main__': 526 if __name__ == '__main__':
518 logging.basicConfig(level= 527 logging.basicConfig(level=
519 [logging.WARNING, logging.INFO, logging.DEBUG][ 528 [logging.WARNING, logging.INFO, logging.DEBUG][
520 min(2, sys.argv.count('-v'))]) 529 min(2, sys.argv.count('-v'))])
521 unittest.main() 530 unittest.main()
OLDNEW
« no previous file with comments | « rietveld.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698