fix: do not raise 404 in case of unknown package on patches endpoints

Previous improvements raise 404 error in case if no packages were found
for patches endpoints. However, in case of multirepo setup this feature
doesn't work properly because package can be located in any other
repository different from default
This commit is contained in:
2024-01-08 14:30:57 +02:00
parent f89a5252de
commit 270084bb39
6 changed files with 7 additions and 48 deletions

View File

@ -212,14 +212,6 @@ def test_patches_get(watcher: Watcher, package_ahriman: Package, mocker: MockerF
])
def test_patches_get_failed(watcher: Watcher, package_ahriman: Package) -> None:
"""
must raise UnknownPackageError on patches in case of unknown package
"""
with pytest.raises(UnknownPackageError):
watcher.patches_get(package_ahriman.base, None)
def test_patches_remove(watcher: Watcher, package_ahriman: Package, mocker: MockerFixture) -> None:
"""
must remove patches for the package

View File

@ -70,17 +70,6 @@ async def test_get(client: TestClient, package_ahriman: Package) -> None:
assert patches == patch.view()
async def test_get_not_found(client: TestClient, package_ahriman: Package) -> None:
"""
must return not found for missing package
"""
response_schema = pytest.helpers.schema_response(PatchView.get, code=404)
response = await client.get(f"/api/v1/packages/{package_ahriman.base}/patches/random")
assert response.status == 404
assert not response_schema.validate(await response.json())
async def test_get_patch_not_found(client: TestClient, package_ahriman: Package) -> None:
"""
must return not found for missing patch

View File

@ -46,17 +46,6 @@ async def test_get(client: TestClient, package_ahriman: Package) -> None:
assert patches == [patch.view()]
async def test_get_not_found(client: TestClient, package_ahriman: Package) -> None:
"""
must return not found for missing package
"""
response_schema = pytest.helpers.schema_response(PatchesView.get, code=404)
response = await client.get(f"/api/v1/packages/{package_ahriman.base}/patches")
assert response.status == 404
assert not response_schema.validate(await response.json())
async def test_post(client: TestClient, package_ahriman: Package) -> None:
"""
must create patch