summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOliver Poignant <oliver@poignant.se>2016-12-09 19:57:55 +0100
committerOliver Poignant <oliver@poignant.se>2016-12-09 19:57:55 +0100
commit9e4aa3618ad9f5494847fb95b0958f2f1b43ccb5 (patch)
treee38bfb1bd8d5a0897d0ffff74271a7c823ac41bd
parentdc2d26cf7ddd8f75b3190ba09ea22a7d47bbb4b1 (diff)
downloadGit-Auto-Deploy-9e4aa3618ad9f5494847fb95b0958f2f1b43ccb5.zip
Git-Auto-Deploy-9e4aa3618ad9f5494847fb95b0958f2f1b43ccb5.tar.gz
Git-Auto-Deploy-9e4aa3618ad9f5494847fb95b0958f2f1b43ccb5.tar.bz2
New and updated test cases
-rw-r--r--test/samples/bitbucket-pr-created-filter.negative.test-case.json210
-rw-r--r--test/samples/bitbucket-pr-created-filter.positive.test-case.json214
-rw-r--r--test/samples/bitbucket.pr-fulfilled-filter.positive.test-case.json249
-rw-r--r--test/samples/bitbucket.pr-fulfilled.negative.test-case.json245
-rw-r--r--test/samples/github-pr-open.test-case.json8
-rw-r--r--test/test_parsers.py2
6 files changed, 926 insertions, 2 deletions
diff --git a/test/samples/bitbucket-pr-created-filter.negative.test-case.json b/test/samples/bitbucket-pr-created-filter.negative.test-case.json
new file mode 100644
index 0000000..45cf429
--- /dev/null
+++ b/test/samples/bitbucket-pr-created-filter.negative.test-case.json
@@ -0,0 +1,210 @@
+{
+ "config": {
+ "branch": "master",
+ "deploy": "echo test!",
+ "remote": "origin",
+ "url": "https://bitbucket.org/oliverpoignant/test-hook.git",
+ "header-filter": {
+ "x-event-key": "pullrequest:merged"
+ }
+ },
+ "expected": {
+ "status": 200,
+ "data": []
+ },
+ "headers": {
+ "accept": "*/*",
+ "accept-encoding": "gzip, deflate",
+ "connection": "keep-alive",
+ "content-length": "4248",
+ "content-type": "application/json",
+ "host": "narpau.se:8001",
+ "user-agent": "Bitbucket-Webhooks/2.0",
+ "x-attempt-number": "1",
+ "x-event-key": "pullrequest:created",
+ "x-hook-uuid": "1f813038-7b26-4d08-9b80-ee76eeb53d93",
+ "x-request-uuid": "2e6626d9-effe-46f7-8bfd-e9dee9a58920"
+ },
+ "payload": {
+ "actor": {
+ "display_name": "Oliver Poignant",
+ "links": {
+ "avatar": {
+ "href": "https://bitbucket.org/account/oliverpoignant/avatar/32/"
+ },
+ "html": {
+ "href": "https://bitbucket.org/oliverpoignant/"
+ },
+ "self": {
+ "href": "https://api.bitbucket.org/2.0/users/oliverpoignant"
+ }
+ },
+ "type": "user",
+ "username": "oliverpoignant",
+ "uuid": "{d628d18b-5fe4-4f45-b34f-cc1a20073194}"
+ },
+ "pullrequest": {
+ "author": {
+ "display_name": "Oliver Poignant",
+ "links": {
+ "avatar": {
+ "href": "https://bitbucket.org/account/oliverpoignant/avatar/32/"
+ },
+ "html": {
+ "href": "https://bitbucket.org/oliverpoignant/"
+ },
+ "self": {
+ "href": "https://api.bitbucket.org/2.0/users/oliverpoignant"
+ }
+ },
+ "type": "user",
+ "username": "oliverpoignant",
+ "uuid": "{d628d18b-5fe4-4f45-b34f-cc1a20073194}"
+ },
+ "close_source_branch": false,
+ "closed_by": null,
+ "comment_count": 0,
+ "created_on": "2016-12-08T19:30:52.967233+00:00",
+ "description": "",
+ "destination": {
+ "branch": {
+ "name": "master"
+ },
+ "commit": {
+ "hash": "04dad24aa44d",
+ "links": {
+ "self": {
+ "href": "https://api.bitbucket.org/2.0/repositories/oliverpoignant/test-hook/commit/04dad24aa44d"
+ }
+ }
+ },
+ "repository": {
+ "full_name": "oliverpoignant/test-hook",
+ "links": {
+ "avatar": {
+ "href": "https://bitbucket.org/oliverpoignant/test-hook/avatar/32/"
+ },
+ "html": {
+ "href": "https://bitbucket.org/oliverpoignant/test-hook"
+ },
+ "self": {
+ "href": "https://api.bitbucket.org/2.0/repositories/oliverpoignant/test-hook"
+ }
+ },
+ "name": "test-hook",
+ "type": "repository",
+ "uuid": "{88ad4da3-6e3e-41ad-9aef-f3a26731d913}"
+ }
+ },
+ "id": 1,
+ "links": {
+ "activity": {
+ "href": "https://api.bitbucket.org/2.0/repositories/oliverpoignant/test-hook/pullrequests/1/activity"
+ },
+ "approve": {
+ "href": "https://api.bitbucket.org/2.0/repositories/oliverpoignant/test-hook/pullrequests/1/approve"
+ },
+ "comments": {
+ "href": "https://api.bitbucket.org/2.0/repositories/oliverpoignant/test-hook/pullrequests/1/comments"
+ },
+ "commits": {
+ "href": "https://api.bitbucket.org/2.0/repositories/oliverpoignant/test-hook/pullrequests/1/commits"
+ },
+ "decline": {
+ "href": "https://api.bitbucket.org/2.0/repositories/oliverpoignant/test-hook/pullrequests/1/decline"
+ },
+ "diff": {
+ "href": "https://api.bitbucket.org/2.0/repositories/oliverpoignant/test-hook/pullrequests/1/diff"
+ },
+ "html": {
+ "href": "https://bitbucket.org/oliverpoignant/test-hook/pull-requests/1"
+ },
+ "merge": {
+ "href": "https://api.bitbucket.org/2.0/repositories/oliverpoignant/test-hook/pullrequests/1/merge"
+ },
+ "self": {
+ "href": "https://api.bitbucket.org/2.0/repositories/oliverpoignant/test-hook/pullrequests/1"
+ },
+ "statuses": {
+ "href": "https://api.bitbucket.org/2.0/repositories/oliverpoignant/test-hook/pullrequests/1/statuses"
+ }
+ },
+ "merge_commit": null,
+ "participants": [],
+ "reason": "",
+ "reviewers": [],
+ "source": {
+ "branch": {
+ "name": "development"
+ },
+ "commit": {
+ "hash": "198a37b77185",
+ "links": {
+ "self": {
+ "href": "https://api.bitbucket.org/2.0/repositories/oliverpoignant/test-hook/commit/198a37b77185"
+ }
+ }
+ },
+ "repository": {
+ "full_name": "oliverpoignant/test-hook",
+ "links": {
+ "avatar": {
+ "href": "https://bitbucket.org/oliverpoignant/test-hook/avatar/32/"
+ },
+ "html": {
+ "href": "https://bitbucket.org/oliverpoignant/test-hook"
+ },
+ "self": {
+ "href": "https://api.bitbucket.org/2.0/repositories/oliverpoignant/test-hook"
+ }
+ },
+ "name": "test-hook",
+ "type": "repository",
+ "uuid": "{88ad4da3-6e3e-41ad-9aef-f3a26731d913}"
+ }
+ },
+ "state": "OPEN",
+ "task_count": 0,
+ "title": "ahhha edited online with Bitbucket",
+ "type": "pullrequest",
+ "updated_on": "2016-12-08T19:30:52.984875+00:00"
+ },
+ "repository": {
+ "full_name": "oliverpoignant/test-hook",
+ "is_private": true,
+ "links": {
+ "avatar": {
+ "href": "https://bitbucket.org/oliverpoignant/test-hook/avatar/32/"
+ },
+ "html": {
+ "href": "https://bitbucket.org/oliverpoignant/test-hook"
+ },
+ "self": {
+ "href": "https://api.bitbucket.org/2.0/repositories/oliverpoignant/test-hook"
+ }
+ },
+ "name": "test-hook",
+ "owner": {
+ "display_name": "Oliver Poignant",
+ "links": {
+ "avatar": {
+ "href": "https://bitbucket.org/account/oliverpoignant/avatar/32/"
+ },
+ "html": {
+ "href": "https://bitbucket.org/oliverpoignant/"
+ },
+ "self": {
+ "href": "https://api.bitbucket.org/2.0/users/oliverpoignant"
+ }
+ },
+ "type": "user",
+ "username": "oliverpoignant",
+ "uuid": "{d628d18b-5fe4-4f45-b34f-cc1a20073194}"
+ },
+ "scm": "git",
+ "type": "repository",
+ "uuid": "{88ad4da3-6e3e-41ad-9aef-f3a26731d913}",
+ "website": ""
+ }
+ }
+} \ No newline at end of file
diff --git a/test/samples/bitbucket-pr-created-filter.positive.test-case.json b/test/samples/bitbucket-pr-created-filter.positive.test-case.json
new file mode 100644
index 0000000..745acf6
--- /dev/null
+++ b/test/samples/bitbucket-pr-created-filter.positive.test-case.json
@@ -0,0 +1,214 @@
+{
+ "config": {
+ "branch": "master",
+ "deploy": "echo test!",
+ "remote": "origin",
+ "url": "https://bitbucket.org/oliverpoignant/test-hook.git",
+ "header-filter": {
+ "x-event-key": "pullrequest:created"
+ }
+ },
+ "expected": {
+ "status": 200,
+ "data": [
+ {
+ "deploy": 0
+ }
+ ]
+ },
+ "headers": {
+ "accept": "*/*",
+ "accept-encoding": "gzip, deflate",
+ "connection": "keep-alive",
+ "content-length": "4248",
+ "content-type": "application/json",
+ "host": "narpau.se:8001",
+ "user-agent": "Bitbucket-Webhooks/2.0",
+ "x-attempt-number": "1",
+ "x-event-key": "pullrequest:created",
+ "x-hook-uuid": "1f813038-7b26-4d08-9b80-ee76eeb53d93",
+ "x-request-uuid": "2e6626d9-effe-46f7-8bfd-e9dee9a58920"
+ },
+ "payload": {
+ "actor": {
+ "display_name": "Oliver Poignant",
+ "links": {
+ "avatar": {
+ "href": "https://bitbucket.org/account/oliverpoignant/avatar/32/"
+ },
+ "html": {
+ "href": "https://bitbucket.org/oliverpoignant/"
+ },
+ "self": {
+ "href": "https://api.bitbucket.org/2.0/users/oliverpoignant"
+ }
+ },
+ "type": "user",
+ "username": "oliverpoignant",
+ "uuid": "{d628d18b-5fe4-4f45-b34f-cc1a20073194}"
+ },
+ "pullrequest": {
+ "author": {
+ "display_name": "Oliver Poignant",
+ "links": {
+ "avatar": {
+ "href": "https://bitbucket.org/account/oliverpoignant/avatar/32/"
+ },
+ "html": {
+ "href": "https://bitbucket.org/oliverpoignant/"
+ },
+ "self": {
+ "href": "https://api.bitbucket.org/2.0/users/oliverpoignant"
+ }
+ },
+ "type": "user",
+ "username": "oliverpoignant",
+ "uuid": "{d628d18b-5fe4-4f45-b34f-cc1a20073194}"
+ },
+ "close_source_branch": false,
+ "closed_by": null,
+ "comment_count": 0,
+ "created_on": "2016-12-08T19:30:52.967233+00:00",
+ "description": "",
+ "destination": {
+ "branch": {
+ "name": "master"
+ },
+ "commit": {
+ "hash": "04dad24aa44d",
+ "links": {
+ "self": {
+ "href": "https://api.bitbucket.org/2.0/repositories/oliverpoignant/test-hook/commit/04dad24aa44d"
+ }
+ }
+ },
+ "repository": {
+ "full_name": "oliverpoignant/test-hook",
+ "links": {
+ "avatar": {
+ "href": "https://bitbucket.org/oliverpoignant/test-hook/avatar/32/"
+ },
+ "html": {
+ "href": "https://bitbucket.org/oliverpoignant/test-hook"
+ },
+ "self": {
+ "href": "https://api.bitbucket.org/2.0/repositories/oliverpoignant/test-hook"
+ }
+ },
+ "name": "test-hook",
+ "type": "repository",
+ "uuid": "{88ad4da3-6e3e-41ad-9aef-f3a26731d913}"
+ }
+ },
+ "id": 1,
+ "links": {
+ "activity": {
+ "href": "https://api.bitbucket.org/2.0/repositories/oliverpoignant/test-hook/pullrequests/1/activity"
+ },
+ "approve": {
+ "href": "https://api.bitbucket.org/2.0/repositories/oliverpoignant/test-hook/pullrequests/1/approve"
+ },
+ "comments": {
+ "href": "https://api.bitbucket.org/2.0/repositories/oliverpoignant/test-hook/pullrequests/1/comments"
+ },
+ "commits": {
+ "href": "https://api.bitbucket.org/2.0/repositories/oliverpoignant/test-hook/pullrequests/1/commits"
+ },
+ "decline": {
+ "href": "https://api.bitbucket.org/2.0/repositories/oliverpoignant/test-hook/pullrequests/1/decline"
+ },
+ "diff": {
+ "href": "https://api.bitbucket.org/2.0/repositories/oliverpoignant/test-hook/pullrequests/1/diff"
+ },
+ "html": {
+ "href": "https://bitbucket.org/oliverpoignant/test-hook/pull-requests/1"
+ },
+ "merge": {
+ "href": "https://api.bitbucket.org/2.0/repositories/oliverpoignant/test-hook/pullrequests/1/merge"
+ },
+ "self": {
+ "href": "https://api.bitbucket.org/2.0/repositories/oliverpoignant/test-hook/pullrequests/1"
+ },
+ "statuses": {
+ "href": "https://api.bitbucket.org/2.0/repositories/oliverpoignant/test-hook/pullrequests/1/statuses"
+ }
+ },
+ "merge_commit": null,
+ "participants": [],
+ "reason": "",
+ "reviewers": [],
+ "source": {
+ "branch": {
+ "name": "development"
+ },
+ "commit": {
+ "hash": "198a37b77185",
+ "links": {
+ "self": {
+ "href": "https://api.bitbucket.org/2.0/repositories/oliverpoignant/test-hook/commit/198a37b77185"
+ }
+ }
+ },
+ "repository": {
+ "full_name": "oliverpoignant/test-hook",
+ "links": {
+ "avatar": {
+ "href": "https://bitbucket.org/oliverpoignant/test-hook/avatar/32/"
+ },
+ "html": {
+ "href": "https://bitbucket.org/oliverpoignant/test-hook"
+ },
+ "self": {
+ "href": "https://api.bitbucket.org/2.0/repositories/oliverpoignant/test-hook"
+ }
+ },
+ "name": "test-hook",
+ "type": "repository",
+ "uuid": "{88ad4da3-6e3e-41ad-9aef-f3a26731d913}"
+ }
+ },
+ "state": "OPEN",
+ "task_count": 0,
+ "title": "ahhha edited online with Bitbucket",
+ "type": "pullrequest",
+ "updated_on": "2016-12-08T19:30:52.984875+00:00"
+ },
+ "repository": {
+ "full_name": "oliverpoignant/test-hook",
+ "is_private": true,
+ "links": {
+ "avatar": {
+ "href": "https://bitbucket.org/oliverpoignant/test-hook/avatar/32/"
+ },
+ "html": {
+ "href": "https://bitbucket.org/oliverpoignant/test-hook"
+ },
+ "self": {
+ "href": "https://api.bitbucket.org/2.0/repositories/oliverpoignant/test-hook"
+ }
+ },
+ "name": "test-hook",
+ "owner": {
+ "display_name": "Oliver Poignant",
+ "links": {
+ "avatar": {
+ "href": "https://bitbucket.org/account/oliverpoignant/avatar/32/"
+ },
+ "html": {
+ "href": "https://bitbucket.org/oliverpoignant/"
+ },
+ "self": {
+ "href": "https://api.bitbucket.org/2.0/users/oliverpoignant"
+ }
+ },
+ "type": "user",
+ "username": "oliverpoignant",
+ "uuid": "{d628d18b-5fe4-4f45-b34f-cc1a20073194}"
+ },
+ "scm": "git",
+ "type": "repository",
+ "uuid": "{88ad4da3-6e3e-41ad-9aef-f3a26731d913}",
+ "website": ""
+ }
+ }
+} \ No newline at end of file
diff --git a/test/samples/bitbucket.pr-fulfilled-filter.positive.test-case.json b/test/samples/bitbucket.pr-fulfilled-filter.positive.test-case.json
new file mode 100644
index 0000000..3998c71
--- /dev/null
+++ b/test/samples/bitbucket.pr-fulfilled-filter.positive.test-case.json
@@ -0,0 +1,249 @@
+{
+ "config": {
+ "branch": "master",
+ "deploy": "echo test!",
+ "remote": "origin",
+ "url": "https://bitbucket.org/team/repository.git",
+ "header-filter": {
+ "x-event-key": "pullrequest:fulfilled"
+ }
+ },
+ "expected": {
+ "status": 200,
+ "data": [
+ {
+ "deploy": 0
+ }
+ ]
+ },
+ "headers": {
+ "X-Request-UUID": "78b41616-e3b4-4f18-b911-4ba3baf5fec5",
+ "X-Event-Key": "pullrequest:fulfilled",
+ "User-Agent": "Bitbucket-Webhooks/2.0",
+ "X-Attempt-Number": "3",
+ "X-Hook-UUID": "07a11b9b-d82a-4558-a903-8b76e2b541f5",
+ "Content-Type": "application/json"
+ },
+ "payload": {
+ "pullrequest": {
+ "merge_commit": {
+ "hash": "4ea4f3f317a6",
+ "links": {
+ "self": {
+ "href": "https://api.bitbucket.org/2.0/repositories/team/repository/commit/4ea4f3f317a6"
+ }
+ }
+ },
+ "description": "",
+ "links": {
+ "decline": {
+ "href": "https://api.bitbucket.org/2.0/repositories/team/repository/pullrequests/156/decline"
+ },
+ "commits": {
+ "href": "https://api.bitbucket.org/2.0/repositories/team/repository/pullrequests/156/commits"
+ },
+ "self": {
+ "href": "https://api.bitbucket.org/2.0/repositories/team/repository/pullrequests/156"
+ },
+ "comments": {
+ "href": "https://api.bitbucket.org/2.0/repositories/team/repository/pullrequests/156/comments"
+ },
+ "merge": {
+ "href": "https://api.bitbucket.org/2.0/repositories/team/repository/pullrequests/156/merge"
+ },
+ "html": {
+ "href": "https://bitbucket.org/team/repository/pull-requests/156"
+ },
+ "activity": {
+ "href": "https://api.bitbucket.org/2.0/repositories/team/repository/pullrequests/156/activity"
+ },
+ "diff": {
+ "href": "https://api.bitbucket.org/2.0/repositories/team/repository/pullrequests/156/diff"
+ },
+ "approve": {
+ "href": "https://api.bitbucket.org/2.0/repositories/team/repository/pullrequests/156/approve"
+ },
+ "statuses": {
+ "href": "https://api.bitbucket.org/2.0/repositories/team/repository/pullrequests/156/statuses"
+ }
+ },
+ "author": {
+ "username": "User",
+ "display_name": "User",
+ "type": "user",
+ "uuid": "{59f0a5d6-47ab-4f00-899d-efc81e98dba1}",
+ "links": {
+ "self": {
+ "href": "https://api.bitbucket.org/2.0/users/User"
+ },
+ "html": {
+ "href": "https://bitbucket.org/User/"
+ },
+ "avatar": {
+ "href": "https://bitbucket.org/account/User/avatar/32/"
+ }
+ }
+ },
+ "close_source_branch": false,
+ "reviewers": [],
+ "destination": {
+ "commit": {
+ "hash": "095aa224e257",
+ "links": {
+ "self": {
+ "href": "https://api.bitbucket.org/2.0/repositories/team/repository/commit/095aa224e257"
+ }
+ }
+ },
+ "branch": {
+ "name": "master"
+ },
+ "repository": {
+ "full_name": "team/repository",
+ "type": "repository",
+ "uuid": "{a064b276-e793-42a5-8b27-050056718971}",
+ "links": {
+ "self": {
+ "href": "https://api.bitbucket.org/2.0/repositories/team/repository"
+ },
+ "html": {
+ "href": "https://bitbucket.org/team/repository"
+ },
+ "avatar": {
+ "href": "https://bitbucket.org/team/repository/avatar/32/"
+ }
+ },
+ "name": "Repository Name"
+ }
+ },
+ "comment_count": 0,
+ "id": 156,
+ "source": {
+ "commit": {
+ "hash": "d41c93cba906",
+ "links": {
+ "self": {
+ "href": "https://api.bitbucket.org/2.0/repositories/team/repository/commit/d41c93cba906"
+ }
+ }
+ },
+ "branch": {
+ "name": "develop"
+ },
+ "repository": {
+ "full_name": "team/repository",
+ "type": "repository",
+ "uuid": "{a064b276-e793-42a5-8b27-050056718971}",
+ "links": {
+ "self": {
+ "href": "https://api.bitbucket.org/2.0/repositories/team/repository"
+ },
+ "html": {
+ "href": "https://bitbucket.org/team/repository"
+ },
+ "avatar": {
+ "href": "https://bitbucket.org/team/repository/avatar/32/"
+ }
+ },
+ "name": "Repository Name"
+ }
+ },
+ "participants": [],
+ "state": "MERGED",
+ "task_count": 0,
+ "created_on": "2016-12-02T19:13:24.073024+00:00",
+ "updated_on": "2016-12-02T19:13:47.132095+00:00",
+ "reason": "",
+ "title": "Pull request title.",
+ "type": "pullrequest",
+ "closed_by": {
+ "username": "User",
+ "display_name": "User",
+ "type": "user",
+ "uuid": "{59f0a5d6-47ab-4f00-899d-efc81e98dba1}",
+ "links": {
+ "self": {
+ "href": "https://api.bitbucket.org/2.0/users/User"
+ },
+ "html": {
+ "href": "https://bitbucket.org/User/"
+ },
+ "avatar": {
+ "href": "https://bitbucket.org/account/User/avatar/32/"
+ }
+ }
+ }
+ },
+ "repository": {
+ "website": "",
+ "scm": "git",
+ "uuid": "{a064b276-e793-42a5-8b27-050056718971}",
+ "links": {
+ "self": {
+ "href": "https://api.bitbucket.org/2.0/repositories/team/repository"
+ },
+ "html": {
+ "href": "https://bitbucket.org/team/repository"
+ },
+ "avatar": {
+ "href": "https://bitbucket.org/team/repository/avatar/32/"
+ }
+ },
+ "project": {
+ "links": {
+ "self": {
+ "href": "https://api.bitbucket.org/2.0/teams/team/projects/PROJ"
+ },
+ "html": {
+ "href": "https://bitbucket.org/account/user/team/projects/PROJ"
+ },
+ "avatar": {
+ "href": "https://bitbucket.org/account/user/team/projects/PROJ/avatar/32"
+ }
+ },
+ "type": "project",
+ "uuid": "{0b88330f-47da-4fa8-9a61-dc8e0dae21f1}",
+ "key": "PROJ",
+ "name": "Repository Name"
+ },
+ "full_name": "team/repository",
+ "owner": {
+ "username": "team",
+ "display_name": "Repository Name ",
+ "type": "team",
+ "uuid": "{1ac257f7-39d5-49b4-acbd-21def2e164fc}",
+ "links": {
+ "self": {
+ "href": "https://api.bitbucket.org/2.0/teams/team"
+ },
+ "html": {
+ "href": "https://bitbucket.org/team/"
+ },
+ "avatar": {
+ "href": "https://bitbucket.org/account/team/avatar/32/"
+ }
+ }
+ },
+ "type": "repository",
+ "is_private": true,
+ "name": "Repository Name"
+ },
+ "actor": {
+ "username": "User",
+ "display_name": "User",
+ "type": "user",
+ "uuid": "{59f0a5d6-47ab-4f00-899d-efc81e98dba1}",
+ "links": {
+ "self": {
+ "href": "https://api.bitbucket.org/2.0/users/User"
+ },
+ "html": {
+ "href": "https://bitbucket.org/User/"
+ },
+ "avatar": {
+ "href": "https://bitbucket.org/account/User/avatar/32/"
+ }
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/test/samples/bitbucket.pr-fulfilled.negative.test-case.json b/test/samples/bitbucket.pr-fulfilled.negative.test-case.json
new file mode 100644
index 0000000..8f85a20
--- /dev/null
+++ b/test/samples/bitbucket.pr-fulfilled.negative.test-case.json
@@ -0,0 +1,245 @@
+{
+ "config": {
+ "branch": "master",
+ "deploy": "echo test!",
+ "remote": "origin",
+ "url": "https://bitbucket.org/team/repository.git",
+ "header-filter": {
+ "x-event-key": "pullrequest:created"
+ }
+ },
+ "expected": {
+ "status": 200,
+ "data": []
+ },
+ "headers": {
+ "X-Request-UUID": "78b41616-e3b4-4f18-b911-4ba3baf5fec5",
+ "X-Event-Key": "pullrequest:fulfilled",
+ "User-Agent": "Bitbucket-Webhooks/2.0",
+ "X-Attempt-Number": "3",
+ "X-Hook-UUID": "07a11b9b-d82a-4558-a903-8b76e2b541f5",
+ "Content-Type": "application/json"
+ },
+ "payload": {
+ "pullrequest": {
+ "merge_commit": {
+ "hash": "4ea4f3f317a6",
+ "links": {
+ "self": {
+ "href": "https://api.bitbucket.org/2.0/repositories/team/repository/commit/4ea4f3f317a6"
+ }
+ }
+ },
+ "description": "",
+ "links": {
+ "decline": {
+ "href": "https://api.bitbucket.org/2.0/repositories/team/repository/pullrequests/156/decline"
+ },
+ "commits": {
+ "href": "https://api.bitbucket.org/2.0/repositories/team/repository/pullrequests/156/commits"
+ },
+ "self": {
+ "href": "https://api.bitbucket.org/2.0/repositories/team/repository/pullrequests/156"
+ },
+ "comments": {
+ "href": "https://api.bitbucket.org/2.0/repositories/team/repository/pullrequests/156/comments"
+ },
+ "merge": {
+ "href": "https://api.bitbucket.org/2.0/repositories/team/repository/pullrequests/156/merge"
+ },
+ "html": {
+ "href": "https://bitbucket.org/team/repository/pull-requests/156"
+ },
+ "activity": {
+ "href": "https://api.bitbucket.org/2.0/repositories/team/repository/pullrequests/156/activity"
+ },
+ "diff": {
+ "href": "https://api.bitbucket.org/2.0/repositories/team/repository/pullrequests/156/diff"
+ },
+ "approve": {
+ "href": "https://api.bitbucket.org/2.0/repositories/team/repository/pullrequests/156/approve"
+ },
+ "statuses": {
+ "href": "https://api.bitbucket.org/2.0/repositories/team/repository/pullrequests/156/statuses"
+ }
+ },
+ "author": {
+ "username": "User",
+ "display_name": "User",
+ "type": "user",
+ "uuid": "{59f0a5d6-47ab-4f00-899d-efc81e98dba1}",
+ "links": {
+ "self": {
+ "href": "https://api.bitbucket.org/2.0/users/User"
+ },
+ "html": {
+ "href": "https://bitbucket.org/User/"
+ },
+ "avatar": {
+ "href": "https://bitbucket.org/account/User/avatar/32/"
+ }
+ }
+ },
+ "close_source_branch": false,
+ "reviewers": [],
+ "destination": {
+ "commit": {
+ "hash": "095aa224e257",
+ "links": {
+ "self": {
+ "href": "https://api.bitbucket.org/2.0/repositories/team/repository/commit/095aa224e257"
+ }
+ }
+ },
+ "branch": {
+ "name": "master"
+ },
+ "repository": {
+ "full_name": "team/repository",
+ "type": "repository",
+ "uuid": "{a064b276-e793-42a5-8b27-050056718971}",
+ "links": {
+ "self": {
+ "href": "https://api.bitbucket.org/2.0/repositories/team/repository"
+ },
+ "html": {
+ "href": "https://bitbucket.org/team/repository"
+ },
+ "avatar": {
+ "href": "https://bitbucket.org/team/repository/avatar/32/"
+ }
+ },
+ "name": "Repository Name"
+ }
+ },
+ "comment_count": 0,
+ "id": 156,
+ "source": {
+ "commit": {
+ "hash": "d41c93cba906",
+ "links": {
+ "self": {
+ "href": "https://api.bitbucket.org/2.0/repositories/team/repository/commit/d41c93cba906"
+ }
+ }
+ },
+ "branch": {
+ "name": "develop"
+ },
+ "repository": {
+ "full_name": "team/repository",
+ "type": "repository",
+ "uuid": "{a064b276-e793-42a5-8b27-050056718971}",
+ "links": {
+ "self": {
+ "href": "https://api.bitbucket.org/2.0/repositories/team/repository"
+ },
+ "html": {
+ "href": "https://bitbucket.org/team/repository"
+ },
+ "avatar": {
+ "href": "https://bitbucket.org/team/repository/avatar/32/"
+ }
+ },
+ "name": "Repository Name"
+ }
+ },
+ "participants": [],
+ "state": "MERGED",
+ "task_count": 0,
+ "created_on": "2016-12-02T19:13:24.073024+00:00",
+ "updated_on": "2016-12-02T19:13:47.132095+00:00",
+ "reason": "",
+ "title": "Pull request title.",
+ "type": "pullrequest",
+ "closed_by": {
+ "username": "User",
+ "display_name": "User",
+ "type": "user",
+ "uuid": "{59f0a5d6-47ab-4f00-899d-efc81e98dba1}",
+ "links": {
+ "self": {
+ "href": "https://api.bitbucket.org/2.0/users/User"
+ },
+ "html": {
+ "href": "https://bitbucket.org/User/"
+ },
+ "avatar": {
+ "href": "https://bitbucket.org/account/User/avatar/32/"
+ }
+ }
+ }
+ },
+ "repository": {
+ "website": "",
+ "scm": "git",
+ "uuid": "{a064b276-e793-42a5-8b27-050056718971}",
+ "links": {
+ "self": {
+ "href": "https://api.bitbucket.org/2.0/repositories/team/repository"
+ },
+ "html": {
+ "href": "https://bitbucket.org/team/repository"
+ },
+ "avatar": {
+ "href": "https://bitbucket.org/team/repository/avatar/32/"
+ }
+ },
+ "project": {
+ "links": {
+ "self": {
+ "href": "https://api.bitbucket.org/2.0/teams/team/projects/PROJ"
+ },
+ "html": {
+ "href": "https://bitbucket.org/account/user/team/projects/PROJ"
+ },
+ "avatar": {
+ "href": "https://bitbucket.org/account/user/team/projects/PROJ/avatar/32"
+ }
+ },
+ "type": "project",
+ "uuid": "{0b88330f-47da-4fa8-9a61-dc8e0dae21f1}",
+ "key": "PROJ",
+ "name": "Repository Name"
+ },
+ "full_name": "team/repository",
+ "owner": {
+ "username": "team",
+ "display_name": "Repository Name ",
+ "type": "team",
+ "uuid": "{1ac257f7-39d5-49b4-acbd-21def2e164fc}",
+ "links": {
+ "self": {
+ "href": "https://api.bitbucket.org/2.0/teams/team"
+ },
+ "html": {
+ "href": "https://bitbucket.org/team/"
+ },
+ "avatar": {
+ "href": "https://bitbucket.org/account/team/avatar/32/"
+ }
+ }
+ },
+ "type": "repository",
+ "is_private": true,
+ "name": "Repository Name"
+ },
+ "actor": {
+ "username": "User",
+ "display_name": "User",
+ "type": "user",
+ "uuid": "{59f0a5d6-47ab-4f00-899d-efc81e98dba1}",
+ "links": {
+ "self": {
+ "href": "https://api.bitbucket.org/2.0/users/User"
+ },
+ "html": {
+ "href": "https://bitbucket.org/User/"
+ },
+ "avatar": {
+ "href": "https://bitbucket.org/account/User/avatar/32/"
+ }
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/test/samples/github-pr-open.test-case.json b/test/samples/github-pr-open.test-case.json
index 06d76b5..1041eb4 100644
--- a/test/samples/github-pr-open.test-case.json
+++ b/test/samples/github-pr-open.test-case.json
@@ -3,7 +3,13 @@
"branch": "master",
"deploy": "echo test!",
"remote": "origin",
- "url": "https://github.com/olipo186/Git-Auto-Deploy.git"
+ "url": "https://github.com/olipo186/Git-Auto-Deploy.git",
+ "payload-filter": [
+ {
+ "action": "opened",
+ "pull_request.user.login": "olipo186"
+ }
+ ]
},
"expected": {
"status": 200,
diff --git a/test/test_parsers.py b/test/test_parsers.py
index d1e8c83..a102503 100644
--- a/test/test_parsers.py
+++ b/test/test_parsers.py
@@ -22,7 +22,7 @@ class WebhookTestCase(WebhookTestCaseBase):
'port': 0,
'intercept-stdout': False,
'detailed-response': True,
- 'log-level': 'ERROR',
+ 'log-level': 'WARNING',
'repositories': []
}