def test_notAbandonOnFailure(self): @defer.inlineCallbacks def testFunc(x): yield x.runMkdir("d", abandonOnFailure=False) yield x.runMkdir("d", abandonOnFailure=False) self.setup_step(CompositeUser(testFunc)) self.expect_commands( ExpectMkdir(dir='d', log_environ=False).exit(1), ExpectMkdir(dir='d', log_environ=False).exit(1)) self.expect_outcome(result=SUCCESS) return self.run_step()
def expectClobber(self): # stat return 1 so we clobber self.expect_commands( ExpectStat(file='wkdir/.repo', log_environ=self.logEnviron).exit(1), ExpectRmdir(dir='wkdir', log_environ=self.logEnviron).exit(0), ExpectMkdir(dir='wkdir', log_environ=self.logEnviron).exit(0))
def test_mkdir_fail(self): self.setup_step(CompositeUser(lambda x: x.runMkdir("d"))) self.expect_commands(ExpectMkdir(dir='d', log_environ=False).exit(1)) self.expect_outcome(result=FAILURE) return self.run_step()
def test_render(self): self.setup_step(worker.MakeDirectory(dir=properties.Property("x"))) self.properties.setProperty('x', 'XXX', 'here') self.expect_commands(ExpectMkdir(dir='XXX').exit(0)) self.expect_outcome(result=SUCCESS, state_string="Created") return self.run_step()
def test_failure(self): self.setup_step(worker.MakeDirectory(dir="d")) self.expect_commands(ExpectMkdir(dir='d').exit(1)) self.expect_outcome(result=FAILURE, state_string="Create failed. (failure)") return self.run_step()
def test_success(self): self.setup_step(worker.MakeDirectory(dir="d")) self.expect_commands(ExpectMkdir(dir='d').exit(0)) self.expect_outcome(result=SUCCESS, state_string="Created") return self.run_step()