예제 #1
0
def test_read_default_with_user():
    """
    Test reading a default setting as a specific user
    """
    mock = MagicMock()
    with patch.dict(macdefaults.__salt__, {"cmd.run": mock}):
        macdefaults.read("com.apple.CrashReporter", "Crash", user="******")
        mock.assert_called_once_with(
            'defaults read "com.apple.CrashReporter" "Crash"', runas="frank")
예제 #2
0
 def test_read_default(self):
     '''
         Test reading a default setting
     '''
     mock = MagicMock()
     with patch.dict(macdefaults.__salt__, {'cmd.run': mock}):
         macdefaults.read('com.apple.CrashReporter', 'Crash')
         mock.assert_called_once_with(
             'defaults read "com.apple.CrashReporter" "Crash"', runas=None)
예제 #3
0
 def test_read_default(self):
     """
     Test reading a default setting
     """
     mock = MagicMock()
     with patch.dict(macdefaults.__salt__, {"cmd.run": mock}):
         macdefaults.read("com.apple.CrashReporter", "Crash")
         mock.assert_called_once_with(
             'defaults read "com.apple.CrashReporter" "Crash"', runas=None)