本文整理汇总了Python中models.Server.getserverid方法的典型用法代码示例。如果您正苦于以下问题:Python Server.getserverid方法的具体用法?Python Server.getserverid怎么用?Python Server.getserverid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.Server
的用法示例。
在下文中一共展示了Server.getserverid方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: suite_parser_v1
# 需要导入模块: from models import Server [as 别名]
# 或者: from models.Server import getserverid [as 别名]
def suite_parser_v1(self, json):
suiteName = json['suite-name']
dateRun = parse(str(json['timestamp']))
testType = 'unittest'
testCount = self.assign_or_default(json['test-to-run'],0)
testFail = self.assign_or_default(json['tests-failure'],0)
testError = self.assign_or_default(json['tests-error'],0)
testSkip = self.assign_or_default(json['tests-skipped'],0)
testRun = self.assign_or_default(json['tests-run'],0)
testPass = (testRun - (testError + testSkip + testFail)) \
if (testRun - (testError + testSkip + testFail)) >= 0 \
else 0 # pass = #tests run - all other results
serverId = Server.getserverid(json['server'])
projectId = Project.getprojectid(json['project'])
if not Suite.isdupe(suiteName, dateRun, serverId):
db.session.add(Suite(SuiteName=suiteName, TestType=testType, TestCount=testCount,
PassCount=testPass , FailCount=testFail, ErrorCount=testError,
SkipCount=testSkip, DateRun=dateRun, ServerId=serverId, ProjectId=projectId))
db.session.commit()
else:
pass