def test_write_boolean(self):
        expected = {
            'changes': {'written': 'com.apple.something Key is set to True'},
            'comment': '',
            'name': 'Key',
            'result': True
        }

        read_mock = MagicMock(return_value='0')
        write_mock = MagicMock(return_value={'retcode': 0})
        with patch.dict(macdefaults.__salt__, {'macdefaults.read': read_mock,
                                               'macdefaults.write': write_mock}):
            out = macdefaults.write('Key', 'com.apple.something', True, vtype='boolean')
            read_mock.assert_called_once_with('com.apple.something', 'Key', None)
            write_mock.assert_called_once_with('com.apple.something', 'Key', True, 'boolean', None)
            self.assertEqual(out, expected)
Test writing a default setting with a boolean
dataset/ETHPy150Open saltstack/salt/tests/unit/states/mac_defaults_test.py/MacDefaultsTestCase.test_write_boolean