# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Test cases for L{twisted.logger._levels}. """ from twisted.trial import unittest from .._levels import InvalidLogLevelError from .._levels import LogLevel class LogLevelTests(unittest.TestCase): """ Tests for L{LogLevel}. """ def test_levelWithName(self): """ Look up log level by name. """ for level in LogLevel.iterconstants(): self.assertIs(LogLevel.levelWithName(level.name), level) def test_levelWithInvalidName(self): """ You can't make up log level names. """ bogus = "*bogus*" try: LogLevel.levelWithName(bogus) except InvalidLogLevelError as e: self.assertIs(e.level, bogus) else: self.fail("Expected InvalidLogLevelError.")
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
__pycache__ | Folder | 0755 |
|
|
__init__.py | File | 161 B | 0644 |
|
test_buffer.py | File | 1.6 KB | 0644 |
|
test_file.py | File | 5.49 KB | 0644 |
|
test_filter.py | File | 11.73 KB | 0644 |
|
test_flatten.py | File | 8.92 KB | 0644 |
|
test_format.py | File | 12.37 KB | 0644 |
|
test_global.py | File | 11.23 KB | 0644 |
|
test_io.py | File | 7.04 KB | 0644 |
|
test_json.py | File | 18.15 KB | 0644 |
|
test_legacy.py | File | 14.06 KB | 0644 |
|
test_levels.py | File | 875 B | 0644 |
|
test_logger.py | File | 7.18 KB | 0644 |
|
test_observer.py | File | 5.13 KB | 0644 |
|
test_stdlib.py | File | 8.44 KB | 0644 |
|
test_util.py | File | 2.61 KB | 0644 |
|