def test_execute_container_not_exist(self, monkeypatch): self.do_monkeypatch(monkeypatch) backup_opt = BackupOpt1() backup_opt.list_objects = True monkeypatch.setattr(swift, 'check_container_existance', self.fakeswift.fake_check_container_existance1) job = InfoJob(backup_opt) assert job.execute() is False
def test_execute_list_objects(self, monkeypatch): self.do_monkeypatch(monkeypatch) monkeypatch.setattr(swift, 'show_containers', self.fakeswift.fake_show_containers) monkeypatch.setattr(swift, 'show_objects', self.fakeswift.fake_show_objects) backup_opt = BackupOpt1() backup_opt.list_objects = True job = InfoJob(backup_opt) assert job.execute() is True
def test_execute_list_containers(self, monkeypatch): self.do_monkeypatch(monkeypatch) backup_opt = BackupOpt1() backup_opt.list_containers = True job = InfoJob(backup_opt) job.execute()
def test_execute_nothing_to_do(self, monkeypatch): self.do_monkeypatch(monkeypatch) backup_opt = BackupOpt1() job = InfoJob(backup_opt) job.execute()
def test_execute_list_containers(self): backup_opt = BackupOpt1() job = InfoJob(backup_opt, backup_opt.storage) job.execute()
def test_execute_nothing_to_do(self): backup_opt = BackupOpt1() job = InfoJob(backup_opt, backup_opt.storage) job.execute()
def test_execute_list_container(self, monkeypatch): self.do_monkeypatch(monkeypatch) backup_opt = BackupOpt1() backup_opt.list_container = True job = InfoJob(backup_opt) assert job.execute() is True
def test_execute_nothing_to_do(self, monkeypatch): self.do_monkeypatch(monkeypatch) backup_opt = BackupOpt1() job = InfoJob(backup_opt) assert job.execute() is False