def match(string, token): assert tokenize([string]) == [(token, string), ('ENDMARKER', ''), None]
def test_sequence(): assert tokenize(['a', '123']) == [('NAME', 'a'), ('INT', '123'), ('ENDMARKER', ''), None]
def test_keywords(): for keyword in KEYWORDS: assert tokenize([keyword]) == [(keyword.upper(), keyword), ('ENDMARKER', ''), None]
def test_empty(): assert tokenize([]) == [('ENDMARKER', ''), None]
def test_colon(): match(':', 'COLON') assert tokenize([':']) == [('COLON', ':'), ('ENDMARKER', ''), None]