@@ -61,7 +61,9 @@ async def async_client(token) -> AsyncClient:
61
61
62
62
# The configs array paramaterizes the tests in this file to run with different clients.
63
63
# To make changes, modify both the configs array and the config fixture
64
- Config = Literal ["Client_autodetect_sync" , "Client_autodetect_async" , "SyncClient" , "AsyncClient" ]
64
+ Config = Literal [
65
+ "Client_autodetect_sync" , "Client_autodetect_async" , "SyncClient" , "AsyncClient"
66
+ ]
65
67
configs : List [Config ] = [
66
68
"Client_autodetect_sync" ,
67
69
"Client_autodetect_async" ,
@@ -200,7 +202,10 @@ async def test_caveated_check(client):
200
202
context = None ,
201
203
)
202
204
resp = await maybe_await (client .CheckPermission (req ))
203
- assert resp .permissionship == CheckPermissionResponse .PERMISSIONSHIP_CONDITIONAL_PERMISSION
205
+ assert (
206
+ resp .permissionship
207
+ == CheckPermissionResponse .PERMISSIONSHIP_CONDITIONAL_PERMISSION
208
+ )
204
209
assert "likes" in resp .partial_caveat_info .missing_required_context
205
210
206
211
@@ -272,10 +277,12 @@ async def test_bulk_check(client):
272
277
273
278
assert len (resp .pairs ) == 2
274
279
assert (
275
- resp .pairs [0 ].item .permissionship == CheckPermissionResponse .PERMISSIONSHIP_HAS_PERMISSION
280
+ resp .pairs [0 ].item .permissionship
281
+ == CheckPermissionResponse .PERMISSIONSHIP_HAS_PERMISSION
276
282
)
277
283
assert (
278
- resp .pairs [1 ].item .permissionship == CheckPermissionResponse .PERMISSIONSHIP_HAS_PERMISSION
284
+ resp .pairs [1 ].item .permissionship
285
+ == CheckPermissionResponse .PERMISSIONSHIP_HAS_PERMISSION
279
286
)
280
287
281
288
@@ -308,7 +315,9 @@ async def test_bulk_export_import(client):
308
315
309
316
# do bulk import
310
317
reqs = [BulkImportRelationshipsRequest (relationships = rels )]
311
- import_rels = await maybe_await (empty_client .BulkImportRelationships (((req for req in reqs ))))
318
+ import_rels = await maybe_await (
319
+ empty_client .BulkImportRelationships ((req for req in reqs ))
320
+ )
312
321
assert import_rels .num_loaded == 4
313
322
314
323
# validate all relationships were imported
@@ -381,7 +390,9 @@ async def write_test_tuples(client):
381
390
resource = post_one ,
382
391
relation = "caveated_reader" ,
383
392
subject = beatrice ,
384
- optional_caveat = ContextualizedCaveat (caveat_name = "likes_harry_potter" ),
393
+ optional_caveat = ContextualizedCaveat (
394
+ caveat_name = "likes_harry_potter"
395
+ ),
385
396
),
386
397
),
387
398
]
@@ -420,7 +431,9 @@ async def maybe_await(resp: T) -> T:
420
431
return resp
421
432
422
433
423
- async def maybe_async_iterable_to_list (iterable : Union [Iterable [T ], AsyncIterable [T ]]) -> List [T ]:
434
+ async def maybe_async_iterable_to_list (
435
+ iterable : Union [Iterable [T ], AsyncIterable [T ]],
436
+ ) -> List [T ]:
424
437
items = []
425
438
if isinstance (iterable , AsyncIterable ):
426
439
async for item in iterable :
0 commit comments