def METHOD_NAME(puppet_config):
    """
    Test to enable the puppet agent
    """
    mock_empty_lst = []
    cmd_run_mock = MagicMock(
        side_effect=[puppet_config, puppet_config, puppet_config, mock_empty_lst]
    )
    with patch.dict(puppet.__salt__, {"cmd.run": cmd_run_mock}):
        mock = MagicMock(return_value=True)
        with patch.object(os.path, "isfile", mock):
            mock = MagicMock(return_value=True)
            with patch.object(os, "remove", mock):
                assert puppet.enable()
            with patch.object(os, "remove", MagicMock(side_effect=IOError)):
                pytest.raises(CommandExecutionError, puppet.enable)
        assert not puppet.enable()