rich/tests/test_pick.py

15 lines
484 B
Python
Raw Permalink Normal View History

2020-06-07 09:05:26 +00:00
from rich._pick import pick_bool
def test_pick_bool():
2023-01-29 13:59:22 +00:00
assert pick_bool(False) == False
assert pick_bool(True) == True
assert pick_bool(None) == False
2020-06-07 09:05:26 +00:00
assert pick_bool(False, True) == False
assert pick_bool(None, True) == True
assert pick_bool(True, None) == True
assert pick_bool(False, None) == False
assert pick_bool(None, None) == False
assert pick_bool(None, None, False, True) == False
assert pick_bool(None, None, True, False) == True