Skip to content

Commit

Permalink
Modify DownloadContentTestCase to add lazy synced content
Browse files Browse the repository at this point in the history
Modify `DownloadContentTestCase` to add lazy synced content test case.

https://pulp.plan.io/issues/4496
ref: #4496
  • Loading branch information
koliveir authored and rochacbruno committed Mar 7, 2019
1 parent 36da5bb commit 6f6cf49
Showing 1 changed file with 27 additions and 3 deletions.
30 changes: 27 additions & 3 deletions pulp_file/tests/functional/api/test_download_content.py
Expand Up @@ -6,7 +6,11 @@
from urllib.parse import urljoin

from pulp_smash import api, config, utils
from pulp_smash.pulp3.constants import DISTRIBUTION_PATH, REPO_PATH
from pulp_smash.pulp3.constants import (
DISTRIBUTION_PATH,
LAZY_DOWNLOAD_POLICIES,
REPO_PATH,
)
from pulp_smash.pulp3.utils import (
download_content_unit,
gen_distribution,
Expand All @@ -31,7 +35,27 @@
class DownloadContentTestCase(unittest.TestCase):
"""Verify whether content served by pulp can be downloaded."""

def test_all(self):
def test_immediate(self):
"""Download content from Pulp. Content is synced with immediate.
See :meth:`do_test`.
"""
self.do_test('immediate')

def test_lazy_download_policies(self):
"""Download content from Pulp. Content is synced with lazy policy.
See :meth:`do_test`.
This test targets the following issue:
`Pulp #4496 <https://pulp.plan.io/issues/4496>`_
"""
for policy in LAZY_DOWNLOAD_POLICIES:
with self.subTest(policy):
self.do_test(policy)

def do_test(self, policy):
"""Verify whether content served by pulp can be downloaded.
The process of publishing content is more involved in Pulp 3 than it
Expand Down Expand Up @@ -63,7 +87,7 @@ def test_all(self):
repo = client.post(REPO_PATH, gen_repo())
self.addCleanup(client.delete, repo['_href'])

body = gen_file_remote()
body = gen_file_remote(policy=policy)
remote = client.post(FILE_REMOTE_PATH, body)
self.addCleanup(client.delete, remote['_href'])

Expand Down

0 comments on commit 6f6cf49

Please sign in to comment.