Skip to content

Commit

Permalink
test_file_versions: test only case
Browse files Browse the repository at this point in the history
  • Loading branch information
bigcat88 committed Apr 23, 2024
1 parent 44d3805 commit 4ba0564
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions tests/actual_tests/files_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1055,17 +1055,14 @@ async def test_trashbin_async(anc_any, file_path):
assert not r


@pytest.mark.parametrize("update_by_id", (False, True))
def test_file_versions(nc_any, update_by_id):
def test_file_versions(nc_any):
if nc_any.check_capabilities("files.versioning"):
pytest.skip("Need 'Versions' App to be enabled.")
dest_path = "/test_dir_tmp/file_versions-ä.txt"
nc_any.files.delete(dest_path, not_fail=True)
nc_any.files.upload(dest_path, content=b"22")
time.sleep(2.0)
new_file = nc_any.files.upload(dest_path, content=b"333")
if update_by_id:
new_file = nc_any.files.by_id(new_file)
time.sleep(2.0)
versions = nc_any.files.get_versions(new_file)
assert versions
Expand All @@ -1079,17 +1076,14 @@ def test_file_versions(nc_any, update_by_id):


@pytest.mark.asyncio(scope="session")
@pytest.mark.parametrize("update_by_id", (False, True))
async def test_file_versions_async(anc_any, update_by_id):
async def test_file_versions_async(anc_any):
if await anc_any.check_capabilities("files.versioning"):
pytest.skip("Need 'Versions' App to be enabled.")
dest_path = "/test_dir_tmp/file_versions-ä-async.txt"
await anc_any.files.delete(dest_path, not_fail=True)
await anc_any.files.upload(dest_path, content=b"22")
time.sleep(2.0)
new_file = await anc_any.files.upload(dest_path, content=b"333")
if update_by_id:
new_file = await anc_any.files.by_id(new_file)
time.sleep(2.0)
versions = await anc_any.files.get_versions(new_file)
assert versions
Expand Down

0 comments on commit 4ba0564

Please sign in to comment.