test for duplicated kwargs

This commit is contained in:
Victor Shyba 2020-09-03 15:54:35 -03:00
parent 7304d24dfd
commit 382facf264

View file

@ -33,6 +33,11 @@ class FakeAPI:
def thing_update(self, value1: str) -> Wallet: # updated wallet def thing_update(self, value1: str) -> Wallet: # updated wallet
"""update command doc""" """update command doc"""
def thing_search(
self,
**claim_filter_and_signed_filter_and_stream_filter_and_pagination_kwargs):
"""search command doc"""
def thing_delete(self, value1: str, **tx_and_pagination_kwargs) -> Wallet: # deleted thing def thing_delete(self, value1: str, **tx_and_pagination_kwargs) -> Wallet: # deleted thing
""" """
delete command doc delete command doc
@ -60,6 +65,11 @@ class FakeAPI:
class TestParser(TestCase): class TestParser(TestCase):
maxDiff = None maxDiff = None
def test_parse_does_not_duplicate_arguments(self):
parsed = parse_method(FakeAPI.thing_search, get_expanders())
names = [arg['name'] for arg in parsed['arguments']]
self.assertEqual(len(names), len(set(names)))
def test_parse_method(self): def test_parse_method(self):
expanders = get_expanders() expanders = get_expanders()
self.assertEqual( self.assertEqual(