Exemplo n.º 1
0
 def test_execute_script(self, monkeypatch):
     self.setUp()
     self.do_monkeypatch(monkeypatch)
     self.mock_popen.return_value.returncode = 0
     backup_opt = BackupOpt1()
     backup_opt.command='echo test'
     job = ExecJob(backup_opt)
     assert job.execute() is True
     self.tearDown()
Exemplo n.º 2
0
 def test_execute_script(self):
     self.mock_popen.return_value.returncode = 0
     backup_opt = BackupOpt1()
     backup_opt.command='echo test'
     job = ExecJob(backup_opt, backup_opt.storage)
     assert job.execute() is True
Exemplo n.º 3
0
 def test_execute_nothing_to_do(self, monkeypatch):
     self.do_monkeypatch(monkeypatch)
     backup_opt = BackupOpt1()
     job = ExecJob(backup_opt)
     assert job.execute() is False
Exemplo n.º 4
0
 def test_execute_nothing_to_do(self):
     backup_opt = BackupOpt1()
     job = ExecJob(backup_opt, backup_opt.storage)
     assert job.execute() is False