@@ -129,8 +129,8 @@ def repository_id():
129
129
130
130
131
131
@pytest .fixture
132
- def get_mock_github_api ():
133
- def _get_mock_github_api (return_data , installation_id = 12345 ):
132
+ def aget_mock_github_api ():
133
+ def _aget_mock_github_api (return_data , installation_id = 12345 ):
134
134
mock_api = AsyncMock (spec = AsyncGitHubAPI )
135
135
136
136
async def mock_getitem (* args , ** kwargs ):
@@ -148,12 +148,12 @@ async def mock_getiter(*args, **kwargs):
148
148
149
149
return mock_api
150
150
151
- return _get_mock_github_api
151
+ return _aget_mock_github_api
152
152
153
153
154
154
@pytest .fixture
155
- def get_mock_github_api_sync ():
156
- def _get_mock_github_api_sync (return_data , installation_id = 12345 ):
155
+ def get_mock_github_api ():
156
+ def _get_mock_github_api (return_data , installation_id = 12345 ):
157
157
from django_github_app .github import SyncGitHubAPI
158
158
159
159
mock_api = MagicMock (spec = SyncGitHubAPI )
@@ -174,15 +174,15 @@ def mock_post(*args, **kwargs):
174
174
175
175
return mock_api
176
176
177
- return _get_mock_github_api_sync
177
+ return _get_mock_github_api
178
178
179
179
180
180
@pytest .fixture
181
- def installation (get_mock_github_api , baker ):
181
+ def installation (aget_mock_github_api , baker ):
182
182
installation = baker .make (
183
183
"django_github_app.Installation" , installation_id = seq .next ()
184
184
)
185
- mock_github_api = get_mock_github_api (
185
+ mock_github_api = aget_mock_github_api (
186
186
[
187
187
{"id" : seq .next (), "node_id" : "node1" , "full_name" : "owner/repo1" },
188
188
{"id" : seq .next (), "node_id" : "node2" , "full_name" : "owner/repo2" },
@@ -194,11 +194,11 @@ def installation(get_mock_github_api, baker):
194
194
195
195
196
196
@pytest_asyncio .fixture
197
- async def ainstallation (get_mock_github_api , baker ):
197
+ async def ainstallation (aget_mock_github_api , baker ):
198
198
installation = await sync_to_async (baker .make )(
199
199
"django_github_app.Installation" , installation_id = seq .next ()
200
200
)
201
- mock_github_api = get_mock_github_api (
201
+ mock_github_api = aget_mock_github_api (
202
202
[
203
203
{"id" : seq .next (), "node_id" : "node1" , "full_name" : "owner/repo1" },
204
204
{"id" : seq .next (), "node_id" : "node2" , "full_name" : "owner/repo2" },
@@ -210,14 +210,14 @@ async def ainstallation(get_mock_github_api, baker):
210
210
211
211
212
212
@pytest .fixture
213
- def repository (installation , get_mock_github_api , baker ):
213
+ def repository (installation , aget_mock_github_api , baker ):
214
214
repository = baker .make (
215
215
"django_github_app.Repository" ,
216
216
repository_id = seq .next (),
217
217
full_name = "owner/repo" ,
218
218
installation = installation ,
219
219
)
220
- mock_github_api = get_mock_github_api (
220
+ mock_github_api = aget_mock_github_api (
221
221
[
222
222
{
223
223
"number" : 1 ,
@@ -237,14 +237,14 @@ def repository(installation, get_mock_github_api, baker):
237
237
238
238
239
239
@pytest_asyncio .fixture
240
- async def arepository (ainstallation , get_mock_github_api , baker ):
240
+ async def arepository (ainstallation , aget_mock_github_api , baker ):
241
241
repository = await sync_to_async (baker .make )(
242
242
"django_github_app.Repository" ,
243
243
repository_id = seq .next (),
244
244
full_name = "owner/repo" ,
245
245
installation = ainstallation ,
246
246
)
247
- mock_github_api = get_mock_github_api (
247
+ mock_github_api = aget_mock_github_api (
248
248
[
249
249
{
250
250
"number" : 1 ,
0 commit comments