@@ -125,15 +125,15 @@ async def test_github_webhook_errors(aiohttp_client, monkeypatch):
125125
126126 resp = await client .post (
127127 '/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"}} }' )
130130 assert resp .status == 400
131131 assert 'incorrect organization' in await resp .text ()
132132
133133 resp = await client .post (
134134 '/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"}} }' )
137137 assert resp .status == 400
138138 assert 'incorrect repository' in await resp .text ()
139139
@@ -158,19 +158,20 @@ async def test_github_webhook_valid(aiohttp_client, monkeypatch):
158158 resp = await client .post (
159159 '/gh/non-existent-repo' ,
160160 headers = {** valid_headers , 'X-GitHub-Event' : 'ping' },
161- data = '{"sender": " QuLogic", "hook_id": 1234,'
161+ data = '{"sender": {"login": " QuLogic"} , "hook_id": 1234,'
162162 ' "zen": "Beautiful is better than ugly.",'
163- ' "organization ": "matplotlib ",'
164- ' "repository ": "non-existent-repo" }' )
163+ ' "repository ": {"name": "non-existent-repo ",'
164+ ' "owner ": {"login": "matplotlib"}} }' )
165165 assert resp .status == 200
166166 ur_mock .assert_not_called ()
167167
168168 # Push event should run an update.
169169 resp = await client .post (
170170 '/gh/non-existent-repo' ,
171171 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"}}}' )
174175 assert resp .status == 200
175176 ur_mock .assert_called_once_with (
176177 Path ('non-existent-site-dir/non-existent-repo' ), 'foo' ,
0 commit comments