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")
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)
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)