cgrok / clashroyale

Async + Sync wrapper for royaleapi.com and the CR official API
MIT License
47 stars 19 forks source link

Fix crtag length validation #34

Closed gogaz closed 3 years ago

gogaz commented 4 years ago

Changes Description

Current behaviour:

>>> player = api_client.get_player('8029R')
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "clashroyale/royaleapi/utils.py", line 30, in wrapper
    new_args.append(converter(a))
  File "clashroyale/royaleapi/utils.py", line 85, in crtag
    raise ValueError('Tag ({}) too short, length {}, expected 3'.format(tag[3:], len(tag[3:])))
ValueError: Tag (9R) too short, length 2, expected 3

Expected behaviour:

>>> player = api_client.get_player('8029R')
>>> player.name
'mickey'

Type of PR

Checklist