def test_delete_default(self): ''' Test delete a default setting ''' mock = MagicMock() with patch.dict(macdefaults.__salt__, {'cmd.run_all': mock}): macdefaults.delete('com.apple.CrashReporter', 'Crash') mock.assert_called_once_with( 'defaults delete "com.apple.CrashReporter" "Crash"', output_loglevel='debug', runas=None)
def test_delete_default_with_user(): """ Test delete a default setting as a specific user """ mock = MagicMock() with patch.dict(macdefaults.__salt__, {"cmd.run_all": mock}): macdefaults.delete("com.apple.CrashReporter", "Crash", user="******") mock.assert_called_once_with( 'defaults delete "com.apple.CrashReporter" "Crash"', output_loglevel="debug", runas="frank", )
def test_delete_default(self): """ Test delete a default setting """ mock = MagicMock() with patch.dict(macdefaults.__salt__, {"cmd.run_all": mock}): macdefaults.delete("com.apple.CrashReporter", "Crash") mock.assert_called_once_with( 'defaults delete "com.apple.CrashReporter" "Crash"', output_loglevel="debug", runas=None, )