Always handle claim_name as a string

This commit is contained in:
Miroslav Kovar 2019-09-20 19:29:41 +02:00 committed by Lex Berezhny
parent 965972a719
commit 9fbc83fe9d
2 changed files with 2 additions and 1 deletions

View file

@ -45,7 +45,7 @@ async def execute_command(conf, method, params, callback=display):
def normalize_value(x, key=None):
if not isinstance(x, str):
return x
if key in ('uri', 'channel_name', 'name', 'file_name', 'download_directory'):
if key in ('uri', 'channel_name', 'name', 'file_name', 'claim_name', 'download_directory'):
return x
if x.lower() == 'true':
return True

View file

@ -51,6 +51,7 @@ class CLITest(AsyncioTestCase):
self.assertEqual('3', normalize_value('3', key="name"))
self.assertEqual('3', normalize_value('3', key="download_directory"))
self.assertEqual('3', normalize_value('3', key="channel_name"))
self.assertEqual('3', normalize_value('3', key="claim_name"))
self.assertEqual(3, normalize_value('3', key="some_other_thing"))