Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

Commit

Permalink
Merge pull request #9 from elcaminoreal/fix-attrs-error
Browse files Browse the repository at this point in the history
Fix attrs error
  • Loading branch information
moshez committed Nov 11, 2019
2 parents c1dc208 + 0f21d67 commit 4bf5418
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion src/caparg/_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ class _OptionList(object):

"""List of options"""

_options = attr.ib(convert=lambda x:
_options = attr.ib(converter=lambda x:
pyrsistent.pvector(value.with_name(key)
for key, value in x.items()))

Expand Down
2 changes: 1 addition & 1 deletion src/caparg/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@

from incremental import Version

__version__ = Version('caparg', 17, 12, 3)
__version__ = Version('caparg', 19, 11, 0)
__all__ = ["__version__"]
36 changes: 18 additions & 18 deletions src/caparg/test/test_subcommands.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ def test_simple(self):
caparg.positional('what',
type=str)))
parsed = dict(simple.parse(['drink', 'something']))
self.assertEquals(parsed.pop('what'), 'something')
self.assertEquals(list(parsed.pop('__caparg_subcommand__')),
['drink'])
self.assertEquals(parsed, {})
self.assertEqual(parsed.pop('what'), 'something')
self.assertEqual(list(parsed.pop('__caparg_subcommand__')),
['drink'])
self.assertEqual(parsed, {})

def test_evolution(self):
"""
Expand All @@ -35,9 +35,9 @@ def test_evolution(self):
drink = eat.rename('drink')
simple = caparg.command('', drink)
parsed = dict(simple.parse(['drink']))
self.assertEquals(list(parsed.pop('__caparg_subcommand__')),
['drink'])
self.assertEquals(parsed, {})
self.assertEqual(list(parsed.pop('__caparg_subcommand__')),
['drink'])
self.assertEqual(parsed, {})

def test_optional(self):
"""
Expand All @@ -47,9 +47,9 @@ def test_optional(self):
caparg.command('eat',
what=caparg.option(type=str)))
parsed = dict(simple.parse(['eat']))
self.assertEquals(list(parsed.pop('__caparg_subcommand__')),
['eat'])
self.assertEquals(parsed, {})
self.assertEqual(list(parsed.pop('__caparg_subcommand__')),
['eat'])
self.assertEqual(parsed, {})

def test_inherit(self):
"""
Expand All @@ -60,10 +60,10 @@ def test_inherit(self):
caparg.command('eat',
caparg.command('lunch')))
parsed = dict(simple.parse(['eat', 'lunch', '--where', 'cafe']))
self.assertEquals(list(parsed.pop('__caparg_subcommand__')),
['eat', 'lunch'])
self.assertEquals(parsed.pop('where'), 'cafe')
self.assertEquals(parsed, {})
self.assertEqual(list(parsed.pop('__caparg_subcommand__')),
['eat', 'lunch'])
self.assertEqual(parsed.pop('where'), 'cafe')
self.assertEqual(parsed, {})

def test_no_required(self):
"""
Expand Down Expand Up @@ -113,7 +113,7 @@ def test_default(self):
command('eat',
where=option(type=str,
have_default=True)))
self.assertEquals(simple.parse(['eat'])['where'], '')
self.assertEqual(simple.parse(['eat'])['where'], '')

def test_dashes(self):
"""
Expand All @@ -125,7 +125,7 @@ def test_dashes(self):
command('do_it',
good_thing=option(type=str)))
parsed = simple.parse(['do-it', '--good-thing', 'stuff'])
self.assertEquals(parsed['good_thing'], 'stuff')
self.assertEqual(parsed['good_thing'], 'stuff')

def test_list_str(self):
"""
Expand All @@ -137,7 +137,7 @@ def test_list_str(self):
command('eat',
what=option(type=List[str])))
parsed = simple.parse(['eat', '--what', 'rice', '--what', 'beans'])
self.assertEquals(parsed['what'], ['rice', 'beans'])
self.assertEqual(parsed['what'], ['rice', 'beans'])

def test_empty_list_str(self):
"""
Expand All @@ -162,4 +162,4 @@ def test_empty_list_str_default(self):
what=option(type=List[str],
have_default=True)))
parsed = simple.parse(['eat'])
self.assertEquals(list(parsed['what']), [])
self.assertEqual(list(parsed['what']), [])

0 comments on commit 4bf5418

Please sign in to comment.