@@ -500,7 +500,7 @@ def test_backup_and_restore_with_collection_and_config_1_24_x(
500500@pytest .mark .parametrize ("dynamic_backup_location" , [False , True ])
501501def test_cancel_backup (
502502 client : weaviate .WeaviateClient ,
503- dynamic_backup_location ,
503+ dynamic_backup_location : bool ,
504504 tmp_path : pathlib .Path ,
505505 request : SubRequest ,
506506) -> None :
@@ -617,6 +617,21 @@ def test_list_backup(client: weaviate.WeaviateClient, request: SubRequest) -> No
617617 time .sleep (0.1 )
618618
619619
620+ def test_list_backup_ascending_order (client : weaviate .WeaviateClient , request : SubRequest ) -> None :
621+ """List all backups in ascending order."""
622+ backup_id = unique_backup_id (request .node .name )
623+ if client ._connection ._weaviate_version .is_lower_than (1 , 33 , 2 ):
624+ pytest .skip ("List backups sorting is only supported from 1.33.2" )
625+
626+ resp = client .backup .create (backup_id = backup_id , backend = BACKEND )
627+ assert resp .status == BackupStatus .STARTED
628+
629+ backups = client .backup .list_backups (backend = BACKEND , sort_by_starting_time_asc = True )
630+ assert backup_id .lower () in [b .backup_id .lower () for b in backups ]
631+
632+ assert sorted (backups , key = lambda b : b .started_at or b .backup_id ) == backups
633+
634+
620635@pytest .fixture
621636def artist_alias (client : weaviate .WeaviateClient ) -> Generator [str , None , None ]:
622637 if client ._connection ._weaviate_version .is_lower_than (1 , 32 , 0 ):
0 commit comments