mirror of
https://github.com/odoo/runbot.git
synced 2025-03-15 23:45:44 +07:00
[REM] duplicate method in test proxy
Probably a duplication I missed when I merged the proxies from runbot_merge and forwardport.
This commit is contained in:
parent
5e05d3cd96
commit
2b64f7feb3
20
conftest.py
20
conftest.py
@ -733,26 +733,6 @@ class Repo:
|
||||
})
|
||||
assert 200 <= r.status_code < 300, r.json()
|
||||
|
||||
def read_tree(self, commit):
|
||||
""" read tree object from commit
|
||||
|
||||
:param Commit commit:
|
||||
:rtype: Dict[str, str]
|
||||
"""
|
||||
r = self._session.get('https://api.github.com/repos/{}/git/trees/{}'.format(self.name, commit.tree))
|
||||
assert 200 <= r.status_code < 300, r.json()
|
||||
|
||||
# read tree's blobs
|
||||
tree = {}
|
||||
for t in r.json()['tree']:
|
||||
assert t['type'] == 'blob', "we're *not* doing recursive trees in test cases"
|
||||
r = self._session.get(t['url'])
|
||||
assert 200 <= r.status_code < 300, r.json()
|
||||
# assume all test content is textual
|
||||
tree[t['path']] = base64.b64decode(r.json()['content']).decode()
|
||||
|
||||
return tree
|
||||
|
||||
def is_ancestor(self, sha, of):
|
||||
return any(c['sha'] == sha for c in self.log(of))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user