From b9bf98a3109ef08f2294a941a14aa7e8e0a712ca Mon Sep 17 00:00:00 2001 From: Laoraid Date: Sun, 5 Jan 2020 21:07:07 +0900 Subject: [PATCH] =?UTF-8?q?=EC=95=84=EC=9D=B4=EB=94=94=20=ED=8C=90?= =?UTF-8?q?=EB=B3=84=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- KartRider/utils.py | 5 +---- __about__.py | 2 +- tests/test_etc.py | 21 +++++++++++++++++++++ 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/KartRider/utils.py b/KartRider/utils.py index 9d89e6b..495b3ab 100644 --- a/KartRider/utils.py +++ b/KartRider/utils.py @@ -1,5 +1,4 @@ from datetime import datetime -import re from . import metadata as md @@ -41,9 +40,7 @@ def _isId(string): if ' ' in string: return False - ih = re.match('[ㄱ-ㅎㅏ-ㅣ가-힣]', string) - - if ih is None: + if len(string) >= 64: return True return False diff --git a/__about__.py b/__about__.py index 1077d12..14e0ccb 100644 --- a/__about__.py +++ b/__about__.py @@ -1,2 +1,2 @@ -__version__ = '0.4.0' +__version__ = '0.4.1' __author__ = 'Laoraid' \ No newline at end of file diff --git a/tests/test_etc.py b/tests/test_etc.py index 94e36bc..2b586ed 100644 --- a/tests/test_etc.py +++ b/tests/test_etc.py @@ -2,6 +2,7 @@ import pytest from KartRider import metadata from KartRider.user import User +from KartRider import utils metadata.set_metadatapath(os.path.join('tests', 'metadata')) @@ -51,3 +52,23 @@ def test_gets(): assert nme in metadata.getCharacters() assert itlo in metadata.getgameTypes() + + +def test_isid(): + c = metadata.getCharacters() + f = metadata.getflyingPets() + t = metadata.getTracks() + + keys = [] + keys.extend(c.keys()) + keys.extend(f.keys()) + keys.extend(t.keys()) + + values = [] + values.extend(c.values()) + values.extend(f.values()) + values.extend(t.values()) + + for k, v in zip(keys, values): + assert utils._isId(k) + assert not utils._isId(v)