diff options
Diffstat (limited to 'tests/test_basic_api.py')
-rw-r--r-- | tests/test_basic_api.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/test_basic_api.py b/tests/test_basic_api.py index 05371130..2a967317 100644 --- a/tests/test_basic_api.py +++ b/tests/test_basic_api.py @@ -31,8 +31,11 @@ class LexersTest(unittest.TestCase): ae = self.assertEquals # test that every lexer class has the correct public API for lexer in lexers._iter_lexerclasses(): - for attr in 'name', 'aliases', 'filenames', 'alias_filenames', 'mimetypes': + a(type(lexer.name) is str) + for attr in 'aliases', 'filenames', 'alias_filenames', 'mimetypes': a(hasattr(lexer, attr)) + a(type(getattr(lexer, attr)) is list, "%s: %s attribute wrong" % + (lexer, attr)) result = lexer.analyse_text("abc") a(isinstance(result, float) and 0.0 <= result <= 1.0) |