def test_list_tab(self): ''' Test if it return the contents of the specified user's incrontab ''' mock = MagicMock(return_value='incrontab') with patch.dict(incron.__grains__, {'os_family': mock}): mock = MagicMock(return_value='salt') with patch.dict(incron.__salt__, {'cmd.run_stdout': mock}): self.assertDictEqual(incron.list_tab('cybage'), {'pre': ['salt'], 'crons': []})
def test_list_tab(self): """ Test if it return the contents of the specified user's incrontab """ mock = MagicMock(return_value="incrontab") with patch.dict(incron.__grains__, {"os_family": mock}): mock = MagicMock(return_value="salt") with patch.dict(incron.__salt__, {"cmd.run_stdout": mock}): self.assertDictEqual( incron.list_tab("cybage"), {"pre": ["salt"], "crons": []} )