def test_exists_raises_error(self, mocker): """Check the error when `exists` raises an exception""" mocked_exists = mocker.Mock() error_message = "File not found" mocked_exists.side_effect = FileNotFoundError(error_message) data_set = LambdaDataSet(None, None, mocked_exists) with pytest.raises(DataSetError, match=error_message): data_set.exists() mocked_exists.assert_called_once_with()
def test_exists_invocation(self, mocker): """Test the basic `exists` method invocation""" mocked_exists = mocker.Mock(return_value=True) data_set = LambdaDataSet(None, None, mocked_exists) result = data_set.exists() mocked_exists.assert_called_once_with() assert result is True
def test_exists_not_implemented(self): """Check that `exists` method returns False by default""" data_set = LambdaDataSet(None, None) assert not data_set.exists()