def test_not_found(self): self.setupStep(slave.FileExists(file="x")) self.expectCommands( ExpectLogged('stat', { 'file' : 'x' }) + ExpectLogged.update('stat', [0, 99, 99]) + 0 ) self.expectOutcome(result=FAILURE, status_text=["Not a file."]) return self.runStep()
def test_found(self): self.setupStep(slave.FileExists(file="x")) self.expectCommands( ExpectLogged('stat', { 'file' : 'x' }) + ExpectLogged.update('stat', [stat.S_IFREG, 99, 99]) + 0 ) self.expectOutcome(result=SUCCESS, status_text=["File found."]) return self.runStep()