Пример #1
0
 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)
Пример #2
0
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",
        )
Пример #3
0
 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,
         )