def test_normalize_errorlevel_illegal2(): with pytest.raises(encoder.ErrorLevelError): encoder.normalize_errorlevel(None)
def test_normalize_errorlevel(): assert consts.ERROR_LEVEL_H == encoder.normalize_errorlevel('h') assert consts.ERROR_LEVEL_Q == encoder.normalize_errorlevel('Q') assert None == encoder.normalize_errorlevel(None, accept_none=True) assert consts.ERROR_LEVEL_M == encoder.normalize_errorlevel(consts.ERROR_LEVEL_M)
def test_normalize_errorlevel_illegal2(): with pytest.raises(encoder.ErrorLevelError): encoder.normalize_errorlevel(None)
def test_normalize_errorlevel(): assert consts.ERROR_LEVEL_H == encoder.normalize_errorlevel('h') assert consts.ERROR_LEVEL_Q == encoder.normalize_errorlevel('Q') assert None == encoder.normalize_errorlevel(None, accept_none=True) assert consts.ERROR_LEVEL_M == encoder.normalize_errorlevel(consts.ERROR_LEVEL_M)
def test_normalize_errorlevel_illegal2(): with pytest.raises(ValueError) as ex: encoder.normalize_errorlevel(None) assert 'error' in str(ex.value)
def test_normalize_errorlevel_illegal(): with pytest.raises(ValueError): encoder.normalize_errorlevel('g')