Skip to content

Commit 2d19d1a

Browse files
author
m.shvets
committed
Refactor: update API endpoint interactions for principal management to improve parameter handling and request structure
- Modified the API endpoints for adding and renaming principals to align with new request models. - Adjusted assertions in tests to reflect changes in the expected arguments for kadmin methods. - Enhanced clarity by consolidating parameters in API requests.
1 parent caa0d02 commit 2d19d1a

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

tests/test_api/test_main/test_kadmin.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ async def test_bind_create_user(
355355

356356
assert await proc.wait() == 0
357357
kadmin_args = kadmin.add_principal.call_args.args # type: ignore
358-
assert kadmin_args == (san, pw, 0.1)
358+
assert kadmin_args == (san, pw)
359359

360360

361361
@pytest.mark.asyncio
@@ -395,15 +395,15 @@ async def test_add_princ(
395395
:param LDAPSession ldap_session: ldap
396396
"""
397397
response = await http_client.post(
398-
"/kerberos/principal/add",
398+
"/kerberos/principal",
399399
json={
400-
"primary": "host",
401-
"instance": "12345",
400+
"principal_name": "host/12345",
401+
"password": None,
402402
},
403403
)
404404
kadmin_args = kadmin.add_principal.call_args.args # type: ignore
405405
assert response.status_code == status.HTTP_200_OK
406-
assert kadmin_args == ("host/12345", None)
406+
assert kadmin_args == ("host/12345", None, None)
407407

408408

409409
@pytest.mark.asyncio
@@ -417,16 +417,16 @@ async def test_rename_princ(
417417
:param AsyncClient http_client: http cl
418418
:param LDAPSession ldap_session: ldap
419419
"""
420-
response = await http_client.patch(
421-
"/kerberos/principal/rename",
420+
response = await http_client.put(
421+
"/kerberos/principal",
422422
json={
423423
"principal_name": "name",
424-
"principal_new_name": "nname",
424+
"new_principal_name": "nname",
425425
},
426426
)
427427
kadmin_args = kadmin.rename_princ.call_args.args # type: ignore
428428
assert response.status_code == status.HTTP_200_OK
429-
assert kadmin_args == ("name", "nname")
429+
assert kadmin_args == ("name", "nname", None, None)
430430

431431

432432
@pytest.mark.asyncio

0 commit comments

Comments
 (0)