def METHOD_NAME(self, mock_open, mock_write_file, mock_set_macos_pref):
    """Preferences().set_pref should write file on macOS and read_file() used."""
    self.mock_platform.return_value = "darwin"
    fake_prefs = Preferences()
    fake_prefs.read_file("fake_config_file")
    mock_open.assert_called()
    fake_prefs.set_pref("TEST_KEY", "fake_value")
    mock_write_file.assert_called()
    mock_set_macos_pref.assert_not_called()
    value = fake_prefs.get_pref("TEST_KEY")
    self.assertEqual(value, "fake_value")