Пример #1
0
    def test_convert_logging_none(self):
        assert bs.convert_logging("NONE") == None

        # check lowercase works
        assert bs.convert_logging("none") == None

        # check value works
        assert bs.convert_logging(None) == None
Пример #2
0
 def test_convert_logging_bad(self):
     with pytest.raises(ValueError):
         bs.convert_logging("junk")
Пример #3
0
 def test_convert_logging_identity(self, value):
     level = getattr(logging, value)
     assert bs.convert_logging(level) == level
Пример #4
0
    def test_convert_logging_good(self, value):
        assert bs.convert_logging(value) == getattr(logging, value)

        # check lowercase works too
        assert bs.convert_logging(value.lower()) == getattr(logging, value)