Skip to content

Commit 546774a

Browse files
jobselkomdellweg
authored andcommitted
Merge pull request pulp#877 from jobselko/fix_nightly
Fix tests to account for new fixtures (cherry picked from commit ee1aed2) (cherry picked from commit 7433f61)
1 parent 543e9db commit 546774a

File tree

4 files changed

+24
-13
lines changed

4 files changed

+24
-13
lines changed

CHANGES/876.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixed tests to account for new fixtures.

pulp_python/tests/functional/api/test_download_content.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
PYTHON_MD_PROJECT_SPECIFIER,
1515
PYTHON_MD_FIXTURE_SUMMARY,
1616
PYTHON_LG_FIXTURE_SUMMARY,
17+
PYTHON_LG_FIXTURE_PRERELEASES_SUMMARY,
1718
PYTHON_LG_PROJECT_SPECIFIER,
1819
)
1920
from pulp_python.tests.functional.utils import (
@@ -126,7 +127,9 @@ def test_full_fixtures_to_pulp_sync(self):
126127
"""
127128
remote = self._create_remote(includes=[], prereleases=True)
128129
repo = self._create_repo_and_sync_with_remote(remote)
129-
self.assertEqual(get_content_summary(repo.to_dict()), PYTHON_LG_FIXTURE_SUMMARY)
130+
self.assertEqual(
131+
get_content_summary(repo.to_dict()), PYTHON_LG_FIXTURE_PRERELEASES_SUMMARY
132+
)
130133

131134
def test_full_pulp_to_pulp_sync(self):
132135
"""

pulp_python/tests/functional/api/test_full_mirror.py

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -108,21 +108,26 @@ def test_pull_through_install(self):
108108
remote = self._create_remote(url=PYPI_URL)
109109
distro = self._create_distribution(remote=remote.pulp_href)
110110

111-
if self.cli_client.run(("pip", "list")).stdout.find("numpy") == -1:
112-
content = self.content_api.list(name="numpy")
113-
self.assertEqual(content.count, 0, msg="numpy content already present in test")
111+
PACKAGE = "sampleproject"
112+
if self.cli_client.run(("pip", "list")).stdout.find(PACKAGE) == -1:
113+
content = self.content_api.list(name=PACKAGE)
114+
self.assertEqual(
115+
content.count, 0, msg=f"{PACKAGE} content already present in test"
116+
)
114117
host = urlsplit(PULP_CONTENT_BASE_URL).hostname
115118
url = urljoin(self.PYPI_HOST, f"{distro.base_path}/simple/")
116119
out = self.cli_client.run(
117-
("pip", "install", "--trusted-host", host, "-i", url, "numpy")
120+
("pip", "install", "--trusted-host", host, "-i", url, PACKAGE)
118121
)
119122
self.addCleanup(delete_orphans)
120-
self.assertTrue(self.cli_client.run(("pip", "list")).stdout.find("numpy") != -1, out)
121-
self.addCleanup(self.cli_client.run, ("pip", "uninstall", "numpy", "-y"))
122-
content = self.content_api.list(name="numpy")
123+
self.assertTrue(
124+
self.cli_client.run(("pip", "list")).stdout.find(PACKAGE) != -1, out
125+
)
126+
self.addCleanup(self.cli_client.run, ("pip", "uninstall", PACKAGE, "-y"))
127+
content = self.content_api.list(name=PACKAGE)
123128
self.assertEqual(content.count, 1)
124129
else:
125-
self.skipTest("Uninstall numpy before running this test")
130+
self.skipTest(f"Uninstall {PACKAGE} before running this test")
126131

127132
def test_pull_through_simple(self):
128133
"""Tests that the simple page is properly modified when requesting a pull-through."""

pulp_python/tests/functional/constants.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,14 +145,16 @@
145145
"celery", # matches 13
146146
"Django", # matches 31
147147
"scipy", # matches 23
148+
"setuptools", # matches 2
148149
"shelf-reader", # matches 2
149150
]
150-
PYTHON_LG_PACKAGE_COUNT = 76
151+
PYTHON_LG_PACKAGE_COUNT = 78
151152
PYTHON_LG_FIXTURE_SUMMARY = {PYTHON_CONTENT_NAME: PYTHON_LG_PACKAGE_COUNT}
153+
PYTHON_LG_FIXTURE_PRERELEASES_SUMMARY = {PYTHON_CONTENT_NAME: 92}
152154
PYTHON_LG_FIXTURE_COUNTS = {
153-
"latest_3": 35,
154-
"sdist": 23,
155-
"bdist_wheel": 53,
155+
"latest_3": 37,
156+
"sdist": 24,
157+
"bdist_wheel": 54,
156158
}
157159

158160
DJANGO_LATEST_3 = 4 # latest version has 2 dists, each other has 1

0 commit comments

Comments
 (0)