@@ -409,13 +409,12 @@ async def test_get_revisions(self, provider, revision_fixtures):
409409 path = OneDrivePath ('/bicuspids.txt' , _ids = [revision_fixtures ['root_id' ], file_id ])
410410
411411 revision_response = revision_fixtures ['file_revisions' ]
412- revisions_url = provider ._build_drive_url ('items' , file_id , 'view.delta' ,
413- top = provider .MAX_REVISIONS )
412+ revisions_url = provider ._build_drive_url (* path .api_identifier , 'versions' )
414413 aiohttpretty .register_json_uri ('GET' , revisions_url , body = revision_response )
415414
416415 result = await provider .revisions (path )
417416
418- assert len (result ) == 1
417+ assert len (result ) == 5
419418
420419
421420class TestDownload :
@@ -440,20 +439,19 @@ async def test_download_standard_file(self, provider, download_fixtures):
440439
441440 @pytest .mark .asyncio
442441 @pytest .mark .aiohttpretty
443- async def test_download_by_revision (self , provider , download_fixtures ):
442+ async def test_download_by_revision (self , provider , download_fixtures , revision_fixtures ):
444443 file_id = download_fixtures ['file_id' ]
445444 path = OneDrivePath ('/toes.txt' , _ids = [download_fixtures ['root_id' ], file_id ])
446445
447- revision_response = download_fixtures ['file_revisions' ]
448- revisions_url = provider ._build_drive_url ('items' , file_id , 'view.delta' ,
449- top = provider .MAX_REVISIONS )
446+ revision_response = revision_fixtures ['file_revisions' ]
447+ revisions_url = provider ._build_drive_url (* path .api_identifier , 'versions' )
450448 aiohttpretty .register_json_uri ('GET' , revisions_url , body = revision_response )
451449
452- aiohttpretty .register_uri ('GET' , download_fixtures ['file_revision_download_url' ],
450+ aiohttpretty .register_uri ('GET' , revision_fixtures ['file_revision_download_url' ],
453451 body = download_fixtures ['file_content' ],
454452 headers = {'Content-Length' : '11' })
455453
456- response = await provider .download (path , revision = download_fixtures [ 'file_revision ' ])
454+ response = await provider .download (path , revision = revision_fixtures [ 'revision_id ' ])
457455 content = await response .read ()
458456 assert content == b'ten of them'
459457
@@ -470,8 +468,7 @@ async def test_download_by_bad_revision(self, provider, download_fixtures):
470468 path = OneDrivePath ('/toes.txt' , _ids = [download_fixtures ['root_id' ], file_id ])
471469
472470 revision_response = download_fixtures ['file_revisions' ]
473- revisions_url = provider ._build_drive_url ('items' , file_id , 'view.delta' ,
474- top = provider .MAX_REVISIONS )
471+ revisions_url = provider ._build_drive_url (* path .api_identifier , 'versions' )
475472 aiohttpretty .register_json_uri ('GET' , revisions_url , body = revision_response )
476473
477474 with pytest .raises (exceptions .NotFoundError ) as exc :
@@ -497,12 +494,12 @@ async def test_download_unexportable_by_revision(self, provider, download_fixtur
497494 path = OneDrivePath ('/onenote' , _ids = [download_fixtures ['root_id' ], onenote_id ])
498495
499496 revision_response = download_fixtures ['onenote_revisions' ]
500- revisions_url = provider ._build_drive_url ('items' , onenote_id , 'view.delta' ,
501- top = provider .MAX_REVISIONS )
497+ revisions_url = provider ._build_drive_url ('items' , onenote_id , 'versions' )
502498 aiohttpretty .register_json_uri ('GET' , revisions_url , body = revision_response )
503499
504500 with pytest .raises (exceptions .UnexportableFileTypeError ) as exc :
505- await provider .download (path , revision = download_fixtures ['onenote_revision' ])
501+ await provider .download (path ,
502+ revision = download_fixtures ['onenote_revision_non_exportable' ])
506503
507504
508505class TestReadOnlyProvider :
0 commit comments