Example #1
0
 def test_found(self):
     self.setupStep(slave.FileExists(file="x"))
     self.expectCommands(
         Expect('stat', {'file': 'x'}) +
         Expect.update('stat', [stat.S_IFREG, 99, 99]) + 0)
     self.expectOutcome(result=SUCCESS, status_text=["File found."])
     return self.runStep()
Example #2
0
 def test_not_found(self):
     self.setupStep(slave.FileExists(file="x"))
     self.expectCommands(
         Expect('stat', {'file': 'x'}) +
         Expect.update('stat', [0, 99, 99]) + 0)
     self.expectOutcome(result=FAILURE, status_text=["Not a file."])
     return self.runStep()
Example #3
0
 def test_render(self):
     self.setupStep(slave.FileExists(file=properties.Property("x")))
     self.properties.setProperty('x', 'XXX', 'here')
     self.expectCommands(Expect('stat', {'file': 'XXX'}) + 1)
     self.expectOutcome(result=FAILURE,
                        state_string="File not found. (failure)")
     return self.runStep()
Example #4
0
 def test_old_version(self):
     self.setupStep(slave.FileExists(file="x"),
                    slave_version=dict())
     self.expectOutcome(result=EXCEPTION,
                        state_string="finished (exception)")
     yield self.runStep()
     self.flushLoggedErrors(BuildSlaveTooOldError)
Example #5
0
 def test_failure(self):
     self.setupStep(slave.FileExists(file="x"))
     self.expectCommands(
         Expect('stat', {'file': 'x'})
         + 1
     )
     self.expectOutcome(result=FAILURE,
                        state_string="File not found. (failure)")
     return self.runStep()
Example #6
0
    def test_old_version(self):
        self.setupStep(slave.FileExists(file="x"), slave_version=dict())
        self.expectOutcome(result=EXCEPTION,
                           status_text=["FileExists", "exception"])
        d = self.runStep()

        def check(_):
            self.assertEqual(
                len(self.flushLoggedErrors(BuildSlaveTooOldError)), 1)

        d.addCallback(check)
        return d
Example #7
0
 def test_old_version(self):
     self.setupStep(slave.FileExists(file="x"), slave_version=dict())
     self.expectOutcome(result=EXCEPTION,
                        state_string="finished (exception)")
     return self.runStep()