def METHOD_NAME(puppet_config):
    """
    Test to disable the puppet agent
    """
    cmd_run_mock = MagicMock(return_value=puppet_config)
    with patch.dict(puppet.__salt__, {"cmd.run": cmd_run_mock}):
        mock = MagicMock(side_effect=[True, False])
        with patch.object(os.path, "isfile", mock):
            assert not puppet.disable()
            with patch("salt.utils.files.fopen", mock_open()):
                assert puppet.disable()
            try:
                with patch("salt.utils.files.fopen", mock_open()) as m_open:
                    m_open.side_effect = IOError(13, "Permission denied:", "/file")
                    pytest.raises(CommandExecutionError, puppet.disable)
            except StopIteration:
                pass