示例#1
0
 def test__get_cron_cmdstr(self):
     cron.__grains__ = __grains__
     with patch.dict(cron.__grains__, {'os': None}):
         self.assertEqual('crontab -u root /tmp',
                          cron._get_cron_cmdstr(STUB_USER, STUB_PATH))
示例#2
0
 def test__get_cron_cmdstr(self):
     self.assertEqual('crontab /tmp', cron._get_cron_cmdstr(STUB_PATH))
示例#3
0
 def test__get_cron_cmdstr_solaris(self):
     cron.__grains__ = __grains__
     with patch.dict(cron.__grains__, {'os': 'Solaris'}):
         self.assertEqual('su - root -c "crontab /tmp"',
                          cron._get_cron_cmdstr(STUB_USER, STUB_PATH))
示例#4
0
 def test__get_cron_cmdstr_user(self):
     '''
     Passes if a user is added to crontab command
     '''
     self.assertEqual('crontab -u root /tmp', cron._get_cron_cmdstr(STUB_PATH, STUB_USER))
示例#5
0
 def test__get_cron_cmdstr(self):
     cron.__grains__ = __grains__
     with patch.dict(cron.__grains__, {'os_family': None}):
         self.assertEqual('crontab -u root /tmp',
                          cron._get_cron_cmdstr(STUB_USER, STUB_PATH))
示例#6
0
 def test__get_cron_cmdstr_solaris(self):
     cron.__grains__ = __grains__
     with patch.dict(cron.__grains__, {'os_family': 'Solaris'}):
         self.assertEqual('su - root -c "crontab /tmp"',
                          cron._get_cron_cmdstr(STUB_USER, STUB_PATH))
示例#7
0
文件: cron_test.py 项目: bryson/salt
 def test__get_cron_cmdstr_user(self):
     '''
     Passes if a user is added to crontab command
     '''
     self.assertEqual('crontab -u root /tmp', cron._get_cron_cmdstr(STUB_PATH, STUB_USER))
示例#8
0
文件: cron_test.py 项目: bryson/salt
 def test__get_cron_cmdstr(self):
     self.assertEqual('crontab /tmp', cron._get_cron_cmdstr(STUB_PATH))