Beispiel #1
0
 def test_write_default_boolean(self):
     '''
         Test writing a default setting
     '''
     mock = MagicMock()
     with patch.dict(macdefaults.__salt__, {'cmd.run_all': mock}):
         macdefaults.write('com.apple.CrashReporter', 'Crash', True, type="boolean")
         mock.assert_called_once_with('defaults write "com.apple.CrashReporter" "Crash" -boolean "TRUE"',
                                      runas=None)
Beispiel #2
0
 def test_write_default_boolean(self):
     '''
         Test writing a default setting
     '''
     mock = MagicMock()
     with patch.dict(macdefaults.__salt__, {'cmd.run_all': mock}):
         macdefaults.write('com.apple.CrashReporter', 'Crash', True, type="boolean")
         mock.assert_called_once_with('defaults write "com.apple.CrashReporter" "Crash" -boolean "TRUE"',
                                      runas=None)
Beispiel #3
0
 def test_write_with_user(self):
     '''
         Test writing a default setting with a specific user
     '''
     mock = MagicMock()
     with patch.dict(macdefaults.__salt__, {'cmd.run_all': mock}):
         macdefaults.write('com.apple.CrashReporter', 'DialogType', 'Server', user="******")
         mock.assert_called_once_with('defaults write "com.apple.CrashReporter" "DialogType" -string "Server"',
                                      runas="frank")
Beispiel #4
0
 def test_write_with_user(self):
     '''
         Test writing a default setting with a specific user
     '''
     mock = MagicMock()
     with patch.dict(macdefaults.__salt__, {'cmd.run_all': mock}):
         macdefaults.write('com.apple.CrashReporter', 'DialogType', 'Server', user="******")
         mock.assert_called_once_with('defaults write "com.apple.CrashReporter" "DialogType" -string "Server"',
                                      runas="frank")