|
1 | 1 | import pytest |
2 | 2 | import subprocess |
3 | | -from urllib.parse import urljoin |
4 | 3 |
|
5 | | -from pulp_python.tests.functional.constants import ( |
6 | | - PYTHON_EGG_FILENAME, |
7 | | - PYTHON_FIXTURES_URL, |
8 | | -) |
| 4 | +from pulp_python.tests.functional.constants import PYTHON_EGG_FILENAME |
9 | 5 |
|
10 | 6 |
|
11 | 7 | @pytest.fixture |
@@ -80,47 +76,3 @@ def test_metadata_repair_command( |
80 | 76 | assert content.packagetype == "sdist" |
81 | 77 | assert content.requires_python == "" # technically null |
82 | 78 | assert content.author == "Austin Macdonald" |
83 | | - |
84 | | - |
85 | | -def test_metadata_repair_endpoint( |
86 | | - create_content_direct, |
87 | | - download_python_file, |
88 | | - monitor_task, |
89 | | - move_to_repository, |
90 | | - python_bindings, |
91 | | - python_repo, |
92 | | -): |
93 | | - """ |
94 | | - Test repairing of package metadata via `Repository.repair_metadata` endpoint. |
95 | | - """ |
96 | | - python_egg_filename = "scipy-1.1.0.tar.gz" |
97 | | - python_egg_url = urljoin( |
98 | | - urljoin(PYTHON_FIXTURES_URL, "packages/"), python_egg_filename |
99 | | - ) |
100 | | - python_file = download_python_file(python_egg_filename, python_egg_url) |
101 | | - |
102 | | - data = { |
103 | | - "name": "scipy", |
104 | | - # Wrong metadata |
105 | | - "author": "ME", |
106 | | - "packagetype": "bdist", |
107 | | - "requires_python": ">=3.8", |
108 | | - "version": "0.2", |
109 | | - } |
110 | | - content = create_content_direct(python_file, python_egg_filename, data) |
111 | | - for field, wrong_value in data.items(): |
112 | | - if field == "python_version": |
113 | | - continue |
114 | | - assert getattr(content, field) == wrong_value |
115 | | - move_to_repository(python_repo.pulp_href, [content.pulp_href]) |
116 | | - |
117 | | - response = python_bindings.RepositoriesPythonApi.repair_metadata( |
118 | | - python_repo.pulp_href |
119 | | - ) |
120 | | - _ = monitor_task(response.task) |
121 | | - |
122 | | - content = python_bindings.ContentPackagesApi.read(content.pulp_href) |
123 | | - assert content.version == "1.1.0" |
124 | | - assert content.packagetype == "sdist" |
125 | | - assert content.requires_python == ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*" |
126 | | - assert content.author == "" |
0 commit comments