Skip to content

Commit

Permalink
The third parameter to ZshArgumentsGenerator.__init__() must be a fil…
Browse files Browse the repository at this point in the history
…e-like object, not a string.
  • Loading branch information
rodrigc committed Nov 25, 2017
1 parent 03dcdfb commit 7c7d901
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/twisted/python/test/test_shellcomp.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def test_accumulateMetadata(self):
picked up correctly?
"""
opts = FighterAceExtendedOptions()
ag = _shellcomp.ZshArgumentsGenerator(opts, 'ace', 'dummy_value')
ag = _shellcomp.ZshArgumentsGenerator(opts, 'ace', BytesIO())

descriptions = FighterAceOptions.compData.descriptions.copy()
descriptions.update(FighterAceExtendedOptions.compData.descriptions)
Expand Down Expand Up @@ -173,7 +173,7 @@ class OddFighterAceOptions(FighterAceExtendedOptions):
'spad', 'bristol']])

opts = OddFighterAceOptions()
ag = _shellcomp.ZshArgumentsGenerator(opts, 'ace', 'dummy_value')
ag = _shellcomp.ZshArgumentsGenerator(opts, 'ace', BytesIO())

expected = {
'albatros': set(['anatra', 'b', 'bristol', 'f',
Expand All @@ -197,7 +197,7 @@ def test_accumulateAdditionalOptions(self):
e.g. def opt_foo(self, foo)
"""
opts = FighterAceExtendedOptions()
ag = _shellcomp.ZshArgumentsGenerator(opts, 'ace', 'dummy_value')
ag = _shellcomp.ZshArgumentsGenerator(opts, 'ace', BytesIO())

self.assertIn('nocrash', ag.flagNameToDefinition)
self.assertIn('nocrash', ag.allOptionsNameToDefinition)
Expand All @@ -216,7 +216,7 @@ class TmpOptions(FighterAceExtendedOptions):
compData = Completions(optActions={'detaill' : None})

self.assertRaises(ValueError, _shellcomp.ZshArgumentsGenerator,
TmpOptions(), 'ace', 'dummy_value')
TmpOptions(), 'ace', BytesIO())

class TmpOptions2(FighterAceExtendedOptions):
# Note that 'foo' and 'bar' are not real option
Expand All @@ -225,7 +225,7 @@ class TmpOptions2(FighterAceExtendedOptions):
mutuallyExclusive=[("foo", "bar")])

self.assertRaises(ValueError, _shellcomp.ZshArgumentsGenerator,
TmpOptions2(), 'ace', 'dummy_value')
TmpOptions2(), 'ace', BytesIO())


def test_zshCode(self):
Expand Down

0 comments on commit 7c7d901

Please sign in to comment.