mirror of
https://github.com/datafolklabs/cement.git
synced 2026-02-06 11:16:46 +00:00
Fix Tests / Coverage
This commit is contained in:
parent
65e005194c
commit
ea8d46c4a1
@ -186,10 +186,10 @@ def is_true(item):
|
||||
"""
|
||||
if isinstance(item, str) and item.lower() in ['true', 'yes', 'on', '1']:
|
||||
return True
|
||||
elif isinstance(item, int) and item == 1:
|
||||
return True
|
||||
elif isinstance(item, bool) and item is True:
|
||||
return True
|
||||
elif isinstance(item, int) and item == 1:
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
|
||||
@ -19,15 +19,15 @@ def test_is_true():
|
||||
assert misc.is_true(True)
|
||||
|
||||
# false
|
||||
assert misc.is_true(0)
|
||||
assert misc.is_true('0')
|
||||
assert misc.is_true('false')
|
||||
assert misc.is_true('False')
|
||||
assert misc.is_true('FALSE')
|
||||
assert misc.is_true('fAlse')
|
||||
assert misc.is_true('no')
|
||||
assert misc.is_true('off')
|
||||
assert misc.is_true(False)
|
||||
assert not misc.is_true(0)
|
||||
assert not misc.is_true('0')
|
||||
assert not misc.is_true('false')
|
||||
assert not misc.is_true('False')
|
||||
assert not misc.is_true('FALSE')
|
||||
assert not misc.is_true('fAlse')
|
||||
assert not misc.is_true('no')
|
||||
assert not misc.is_true('off')
|
||||
assert not misc.is_true(False)
|
||||
|
||||
|
||||
def test_defaults():
|
||||
|
||||
Loading…
Reference in New Issue
Block a user