예제 #1
0
    def test_load_raises_error(self):
        """Check the error if loading the LambdaDataSet raises an exception"""
        error_message = "Internal load exception message"

        def internal_load():
            raise FileNotFoundError(error_message)

        data_set = LambdaDataSet(internal_load, None)
        with pytest.raises(DataSetError, match=error_message):
            data_set.load()
예제 #2
0
    def test_load_invocation(self, mocker):
        """Test the basic `load` method invocation"""
        mocked_load = mocker.Mock(return_value=42)
        data_set = LambdaDataSet(mocked_load, None)
        result = data_set.load()

        mocked_load.assert_called_once_with()
        assert result == 42