@@ -125,15 +125,15 @@ async def test_github_webhook_errors(aiohttp_client, monkeypatch):
125
125
126
126
resp = await client .post (
127
127
'/gh/non-existent-repo' , headers = valid_headers ,
128
- data = '{"sender": "QuLogic", "organization" : "foo" ,'
129
- ' "repository": " foo"}' )
128
+ data = '{"sender": {"login" : "QuLogic"} ,'
129
+ ' "repository": {"name": " foo", "owner": {"login": "foo"}} }' )
130
130
assert resp .status == 400
131
131
assert 'incorrect organization' in await resp .text ()
132
132
133
133
resp = await client .post (
134
134
'/gh/non-existent-repo' , headers = valid_headers ,
135
- data = '{"sender": "QuLogic", "organization": "matplotlib", '
136
- ' "repository ": "foo"}' )
135
+ data = '{"sender": {"login": "QuLogic"}, "repository": '
136
+ ' {"name ": "foo", "owner": {"login": "matplotlib"}} }' )
137
137
assert resp .status == 400
138
138
assert 'incorrect repository' in await resp .text ()
139
139
@@ -158,19 +158,20 @@ async def test_github_webhook_valid(aiohttp_client, monkeypatch):
158
158
resp = await client .post (
159
159
'/gh/non-existent-repo' ,
160
160
headers = {** valid_headers , 'X-GitHub-Event' : 'ping' },
161
- data = '{"sender": " QuLogic", "hook_id": 1234,'
161
+ data = '{"sender": {"login": " QuLogic"} , "hook_id": 1234,'
162
162
' "zen": "Beautiful is better than ugly.",'
163
- ' "organization ": "matplotlib ",'
164
- ' "repository ": "non-existent-repo" }' )
163
+ ' "repository ": {"name": "non-existent-repo ",'
164
+ ' "owner ": {"login": "matplotlib"}} }' )
165
165
assert resp .status == 200
166
166
ur_mock .assert_not_called ()
167
167
168
168
# Push event should run an update.
169
169
resp = await client .post (
170
170
'/gh/non-existent-repo' ,
171
171
headers = {** valid_headers , 'X-GitHub-Event' : 'push' },
172
- data = '{"sender": "QuLogic", "organization": "matplotlib",'
173
- ' "repository": "non-existent-repo"}' )
172
+ data = '{"sender": {"login": "QuLogic"},'
173
+ ' "repository": {"name": "non-existent-repo",'
174
+ ' "owner": {"login": "matplotlib"}}}' )
174
175
assert resp .status == 200
175
176
ur_mock .assert_called_once_with (
176
177
Path ('non-existent-site-dir/non-existent-repo' ), 'foo' ,
0 commit comments