Skip to content

Commit

Permalink
tests.rollback - do not use random sorting, use all available files w…
Browse files Browse the repository at this point in the history
…here useful
  • Loading branch information
MatteoCampinoti94 committed Dec 19, 2024
1 parent b127cc4 commit 1ce1c21
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/test_rollback.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def test_rollback_edit_original_action_convert(avid_folder_copy: Path):
avid = AVID(avid_folder_copy)

with FilesDB(avid.database_path) as database:
files = database.original_files.select("action != 'convert'", order_by=[("random()", "asc")]).fetchmany(2)
files = database.original_files.select("action != 'convert'").fetchall()

run_click(
avid.path,
Expand Down Expand Up @@ -78,7 +78,7 @@ def test_rollback_edit_original_processed(avid_folder_copy: Path):
avid = AVID(avid_folder_copy)

with FilesDB(avid.database_path) as database:
files = database.original_files.select("not processed", order_by=[("random()", "asc")]).fetchmany(2)
files = database.original_files.select("not processed").fetchall()

run_click(
avid.path,
Expand Down Expand Up @@ -107,7 +107,7 @@ def test_rollback_edit_original_lock(avid_folder_copy: Path):
avid = AVID(avid_folder_copy)

with FilesDB(avid.database_path) as database:
files = database.original_files.select("not lock", order_by=[("random()", "asc")]).fetchmany(2)
files = database.original_files.select("not lock").fetchall()

run_click(
avid.path, app, "edit", "original", "lock", f"@uuid {' '.join(str(f.uuid) for f in files)}", "--lock", "test"
Expand All @@ -129,7 +129,7 @@ def test_rollback_edit_original_rename(avid_folder_copy: Path):
avid = AVID(avid_folder_copy)

with FilesDB(avid.database_path) as database:
files = database.original_files.select(order_by=[("random()", "asc")]).fetchmany(2)
files = database.original_files.select().fetchmany(2)

run_click(
avid.path,
Expand Down Expand Up @@ -163,7 +163,7 @@ def test_rollback_edit_original_remove(avid_folder_copy: Path):
avid = AVID(avid_folder_copy)

with FilesDB(avid.database_path) as database:
files = database.original_files.select(order_by=[("random()", "asc")]).fetchmany(2)
files = database.original_files.select().fetchmany(2)

run_click(avid.path, app, "edit", "original", "remove", f"@uuid {' '.join(str(f.uuid) for f in files)}", "test")

Expand All @@ -185,7 +185,7 @@ def test_rollback_edit_original_remove_delete(avid_folder_copy: Path):
avid = AVID(avid_folder_copy)

with FilesDB(avid.database_path) as database:
files = database.original_files.select(order_by=[("random()", "asc")]).fetchmany(2)
files = database.original_files.select().fetchmany(2)

run_click(
avid.path,
Expand Down

0 comments on commit 1ce1c21

Please sign in to comment.