#4640: Add optparse tests for '-xxx' invalid when defining options.
Patch by Aaron (hac.man).
This commit is contained in:
parent
7aa2c8baae
commit
6159e0956c
@ -318,6 +318,22 @@ class TestOptionChecks(BaseTest):
|
|||||||
["-b"], {'action': 'store',
|
["-b"], {'action': 'store',
|
||||||
'callback_kwargs': 'foo'})
|
'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):
|
class TestOptionParser(BaseTest):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.parser = OptionParser()
|
self.parser = OptionParser()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user