From 0d748d7ab13e53590c1eace07eb4173c247a273d Mon Sep 17 00:00:00 2001 From: Houkime <> Date: Fri, 9 Dec 2022 12:23:36 +0000 Subject: [PATCH] test(tokens-repo): move original token content to json tests --- .../test_json_tokens_repository.py | 26 +++++++++++++++++-- .../test_repository/test_tokens_repository.py | 23 ---------------- 2 files changed, 24 insertions(+), 25 deletions(-) diff --git a/tests/test_graphql/test_repository/test_json_tokens_repository.py b/tests/test_graphql/test_repository/test_json_tokens_repository.py index ac4a3d0..af8c844 100644 --- a/tests/test_graphql/test_repository/test_json_tokens_repository.py +++ b/tests/test_graphql/test_repository/test_json_tokens_repository.py @@ -19,9 +19,8 @@ from selfprivacy_api.repositories.tokens.exceptions import ( from selfprivacy_api.repositories.tokens.json_tokens_repository import ( JsonTokensRepository, ) -from tests.common import read_json -from test_tokens_repository import ORIGINAL_TOKEN_CONTENT +from tests.common import read_json from test_tokens_repository import ( mock_recovery_key_generate, mock_generate_token, @@ -29,6 +28,29 @@ from test_tokens_repository import ( empty_keys, ) +ORIGINAL_TOKEN_CONTENT = [ + { + "token": "KG9ni-B-CMPk327Zv1qC7YBQaUGaBUcgdkvMvQ2atFI", + "name": "primary_token", + "date": "2022-07-15 17:41:31.675698", + }, + { + "token": "3JKgLOtFu6ZHgE4OU-R-VdW47IKpg-YQL0c6n7bol68", + "name": "second_token", + "date": "2022-07-15 17:41:31.675698Z", + }, + { + "token": "LYiwFDekvALKTQSjk7vtMQuNP_6wqKuV-9AyMKytI_8", + "name": "third_token", + "date": "2022-07-15T17:41:31.675698Z", + }, + { + "token": "dD3CFPcEZvapscgzWb7JZTLog7OMkP7NzJeu2fAazXM", + "name": "forth_token", + "date": "2022-07-15T17:41:31.675698", + }, +] + @pytest.fixture def tokens(mocker, datadir): diff --git a/tests/test_graphql/test_repository/test_tokens_repository.py b/tests/test_graphql/test_repository/test_tokens_repository.py index 40d3e7e..0372b92 100644 --- a/tests/test_graphql/test_repository/test_tokens_repository.py +++ b/tests/test_graphql/test_repository/test_tokens_repository.py @@ -24,29 +24,6 @@ from selfprivacy_api.repositories.tokens.redis_tokens_repository import ( from tests.common import read_json -ORIGINAL_TOKEN_CONTENT = [ - { - "token": "KG9ni-B-CMPk327Zv1qC7YBQaUGaBUcgdkvMvQ2atFI", - "name": "primary_token", - "date": "2022-07-15 17:41:31.675698", - }, - { - "token": "3JKgLOtFu6ZHgE4OU-R-VdW47IKpg-YQL0c6n7bol68", - "name": "second_token", - "date": "2022-07-15 17:41:31.675698Z", - }, - { - "token": "LYiwFDekvALKTQSjk7vtMQuNP_6wqKuV-9AyMKytI_8", - "name": "third_token", - "date": "2022-07-15T17:41:31.675698Z", - }, - { - "token": "dD3CFPcEZvapscgzWb7JZTLog7OMkP7NzJeu2fAazXM", - "name": "forth_token", - "date": "2022-07-15T17:41:31.675698", - }, -] - ORIGINAL_DEVICE_NAMES = [ "primary_token", "second_token",