test(tokens-repo): break out rest_get_token_info()

This commit is contained in:
Houkime 2022-12-28 15:16:58 +00:00 committed by Inex Code
parent f542c1e6c7
commit 7e0e6015cf

View file

@ -41,10 +41,14 @@ def assert_original(filename):
assert read_json(filename) == TOKENS_FILE_CONTETS assert read_json(filename) == TOKENS_FILE_CONTETS
def test_get_tokens_info(authorized_client, tokens_file): def rest_get_tokens_info(client):
response = authorized_client.get("/auth/tokens") response = client.get("/auth/tokens")
assert response.status_code == 200 assert response.status_code == 200
assert response.json() == [ return response.json()
def test_get_tokens_info(authorized_client, tokens_file):
assert rest_get_tokens_info(authorized_client) == [
{"name": "test_token", "date": "2022-01-14T08:31:10.789314", "is_caller": True}, {"name": "test_token", "date": "2022-01-14T08:31:10.789314", "is_caller": True},
{ {
"name": "test_token2", "name": "test_token2",