Add 'comment' github pull_request event action
Change-Id: I60aa77461cc4f5642ab3da14570f6e7ac3bead1a
Co-Authored-By: Jesse Keating <omgjlk@us.ibm.com>
diff --git a/tests/base.py b/tests/base.py
index cfc8fd8..1092c6e 100755
--- a/tests/base.py
+++ b/tests/base.py
@@ -588,6 +588,22 @@
self.comments.append(message)
self._updateTimeStamp()
+ def getCommentAddedEvent(self, text):
+ name = 'issue_comment'
+ data = {
+ 'action': 'created',
+ 'issue': {
+ 'number': self.number
+ },
+ 'comment': {
+ 'body': text
+ },
+ 'repository': {
+ 'full_name': self.project
+ }
+ }
+ return (name, data)
+
def _getRepo(self):
repo_path = os.path.join(self.upstream_root, self.project)
return git.Repo(repo_path)
@@ -700,6 +716,23 @@
data=payload, headers=headers)
urllib.request.urlopen(req)
+ def getPull(self, project, number):
+ pr = self.pull_requests[number - 1]
+ data = {
+ 'number': number,
+ 'updated_at': pr.updated_at,
+ 'base': {
+ 'repo': {
+ 'full_name': pr.project
+ },
+ 'ref': pr.branch,
+ },
+ 'head': {
+ 'sha': pr.head_sha
+ }
+ }
+ return data
+
def getGitUrl(self, project):
return os.path.join(self.upstream_root, str(project))