예제 #1
0
    def test_should_raise_error_when_value_does_not_represent_true_or_false(self, value):
        with pytest.raises(ValueError) as exc_info:
            bool_converter(value)

        assert f'{value} does not represent a boolean' == str(exc_info.value)
예제 #2
0
 def test_should_return_true_when_value_represent_truthy(self, value):
     assert bool_converter(value) is True
예제 #3
0
 def test_should_return_false_when_value_does_not_represent_truthy(self, value):
     assert bool_converter(value) is False
예제 #4
0
 def test_should_return_given_value_if_it_is_not_a_string(self, value):
     assert value == bool_converter(value)