import pytest from cpl.core.pipes.bool_pipe import BoolPipe def test_to_str_true(): assert BoolPipe.to_str(True) == "true" def test_to_str_false(): assert BoolPipe.to_str(False) == "false" def test_from_str_true_values(): assert BoolPipe.from_str("True") is True assert BoolPipe.from_str("true") is True assert BoolPipe.from_str("1") is True assert BoolPipe.from_str("yes") is True assert BoolPipe.from_str("y") is True assert BoolPipe.from_str("Y") is True def test_from_str_false_values(): assert BoolPipe.from_str("false") is False assert BoolPipe.from_str("False") is False assert BoolPipe.from_str("0") is False assert BoolPipe.from_str("no") is False assert BoolPipe.from_str("") is False assert BoolPipe.from_str("anything") is False def test_roundtrip_true(): assert BoolPipe.from_str(BoolPipe.to_str(True)) is True def test_roundtrip_false(): assert BoolPipe.from_str(BoolPipe.to_str(False)) is False