/usr/lib/python2.7/dist-packages/jenkinsapi/result_set.py is in python-jenkinsapi 0.2.30-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | """
Module for jenkinsapi ResultSet
"""
from jenkinsapi.jenkinsbase import JenkinsBase
from jenkinsapi.result import Result
class ResultSet(JenkinsBase):
"""
Represents a result from a completed Jenkins run.
"""
def __init__(self, url, build):
"""
Init a resultset
:param url: url for a build, str
:param build: build obj
"""
self.build = build
JenkinsBase.__init__(self, url)
def get_jenkins_obj(self):
return self.build.job.get_jenkins_obj()
def __str__(self):
return "Test Result for %s" % str(self.build)
@property
def name(self):
return str(self)
def keys(self):
return [a[0] for a in self.iteritems()]
def items(self):
return [a for a in self.iteritems()]
def iteritems(self):
for suite in self._data.get("suites", []):
for case in suite["cases"]:
result = Result(**case)
yield result.identifier(), result
for report_set in self._data.get("childReports", []):
if report_set["result"]:
for suite in report_set["result"]["suites"]:
for case in suite["cases"]:
result = Result(**case)
yield result.identifier(), result
def __len__(self):
return len(self.items())
def __getitem__(self, key):
self_as_dict = dict(self.iteritems())
return self_as_dict[key]
|