Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
6159e095
Commit
6159e095
authored
Jul 15, 2012
by
R David Murray
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#4640: Add optparse tests for '-xxx' invalid when defining options.
Patch by Aaron (hac.man).
parent
7aa2c8ba
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
Lib/test/test_optparse.py
Lib/test/test_optparse.py
+16
-0
No files found.
Lib/test/test_optparse.py
View file @
6159e095
...
...
@@ -318,6 +318,22 @@ class TestOptionChecks(BaseTest):
[
"-b"
],
{
'action'
:
'store'
,
'callback_kwargs'
:
'foo'
})
def
test_no_single_dash
(
self
):
self
.
assertOptionError
(
"invalid long option string '-debug': "
"must start with --, followed by non-dash"
,
[
"-debug"
])
self
.
assertOptionError
(
"option -d: invalid long option string '-debug': must start with"
" --, followed by non-dash"
,
[
"-d"
,
"-debug"
])
self
.
assertOptionError
(
"invalid long option string '-debug': "
"must start with --, followed by non-dash"
,
[
"-debug"
,
"--debug"
])
class
TestOptionParser
(
BaseTest
):
def
setUp
(
self
):
self
.
parser
=
OptionParser
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment