Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_sanitize_function_name():
assert sanitize_function_name('foobar()') == 'foobar'
assert sanitize_function_name('hastme') is None
assert sanitize_function_name(42) is None
assert sanitize_function_name(None) is None
def test_sanitize_function_name():
assert sanitize_function_name('foobar()') == 'foobar'
assert sanitize_function_name('hastme') is None
assert sanitize_function_name(42) is None
assert sanitize_function_name(None) is None
def test_sanitize_function_name():
assert sanitize_function_name('foobar()') == 'foobar'
assert sanitize_function_name('hastme') is None
assert sanitize_function_name(42) is None
assert sanitize_function_name(None) is None
def test_sanitize_function_name():
assert sanitize_function_name('foobar()') == 'foobar'
assert sanitize_function_name('hastme') is None
assert sanitize_function_name(42) is None
assert sanitize_function_name(None) is None
def test_asbool():
assert asbool(True) is True
assert asbool(False) is False
assert asbool(None) is False
assert asbool('true') is True
assert asbool('false') is False
assert asbool('yes') is True
assert asbool('no') is False
assert asbool('on') is True
assert asbool('off') is False
with pytest.raises(ValueError) as excinfo:
asbool('Hotzenplotz')
assert str(excinfo.value) == "String is not true/false: 'hotzenplotz'"
def test_asbool():
assert asbool(True) is True
assert asbool(False) is False
assert asbool(None) is False
assert asbool('true') is True
assert asbool('false') is False
assert asbool('yes') is True
assert asbool('no') is False
assert asbool('on') is True
assert asbool('off') is False
with pytest.raises(ValueError) as excinfo:
asbool('Hotzenplotz')
assert str(excinfo.value) == "String is not true/false: 'hotzenplotz'"
def test_asbool():
assert asbool(True) is True
assert asbool(False) is False
assert asbool(None) is False
assert asbool('true') is True
assert asbool('false') is False
assert asbool('yes') is True
assert asbool('no') is False
assert asbool('on') is True
assert asbool('off') is False
with pytest.raises(ValueError) as excinfo:
asbool('Hotzenplotz')
assert str(excinfo.value) == "String is not true/false: 'hotzenplotz'"
def test_asbool():
assert asbool(True) is True
assert asbool(False) is False
assert asbool(None) is False
assert asbool('true') is True
assert asbool('false') is False
assert asbool('yes') is True
assert asbool('no') is False
assert asbool('on') is True
assert asbool('off') is False
with pytest.raises(ValueError) as excinfo:
asbool('Hotzenplotz')
assert str(excinfo.value) == "String is not true/false: 'hotzenplotz'"
def test_asbool():
assert asbool(True) is True
assert asbool(False) is False
assert asbool(None) is False
assert asbool('true') is True
assert asbool('false') is False
assert asbool('yes') is True
assert asbool('no') is False
assert asbool('on') is True
assert asbool('off') is False
with pytest.raises(ValueError) as excinfo:
asbool('Hotzenplotz')
assert str(excinfo.value) == "String is not true/false: 'hotzenplotz'"
def test_asbool():
assert asbool(True) is True
assert asbool(False) is False
assert asbool(None) is False
assert asbool('true') is True
assert asbool('false') is False
assert asbool('yes') is True
assert asbool('no') is False
assert asbool('on') is True
assert asbool('off') is False
with pytest.raises(ValueError) as excinfo:
asbool('Hotzenplotz')
assert str(excinfo.value) == "String is not true/false: 'hotzenplotz'"