def test_write_incron_file(self): ''' Test if it writes the contents of a file to a user's crontab ''' mock = MagicMock(return_value=0) with patch.dict(incron.__salt__, {'cmd.retcode': mock}): self.assertTrue( incron.write_incron_file('cybage', '/home/cybage/new_cron'))
def test_write_incron_file(self): ''' Test if it writes the contents of a file to a user's crontab ''' mock = MagicMock(return_value=0) with patch.dict(incron.__salt__, {'cmd.retcode': mock}): self.assertTrue(incron.write_incron_file('cybage', '/home/cybage/new_cron'))
def test_write_incron_file(self): """ Test if it writes the contents of a file to a user's crontab """ mock = MagicMock(return_value=0) with patch.dict(incron.__salt__, {"cmd.retcode": mock}), patch( "salt.modules.incron._get_incron_cmdstr", MagicMock(return_value="incrontab"), ): self.assertTrue(incron.write_incron_file("cybage", "/home/cybage/new_cron"))