|
1 | 1 | # coding=utf-8 |
2 | 2 | """Tests that verify download of content served by Pulp.""" |
| 3 | +import pytest |
3 | 4 | import hashlib |
4 | 5 | from random import choice |
5 | 6 | from urllib.parse import urljoin |
@@ -149,3 +150,32 @@ def test_full_pulp_to_pulp_sync(self): |
149 | 150 |
|
150 | 151 | repo3 = self._create_repo_and_sync_with_remote(remote) |
151 | 152 | self.assertEqual(get_content_summary(repo3.to_dict()), PYTHON_MD_FIXTURE_SUMMARY) |
| 153 | + |
| 154 | + |
| 155 | +@pytest.mark.parallel |
| 156 | +def test_pulp2pulp_sync_with_oddities( |
| 157 | + python_repo_with_sync, |
| 158 | + python_remote_factory, |
| 159 | + python_publication_factory, |
| 160 | + python_distribution_factory, |
| 161 | + python_content_summary, |
| 162 | +): |
| 163 | + """Test that Pulp can handle syncing packages with wierd names.""" |
| 164 | + remote = python_remote_factory(includes=["oslo.utils"], url="https://pypi.org") |
| 165 | + repo = python_repo_with_sync(remote) |
| 166 | + distro = python_distribution_factory(repository=repo.pulp_href) |
| 167 | + summary = python_content_summary(repository_version=repo.latest_version_href) |
| 168 | + # Test pulp 2 pulp full sync w/ live pypi apis |
| 169 | + remote2 = python_remote_factory(includes=[], url=distro.base_url) |
| 170 | + repo2 = python_repo_with_sync(remote2) |
| 171 | + summary2 = python_content_summary(repository_version=repo2.latest_version_href) |
| 172 | + assert summary2.present["python.python"]["count"] > 0 |
| 173 | + assert summary.present["python.python"]["count"] == summary2.present["python.python"]["count"] |
| 174 | + # Test w/ publication |
| 175 | + pub = python_publication_factory(repository=repo) |
| 176 | + distro2 = python_distribution_factory(publication=pub.pulp_href) |
| 177 | + remote3 = python_remote_factory(includes=[], url=distro2.base_url) |
| 178 | + repo3 = python_repo_with_sync(remote3) |
| 179 | + summary3 = python_content_summary(repository_version=repo3.latest_version_href) |
| 180 | + assert summary3.present["python.python"]["count"] > 0 |
| 181 | + assert summary.present["python.python"]["count"] == summary3.present["python.python"]["count"] |
0 commit comments