From f3afd08d43f8d17d0bbb96431c27b195ca46e2ad Mon Sep 17 00:00:00 2001 From: Sasha Romijn Date: Thu, 23 Feb 2023 15:11:38 +0100 Subject: [PATCH] Clean up unused imports / extra f-strings --- irrd/updates/handler.py | 4 ++-- irrd/updates/tests/test_handler.py | 5 ++--- irrd/updates/tests/test_parser.py | 3 +-- irrd/updates/tests/test_validators.py | 1 - 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/irrd/updates/handler.py b/irrd/updates/handler.py index cdf56ffc8..0e2c0d8a2 100644 --- a/irrd/updates/handler.py +++ b/irrd/updates/handler.py @@ -1,7 +1,7 @@ import logging import textwrap from collections import defaultdict -from typing import List, Optional, Dict, Any, Union +from typing import List, Optional, Dict, Union from ordered_set import OrderedSet @@ -11,7 +11,7 @@ from irrd.storage.queries import RPSLDatabaseQuery from irrd.utils import email from .parser import parse_change_requests, ChangeRequest, SuspensionRequest -from .parser_state import SuspensionRequestType, UpdateRequestStatus, UpdateRequestType +from .parser_state import UpdateRequestStatus, UpdateRequestType from .validators import ReferenceValidator, AuthValidator from ..utils.validators import RPSLChangeSubmission, RPSLSuspensionSubmission diff --git a/irrd/updates/tests/test_handler.py b/irrd/updates/tests/test_handler.py index da3c85d6e..85bb6e2af 100644 --- a/irrd/updates/tests/test_handler.py +++ b/irrd/updates/tests/test_handler.py @@ -8,7 +8,6 @@ from irrd.storage.models import JournalEntryOrigin from irrd.utils.rpsl_samples import SAMPLE_MNTNER from irrd.utils.test_utils import flatten_mock_calls -from irrd.updates.parser import parse_change_requests from ..handler import ChangeSubmissionHandler from ...utils.validators import RPSLChangeSubmission, RPSLSuspensionSubmission from ..parser_state import SuspensionRequestType @@ -200,7 +199,7 @@ def test_parse_valid_new_person_existing_mntner_pgp_key(self, prepare_mocks): assert mock_dh.mock_calls[2][0] == 'commit' assert mock_dh.mock_calls[3][0] == 'close' - assert handler.submitter_report_human() == textwrap.dedent(f""" + assert handler.submitter_report_human() == textwrap.dedent(""" > Message-ID: test > From: example@example.com @@ -229,7 +228,7 @@ def test_parse_valid_new_person_existing_mntner_pgp_key(self, prepare_mocks): ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ """) - expected_notification = textwrap.dedent(f""" + expected_notification = textwrap.dedent(""" This is to notify you of changes in the TEST database or object authorisation failures. diff --git a/irrd/updates/tests/test_parser.py b/irrd/updates/tests/test_parser.py index 2723f241d..75d67b045 100644 --- a/irrd/updates/tests/test_parser.py +++ b/irrd/updates/tests/test_parser.py @@ -1,5 +1,4 @@ import itertools -import passlib.hash import textwrap from unittest.mock import Mock @@ -16,7 +15,7 @@ SAMPLE_ROUTE, SAMPLE_ROUTE6 from irrd.utils.test_utils import flatten_mock_calls from irrd.utils.text import splitline_unicodesafe -from irrd.updates.suspension import reactivate_for_mntner, suspend_for_mntner +from irrd.updates.suspension import suspend_for_mntner from ..parser import parse_change_requests from ..parser_state import SuspensionRequestType, UpdateRequestType, UpdateRequestStatus from ..validators import ReferenceValidator, AuthValidator, RulesValidator, ValidatorResult diff --git a/irrd/updates/tests/test_validators.py b/irrd/updates/tests/test_validators.py index 5d48cfc12..9d5d7e9c6 100644 --- a/irrd/updates/tests/test_validators.py +++ b/irrd/updates/tests/test_validators.py @@ -2,7 +2,6 @@ from unittest.mock import Mock import pytest -from pytest import raises from irrd.conf import AUTH_SET_CREATION_COMMON_KEY from irrd.rpsl.rpsl_objects import rpsl_object_from_text