本文整理汇总了Python中buildbot.test.fake.fakebuild.FakeBuildStatus.getProperty方法的典型用法代码示例。如果您正苦于以下问题:Python FakeBuildStatus.getProperty方法的具体用法?Python FakeBuildStatus.getProperty怎么用?Python FakeBuildStatus.getProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类buildbot.test.fake.fakebuild.FakeBuildStatus
的用法示例。
在下文中一共展示了FakeBuildStatus.getProperty方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run_fake_single_build
# 需要导入模块: from buildbot.test.fake.fakebuild import FakeBuildStatus [as 别名]
# 或者: from buildbot.test.fake.fakebuild.FakeBuildStatus import getProperty [as 别名]
def run_fake_single_build(self, gsp, buildResult):
build = FakeBuildStatus(name="build")
build.getProperty = self.TEST_PROPS.get
gsp.buildFinished('dummyBuilder', build, buildResult)
return defer.succeed(str({'name': 'dummyBuilder', 'result': buildResult}))
示例2: run_fake_summary_build
# 需要导入模块: from buildbot.test.fake.fakebuild import FakeBuildStatus [as 别名]
# 或者: from buildbot.test.fake.fakebuild.FakeBuildStatus import getProperty [as 别名]
def run_fake_summary_build(self, gsp, buildResults, finalResult,
resultText):
buildpairs = []
i = 0
for i in xrange(len(buildResults)):
buildResult = buildResults[i]
builder = Mock()
build = FakeBuildStatus()
builder.getBuild.return_value = build
builder.name = "Builder-%d" % i
builder.getName.return_value = builder.name
build.results = buildResult
build.finished = True
build.reason = "testReason"
build.getBuilder.return_value = builder
build.getResults.return_value = build.results
build.getText.return_value = ['buildText']
build.getProperty = self.TEST_PROPS.get
buildpairs.append((builder, build))
def fakeGetBuilder(buildername):
# e.g. Builder-5 will be buildpairs[5][0]
return buildpairs[int(buildername.split("-")[1])][0]
gsp.master_status.getBuilder = fakeGetBuilder
gsp.master_status.getURLForThing = Mock()
gsp.master_status.getURLForThing.return_value = self.THING_URL
gsp.master.db = fakedb.FakeDBConnector(self)
fakedata = [
fakedb.SourceStampSet(id=127),
fakedb.Buildset(id=99, sourcestampsetid=127, results=finalResult, reason="testReason")
]
breqid = 1000
for (builder, build) in buildpairs:
fakedata.append(fakedb.BuildRequest(id=breqid, buildsetid=99,
buildername=builder.name))
fakedata.append(fakedb.Build(number=0, brid=breqid))
breqid = breqid + 1
gsp.master.db.insertTestData(fakedata)
d = gsp._buildsetComplete(99, finalResult)
@d.addCallback
def check(_):
info = []
for i in xrange(len(buildResults)):
info.append({'name': "Builder-%d" % i, 'result': buildResults[i],
'resultText': resultText[i], 'text': 'buildText',
'url': self.THING_URL})
return str(info)
return d
示例3: run_fake_single_build
# 需要导入模块: from buildbot.test.fake.fakebuild import FakeBuildStatus [as 别名]
# 或者: from buildbot.test.fake.fakebuild.FakeBuildStatus import getProperty [as 别名]
def run_fake_single_build(self, gsp, buildResult):
build = FakeBuildStatus(name="build")
build.getProperty = self.TEST_PROPS.get
gsp.buildStarted(self.TEST_BUILDER_NAME, build)
gsp.buildFinished(self.TEST_BUILDER_NAME, build, buildResult)
return defer.succeed(str({'name': self.TEST_BUILDER_NAME,
'result': buildResult}))
示例4: run_fake_single_build
# 需要导入模块: from buildbot.test.fake.fakebuild import FakeBuildStatus [as 别名]
# 或者: from buildbot.test.fake.fakebuild.FakeBuildStatus import getProperty [as 别名]
def run_fake_single_build(self, gsp, buildResult, expWarning=False):
build = FakeBuildStatus(name="build")
build.getProperty = self.TEST_PROPS.get
gsp.buildFinished('dummyBuilder', build, buildResult)
if expWarning:
self.assertEqual([w['message'] for w in self.flushWarnings()],
['The Gerrit status callback uses the old '
'way to communicate results. The outcome '
'might be not what is expected.'])
return defer.succeed(str({'name': 'dummyBuilder', 'result': buildResult}))
示例5: run_fake_single_build
# 需要导入模块: from buildbot.test.fake.fakebuild import FakeBuildStatus [as 别名]
# 或者: from buildbot.test.fake.fakebuild.FakeBuildStatus import getProperty [as 别名]
def run_fake_single_build(self, buildResult, verifiedScore):
gsp = GerritStatusPush('host.example.com', 'username', reviewCB=testReviewCB)
self.run_prepare_gsp(gsp)
fakeSCR = Mock()
gsp.sendCodeReview = fakeSCR
build = FakeBuildStatus(name="build")
build.getProperty = lambda prop: self.TEST_PROPS.get(prop)
gsp.buildFinished('dummyBuilder', build, buildResult)
fakeSCR.assert_called_once_with(self.TEST_PROJECT, self.TEST_REVISION,
str({'name': 'dummyBuilder', 'result': buildResult}),
verifiedScore, 0)
示例6: run_fake_summary_build
# 需要导入模块: from buildbot.test.fake.fakebuild import FakeBuildStatus [as 别名]
# 或者: from buildbot.test.fake.fakebuild.FakeBuildStatus import getProperty [as 别名]
def run_fake_summary_build(self, buildResults, finalResult, resultText, verifiedScore):
gsp = GerritStatusPush('host.example.com', 'username', summaryCB=testSummaryCB)
buildpairs = []
i = 0
for i in xrange(len(buildResults)):
buildResult = buildResults[i]
builder = Mock()
build = FakeBuildStatus()
builder.getBuild.return_value = build
builder.name = "Builder-%d" % i
builder.getName.return_value = builder.name
build.results = buildResult
build.finished = True
build.reason = "testReason"
build.getBuilder.return_value = builder
build.getResults.return_value = build.results
build.getText.return_value = ['buildText']
build.getProperty = lambda prop: self.TEST_PROPS.get(prop)
buildpairs.append((builder, build))
def fakeGetBuilder(buildername):
# e.g. Builder-5 will be buildpairs[5][0]
return buildpairs[int(buildername.split("-")[1])][0]
self.run_prepare_gsp(gsp)
gsp.master_status.getBuilder = fakeGetBuilder
gsp.master_status.getURLForThing = Mock()
gsp.master_status.getURLForThing.return_value = self.THING_URL
gsp.master.db = fakedb.FakeDBConnector(gsp.master, self)
fakedata = [
fakedb.Master(id=92),
fakedb.Buildslave(id=13, name='sl'),
fakedb.Buildset(id=99, results=finalResult, reason="testReason"),
]
breqid = 1000
for (builder, build) in buildpairs:
fakedata.append(fakedb.BuildRequest(id=breqid, buildsetid=99,
buildername=builder.name))
fakedata.append(fakedb.Build(number=0, buildrequestid=breqid,
masterid=92, buildslaveid=13))
breqid = breqid + 1
gsp.master.db.insertTestData(fakedata)
fakeSCR = Mock()
gsp.sendCodeReview = fakeSCR
d = gsp._buildsetComplete('buildset.99.complete',
dict(bsid=99, result=SUCCESS))
@d.addCallback
def check(_):
info = []
for i in xrange(len(buildResults)):
info.append({'name': "Builder-%d" % i, 'result': buildResults[i],
'resultText': resultText[i], 'text': 'buildText',
'url': self.THING_URL})
fakeSCR.assert_called_once_with(self.TEST_PROJECT, self.TEST_REVISION, str(info), verifiedScore, 0)
return d
示例7: run_fake_summary_build
# 需要导入模块: from buildbot.test.fake.fakebuild import FakeBuildStatus [as 别名]
# 或者: from buildbot.test.fake.fakebuild.FakeBuildStatus import getProperty [as 别名]
def run_fake_summary_build(self, gsp, buildResults, finalResult,
resultText, expWarning=False):
buildpairs = []
i = 0
for i in xrange(len(buildResults)):
buildResult = buildResults[i]
builder = Mock()
build = FakeBuildStatus()
builder.getBuild.return_value = build
builder.name = "Builder-%d" % i
builder.getName.return_value = builder.name
builder._builderid = i
build.results = buildResult
build.finished = True
build.reason = "testReason"
build.getBuilder.return_value = builder
build.getResults.return_value = build.results
build.getText.return_value = ['buildText']
build.getProperty = self.TEST_PROPS.get
buildpairs.append((builder, build))
def fakeGetBuilder(buildername):
# e.g. Builder-5 will be buildpairs[5][0]
return buildpairs[int(buildername.split("-")[1])][0]
gsp.master_status.getBuilder = fakeGetBuilder
gsp.master_status.getURLForThing = Mock()
gsp.master_status.getURLForThing.return_value = self.THING_URL
gsp.master.db = fakedb.FakeDBConnector(gsp.master, self)
fakedata = [
fakedb.Master(id=92),
fakedb.Buildslave(id=13, name='sl'),
fakedb.Buildset(id=99, results=finalResult, reason="testReason"),
]
breqid = 1000
for (builder, build) in buildpairs:
fakedata.append(fakedb.Builder(id=builder._builderid, name=builder.name))
fakedata.append(fakedb.BuildRequest(id=breqid, buildsetid=99,
builderid=builder._builderid))
fakedata.append(fakedb.Build(number=0, buildrequestid=breqid,
masterid=92, buildslaveid=13))
breqid = breqid + 1
gsp.master.db.insertTestData(fakedata)
d = gsp._buildsetComplete('buildset.99.complete',
dict(bsid=99, result=SUCCESS))
@d.addCallback
def check(_):
info = []
for i in xrange(len(buildResults)):
info.append({'name': "Builder-%d" % i, 'result': buildResults[i],
'resultText': resultText[i], 'text': 'buildText',
'url': self.THING_URL})
if expWarning:
self.assertEqual([w['message'] for w in self.flushWarnings()],
['The Gerrit status callback uses the old '
'way to communicate results. The outcome '
'might be not what is expected.'])
return str(info)
return d