Skip to content

Commit

Permalink
Add a test for issue #4681
Browse files Browse the repository at this point in the history
[noissue]
  • Loading branch information
dralley committed Nov 14, 2023
1 parent c0e9ab1 commit e7c2bd0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pulpcore/tests/functional/api/pulp_file/test_sync.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
"""Tests that sync file plugin repositories."""

import os
import uuid

import pytest
Expand All @@ -22,17 +24,20 @@ def test_sync_file_protocol_handler(
):
"""Test syncing from a file repository with the file:// protocol handler"""
wget_recursive_download_on_host(urljoin(fixtures_cfg.remote_fixtures_origin, "file/"), "/tmp")

remote_kwargs = {
"url": "file:///tmp/file/PULP_MANIFEST",
"policy": "immediate",
"name": str(uuid.uuid4()),
}
remote = gen_object_with_cleanup(file_remote_api_client, remote_kwargs)
files = set(os.listdir("/tmp/file/"))

body = RepositorySyncURL(remote=remote.pulp_href)
monitor_task(file_repository_api_client.sync(file_repo.pulp_href, body).task)

# test that all the files are still present
assert set(os.listdir("/tmp/file/")) == files

file_repo = file_repository_api_client.read(file_repo.pulp_href)
assert file_repo.latest_version_href.endswith("/versions/1/")

Expand Down

0 comments on commit e7c2bd0

Please sign in to comment.