diff options
-rw-r--r-- | pygments/lexers/text.py | 4 | ||||
-rw-r--r-- | tests/test_basic_api.py | 5 |
2 files changed, 6 insertions, 3 deletions
diff --git a/pygments/lexers/text.py b/pygments/lexers/text.py index e93f7435..adee57e4 100644 --- a/pygments/lexers/text.py +++ b/pygments/lexers/text.py @@ -55,8 +55,8 @@ class SourcesListLexer(RegexLexer): Lex debian sources.list files """ name= 'Debian Sourcelist' - aliases = ('sourceslist', 'sources.list') - filenames = ('sources.list',) + aliases = ['sourceslist', 'sources.list'] + filenames = ['sources.list'] tokens = { 'root': [ 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) |