Esempio n. 1
0
 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'))
Esempio n. 2
0
 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'))
Esempio n. 3
0
 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"))