コード例 #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)