예제 #1
0
 def test_execute_raise(self):
     self.popen=patch('freezer.utils.exec_cmd.subprocess.Popen')
     self.mock_popen=self.popen.start()
     self.mock_popen.return_value.returncode = 1
     backup_opt = BackupOpt1()
     backup_opt.command = 'echo test'
     job = jobs.ExecJob(backup_opt, backup_opt.storage)
     self.assertRaises(Exception, job.execute)
예제 #2
0
 def test_execute_nothing_to_do(self):
     self.mock_popen.return_value.returncode = 0
     backup_opt = BackupOpt1()
     backup_opt.command = 'ls '
     jobs.ExecJob(backup_opt, backup_opt.storage).execute()
예제 #3
0
 def test_execute_script(self):
     self.mock_popen.return_value.returncode = 0
     backup_opt = BackupOpt1()
     backup_opt.command='echo test'
     jobs.ExecJob(backup_opt, backup_opt.storage).execute()
예제 #4
0
파일: test_job.py 프로젝트: popawu/freezer
 def test_execute_nothing_to_do(self):
     backup_opt = BackupOpt1()
     jobs.ExecJob(backup_opt, backup_opt.storage).execute()