kanidm/pykanidm/tests/test_radius_token.py
James Hodgkinson c8bd1739f9
PyKanidm updates and testing (#2301)
* otel can eprintln kthx

* started python integration tests, features

* more tests more things

* adding heaps more things

* updating docs

* fixing python test

* fixing errors, updating integration test

* Add models for OAuth2, Person, ServiceAccount and add missing endpoints

* Alias Group to GroupInfo to keep it retrocompatible

* Fixed issues from review

* adding oauth2rs_get_basic_secret

* adding oauth2rs_get_basic_secret

* Fixed mypy issues

* adding more error logs

* updating test scripts and configs

* fixing tests and validating things

* more errors

---------

Co-authored-by: Dogeek <simon.bordeyne@gmail.com>
2024-01-31 03:27:43 +00:00

32 lines
788 B
Python

""" testing get_radius_token """
import json
import logging
import pytest
# pylint: disable=unused-import
from testutils import client, client_configfile
from kanidm import KanidmClient
logging.basicConfig(level=logging.DEBUG)
RADIUS_TEST_USER = "test"
@pytest.mark.network
@pytest.mark.asyncio
async def test_radius_call(client_configfile: KanidmClient) -> None:
"""tests the radius call step"""
print("Doing auth_init using token")
if client_configfile.config.auth_token is None:
pytest.skip(
"You can't test auth if you don't have an auth_token in ~/.config/kanidm"
)
result = await client_configfile.get_radius_token(RADIUS_TEST_USER)
print(f"{result=}")
print(json.dumps(result.model_dump_json(), indent=4, default=str))