Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(4)

Side by Side Diff: Lib/test/test_optparse.py

Issue 10639: reindent.py converts newlines to platform default
Patch Set: Created 8 years, 8 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Lib/test/test_multiprocessing.py ('k') | Lib/test/test_os.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 # 1 #
2 # Test suite for Optik. Supplied by Johannes Gijsbers 2 # Test suite for Optik. Supplied by Johannes Gijsbers
3 # (taradino@softhome.net) -- translated from the original Optik 3 # (taradino@softhome.net) -- translated from the original Optik
4 # test suite to this PyUnit-based version. 4 # test suite to this PyUnit-based version.
5 # 5 #
6 # $Id$ 6 # $Id$
7 # 7 #
8 8
9 import sys 9 import sys
10 import os 10 import os
(...skipping 1005 matching lines...) Expand 10 before | Expand all | Expand 10 after
1016 raise OptionValueError("%s: file does not exist" % value) 1016 raise OptionValueError("%s: file does not exist" % value)
1017 elif not os.path.isfile(value): 1017 elif not os.path.isfile(value):
1018 raise OptionValueError("%s: not a regular file" % value) 1018 raise OptionValueError("%s: not a regular file" % value)
1019 return value 1019 return value
1020 1020
1021 TYPES = Option.TYPES + ("file",) 1021 TYPES = Option.TYPES + ("file",)
1022 TYPE_CHECKER = copy.copy(Option.TYPE_CHECKER) 1022 TYPE_CHECKER = copy.copy(Option.TYPE_CHECKER)
1023 TYPE_CHECKER["file"] = check_file 1023 TYPE_CHECKER["file"] = check_file
1024 1024
1025 def test_filetype_ok(self): 1025 def test_filetype_ok(self):
1026 support.create_empty_file(support.TESTFN) 1026 open(support.TESTFN, "w").close()
1027 self.assertParseOK(["--file", support.TESTFN, "-afoo"], 1027 self.assertParseOK(["--file", support.TESTFN, "-afoo"],
1028 {'file': support.TESTFN, 'a': 'foo'}, 1028 {'file': support.TESTFN, 'a': 'foo'},
1029 []) 1029 [])
1030 1030
1031 def test_filetype_noexist(self): 1031 def test_filetype_noexist(self):
1032 self.assertParseFail(["--file", support.TESTFN, "-afoo"], 1032 self.assertParseFail(["--file", support.TESTFN, "-afoo"],
1033 "%s: file does not exist" % 1033 "%s: file does not exist" %
1034 support.TESTFN) 1034 support.TESTFN)
1035 1035
1036 def test_filetype_notfile(self): 1036 def test_filetype_notfile(self):
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after
1596 "option -l: invalid integer value: '0b0123'") 1596 "option -l: invalid integer value: '0b0123'")
1597 self.assertParseFail(["-l", "0x12x"], 1597 self.assertParseFail(["-l", "0x12x"],
1598 "option -l: invalid integer value: '0x12x'") 1598 "option -l: invalid integer value: '0x12x'")
1599 1599
1600 1600
1601 def test_main(): 1601 def test_main():
1602 support.run_unittest(__name__) 1602 support.run_unittest(__name__)
1603 1603
1604 if __name__ == '__main__': 1604 if __name__ == '__main__':
1605 test_main() 1605 test_main()
OLDNEW
« no previous file with comments | « Lib/test/test_multiprocessing.py ('k') | Lib/test/test_os.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+