コード例 #1
0
 def coverage(
     self, vcs: str, user: str, repo: str, api: API, branch: str = None
 ) -> Optional[float]:
     api.add(vcs, user, repo)
     if branch:
         api.add("branches", branch)
     return float(get(api.get(), "commit.totals.c"))
コード例 #2
0
 def votes(self, package: str, api: API) -> Optional[str]:
     package_info = api.get(params={
         "v": "5",
         "type": "info",
         "arg[]": package
     })
     if len(package_info["results"]) == 0:
         return None
     return package_info["results"][0].get("NumVotes")
コード例 #3
0
ファイル: api.py プロジェクト: autophagy/scieldas
 def build(self,
           user: str,
           repo: str,
           api: API,
           branch: str = None) -> Optional[str]:
     api.add(user, repo)
     if branch:
         api.add("branch", branch)
     details = api.get()
     return get(details, "build.status")
コード例 #4
0
 def build(self,
           vcs: str,
           user: str,
           repo: str,
           api: API,
           branch: str = None) -> Optional[str]:
     api.add(vcs, user, repo)
     if branch:
         api.add("tree", branch)
     details = api.get(params={"filter": "completed", "limit": 1})
     if len(details) == 0:
         return None
     return details[0].get("status")
コード例 #5
0
ファイル: api.py プロジェクト: autophagy/scieldas
 def tests(self,
           user: str,
           repo: str,
           api: API,
           branch: str = None) -> Optional[TestResults]:
     total, passed, failed = 0, 0, 0
     api.add(user, repo)
     if branch:
         api.add("branch", branch)
     jobs = get(api.get(), "build.jobs")
     for job in jobs:
         total += job.get("testsCount")
         passed += job.get("passedTestsCount")
         failed += job.get("failedTestsCount")
     return TestResults(passed=passed,
                        failed=failed,
                        skipped=total - passed - failed)