File tree 2 files changed +12
-4
lines changed
2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -231,10 +231,16 @@ def exists(self, path):
231
231
return self .fs .exists (self ._join (path ))
232
232
233
233
async def _info (self , path , ** kwargs ):
234
- return await self .fs ._info (self ._join (path ), ** kwargs )
234
+ info = await self .fs ._info (self ._join (path ), ** kwargs )
235
+ info = info .copy ()
236
+ info ["name" ] = self ._relpath (info ["name" ])
237
+ return info
235
238
236
239
def info (self , path , ** kwargs ):
237
- return self .fs .info (self ._join (path ), ** kwargs )
240
+ info = self .fs .info (self ._join (path ), ** kwargs )
241
+ info = info .copy ()
242
+ info ["name" ] = self ._relpath (info ["name" ])
243
+ return info
238
244
239
245
async def _ls (self , path , detail = True , ** kwargs ):
240
246
ret = (await self .fs ._ls (self ._join (path ), detail = detail , ** kwargs )).copy ()
Original file line number Diff line number Diff line change @@ -327,12 +327,14 @@ def test_exists(dirfs):
327
327
328
328
@pytest .mark .asyncio
329
329
async def test_async_info (adirfs ):
330
- assert await adirfs ._info ("file" , ** KWARGS ) == adirfs .fs ._info .return_value
330
+ adirfs .fs ._info .return_value = {"name" : f"{ PATH } /file" , "foo" : "bar" }
331
+ assert await adirfs ._info ("file" , ** KWARGS ) == {"name" : "file" , "foo" : "bar" }
331
332
adirfs .fs ._info .assert_called_once_with (f"{ PATH } /file" , ** KWARGS )
332
333
333
334
334
335
def test_info (dirfs ):
335
- assert dirfs .info ("file" , ** KWARGS ) == dirfs .fs .info .return_value
336
+ dirfs .fs .info .return_value = {"name" : f"{ PATH } /file" , "foo" : "bar" }
337
+ assert dirfs .info ("file" , ** KWARGS ) == {"name" : "file" , "foo" : "bar" }
336
338
dirfs .fs .info .assert_called_once_with (f"{ PATH } /file" , ** KWARGS )
337
339
338
340
You can’t perform that action at this time.
0 commit comments