def METHOD_NAME():
    """
    Test writing a default setting
    """
    expected = {
        "changes": {"written": "com.apple.CrashReporter DialogType is set to Server"},
        "comment": "",
        "name": "DialogType",
        "result": True,
    }
    read_mock = MagicMock(return_value="Local")
    write_mock = MagicMock(return_value={"retcode": 0})
    with patch.dict(
        macdefaults.__salt__,
        {"macdefaults.read": read_mock, "macdefaults.write": write_mock},
    ):
        out = macdefaults.write("DialogType", "com.apple.CrashReporter", "Server")
        read_mock.assert_called_once_with("com.apple.CrashReporter", "DialogType", None)
        write_mock.assert_called_once_with(
            "com.apple.CrashReporter", "DialogType", "Server", "string", None
        )
        assert out == expected