mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
fix(rpc): provides search should return name match
We need to return packages matching on the name as well. (A package always provides itself) Signed-off-by: moson-mo <mo-son@mailbox.org>
This commit is contained in:
parent
2b8dedb3a2
commit
d8e91d058c
2 changed files with 24 additions and 1 deletions
|
@ -920,6 +920,19 @@ def test_rpc_search_provides(
|
|||
assert result.get("Name") == packages[0].Name
|
||||
|
||||
|
||||
def test_rpc_search_provides_self(
|
||||
client: TestClient, packages: list[Package], relations: list[PackageRelation]
|
||||
):
|
||||
params = {"v": 5, "type": "search", "by": "provides", "arg": "big-chungus"}
|
||||
with client as request:
|
||||
response = request.get("/rpc", params=params)
|
||||
data = response.json()
|
||||
# expected to return "big-chungus"
|
||||
assert data.get("resultcount") == 1
|
||||
result = data.get("results")[0]
|
||||
assert result.get("Name") == packages[0].Name
|
||||
|
||||
|
||||
def test_rpc_search_conflicts(
|
||||
client: TestClient, packages: list[Package], relations: list[PackageRelation]
|
||||
):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue