コード例 #1
0
def test_int_log_level():
    assert int_log_level('debug') == 10
    assert int_log_level('DEBUG') == 10
    assert int_log_level('info') == 20
    assert int_log_level('warning') == 30
    with pytest.raises(ValueError):
        int_log_level('foo')
    with pytest.raises(ValueError):
        int_log_level(None)
    with pytest.raises(ValueError):
        int_log_level('')
コード例 #2
0
 def log_level(self):
     """Get `logger`s internal int level from config string."""
     return int_log_level(self.get('log_level'))