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
def test_convert_logging_bad(self): with pytest.raises(ValueError): bs.convert_logging("junk")
def test_convert_logging_identity(self, value): level = getattr(logging, value) assert bs.convert_logging(level) == level
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)