def test_special_cases(self): # type: () -> None self.assert_tokenize('dictionary-itemiterator', 'DottedName(Iterator) End()') self.assert_tokenize('dictionary-keyiterator', 'DottedName(Iterator) End()') self.assert_tokenize('dictionary-valueiterator', 'DottedName(Iterator) End()') with self.assertRaises(ParseError): tokenize('foo-bar')
def assert_tokenize(self, s, expected): # type: (str, str) -> None tokens = tokenize(s) actual = ' '.join(str(t) for t in tokens) assert actual == expected