Пример #1
0
    def completeTestResultSet(self, test_result_setid, tests_passed=None, tests_failed=None):
        validation.verifyType(self.testcase, 'test_result_setid', test_result_setid,
                              validation.IntValidator())
        validation.verifyType(self.testcase, 'tests_passed', tests_passed,
                              validation.NoneOk(validation.IntValidator()))
        validation.verifyType(self.testcase, 'tests_failed', tests_failed,
                              validation.NoneOk(validation.IntValidator()))

        yield self.master.db.test_result_sets.completeTestResultSet(test_result_setid,
                                                                    tests_passed, tests_failed)
Пример #2
0
 def completeBuildRequests(self, brids, results, complete_at=None, _reactor=reactor):
     validation.verifyType(self.testcase, 'brids', brids,
                           validation.ListValidator(validation.IntValidator()))
     validation.verifyType(self.testcase, 'results', results,
                           validation.IntValidator())
     validation.verifyType(self.testcase, 'complete_at', complete_at,
                           validation.NoneOk(validation.DateTimeValidator()))
     return defer.succeed(True)
Пример #3
0
 def test_NoneOk(self):
     self.doValidationTest(
         validation.NoneOk(validation.BooleanValidator()),
         good=[
             True, False, None
         ], bad=[
             1, "yes"
         ])
Пример #4
0
 def claimBuildRequests(self, brids, claimed_at=None):
     validation.verifyType(self.testcase, 'brids', brids,
                           validation.ListValidator(validation.IntValidator()))
     validation.verifyType(self.testcase, 'claimed_at', claimed_at,
                           validation.NoneOk(validation.DateTimeValidator()))
     if not brids:
         return True
     try:
         yield self.master.db.buildrequests.claimBuildRequests(
             brids=brids, claimed_at=claimed_at)
     except AlreadyClaimedError:
         return False
     self.claimedBuildRequests.update(set(brids))
     return True
Пример #5
0
 def claimBuildRequests(self, brids, claimed_at=None, _reactor=reactor):
     validation.verifyType(self.testcase, 'brids', brids,
                           validation.ListValidator(validation.IntValidator()))
     validation.verifyType(self.testcase, 'claimed_at', claimed_at,
                           validation.NoneOk(validation.DateTimeValidator()))
     if not brids:
         defer.returnValue(True)
         return
     try:
         yield self.master.db.buildrequests.claimBuildRequests(
             brids=brids, claimed_at=claimed_at, _reactor=_reactor)
     except AlreadyClaimedError:
         defer.returnValue(False)
     self.claimedBuildRequests.update(set(brids))
     defer.returnValue(True)