Skip to content

Commit

Permalink
아이디 판별 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
laoraid committed Jan 5, 2020
1 parent 6c973d6 commit b9bf98a
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
5 changes: 1 addition & 4 deletions KartRider/utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from datetime import datetime
import re
from . import metadata as md


Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion __about__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__version__ = '0.4.0'
__version__ = '0.4.1'
__author__ = 'Laoraid'
21 changes: 21 additions & 0 deletions tests/test_etc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'))
Expand Down Expand Up @@ -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)

0 comments on commit b9bf98a

Please sign in to comment.