Skip to content

Commit

Permalink
draft
Browse files Browse the repository at this point in the history
  • Loading branch information
git-hyagi committed Jan 15, 2025
1 parent 50ad87f commit 727cfbc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
5 changes: 2 additions & 3 deletions pulp_file/pytest_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def file_repo_with_auto_publish(file_bindings, gen_object_with_cleanup):


@pytest.fixture(scope="class")
def file_distribution_factory(file_bindings, gen_object_with_cleanup):
def file_distribution_factory(bindings_cfg, file_bindings, gen_object_with_cleanup):
def _file_distribution_factory(pulp_domain=None, **body):
data = {"base_path": str(uuid.uuid4()), "name": str(uuid.uuid4())}
data.update(body)
Expand All @@ -73,8 +73,7 @@ def _file_distribution_factory(pulp_domain=None, **body):

# if the base_url starts with / it means content_origin is not defined
if file_distribution.base_url.startswith("/"):
file_distribution.base_url.replace("/", "https://pulp/", 1)
#file_distribution.base_url="https://pulp/"
file_distribution.base_url.replace("/", bindings_cfg.host, 1)
return file_distribution


Expand Down
1 change: 0 additions & 1 deletion pulpcore/app/serializers/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,6 @@ class BaseURLField(serializers.CharField):
"""

def to_representation(self, value):
#origin = 'https://pulp/'
origin = '/'
if settings.CONTENT_ORIGIN:
origin = settings.CONTENT_ORIGIN.strip("/")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ def test_remote_artifact_url_update(

@pytest.mark.parallel
def test_remote_content_changed_with_on_demand(
bindings_cfg,
write_3_iso_file_fixture_data_factory,
file_repo_with_auto_publish,
file_remote_ssl_factory,
Expand Down Expand Up @@ -135,7 +136,10 @@ def test_remote_content_changed_with_on_demand(
expected_file_list = list(get_files_in_manifest(remote.url))
write_3_iso_file_fixture_data_factory("basic", overwrite=True)

get_url = urljoin(distribution.base_url, expected_file_list[0][0])
if distribution.base_url.startswith("http"):
get_url = urljoin(distribution.base_url, expected_file_list[0][0])
else:
get_url = urljoin(bindings_cfg.host+distribution.base_url, expected_file_list[0][0])

# WHEN (first request)
result = subprocess.run(["curl", "-v", get_url], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
Expand Down

0 comments on commit 727cfbc

Please sign in to comment.