Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import cleanups #1393

Merged
merged 1 commit into from
Sep 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions aries_cloudagent/askar/tests/test_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@

from asynctest import TestCase as AsyncTestCase, mock

from aries_cloudagent.askar.profile import AskarProfile
from aries_cloudagent.config.injection_context import InjectionContext
from ...askar.profile import AskarProfile
from ...config.injection_context import InjectionContext

from .. import profile as test_module
from ...core.profile import Profile, ProfileSession
from ...core.in_memory import InMemoryProfile


class TestProfile(AsyncTestCase):
Expand Down
3 changes: 2 additions & 1 deletion aries_cloudagent/askar/tests/test_store.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from aries_cloudagent.core.error import ProfileError
from asynctest import TestCase as AsyncTestCase

from ...core.error import ProfileError

from ..store import AskarStoreConfig


Expand Down
9 changes: 6 additions & 3 deletions aries_cloudagent/config/argparse.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
"""Command line option parsing."""

import abc
import json

from functools import reduce
from itertools import chain
from os import environ
from typing import Type

import deepmerge
import yaml
import json

from configargparse import ArgumentParser, Namespace, YAMLConfigFileParser
from typing import Type

from ..utils.tracing import trace_event

from .error import ArgsParseError
from .util import BoundedInt, ByteSize
from ..utils.tracing import trace_event

CAT_PROVISION = "general"
CAT_START = "start"
Expand Down
6 changes: 4 additions & 2 deletions aries_cloudagent/multitenant/admin/routes.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
"""Multitenant admin routes."""

from aries_cloudagent.multitenant.base import BaseMultitenantManager
from marshmallow import fields, validate, validates_schema, ValidationError
from aiohttp import web
from aiohttp_apispec import (
docs,
Expand All @@ -10,16 +8,20 @@
response_schema,
querystring_schema,
)
from marshmallow import fields, validate, validates_schema, ValidationError

from ...admin.request_context import AdminRequestContext
from ...messaging.valid import JSONWebToken, UUIDFour
from ...messaging.models.base import BaseModelError
from ...messaging.models.openapi import OpenAPISchema
from ...multitenant.base import BaseMultitenantManager
from ...storage.error import StorageError, StorageNotFoundError
from ...wallet.models.wallet_record import WalletRecord, WalletRecordSchema
from ...wallet.error import WalletSettingsError

from ...core.error import BaseError
from ...core.profile import ProfileManagerProvider

from ..error import WalletKeyMissingError


Expand Down
2 changes: 1 addition & 1 deletion aries_cloudagent/protocols/connections/v1_0/manager.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Classes to manage connections."""

from aries_cloudagent.multitenant.base import BaseMultitenantManager
import logging

from typing import Coroutine, Sequence, Tuple
Expand All @@ -14,6 +13,7 @@
from ....core.error import BaseError
from ....core.profile import ProfileSession
from ....messaging.responder import BaseResponder
from ....multitenant.base import BaseMultitenantManager
from ....storage.error import StorageError, StorageNotFoundError
from ....transport.inbound.receipt import MessageReceipt
from ....wallet.base import BaseWallet
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from aries_cloudagent.multitenant.base import BaseMultitenantManager
from unittest.mock import call

from asynctest import TestCase as AsyncTestCase, mock as async_mock
Expand All @@ -15,6 +14,7 @@
from .....core.in_memory import InMemoryProfile
from .....did.did_key import DIDKey
from .....messaging.responder import BaseResponder, MockResponder
from .....multitenant.base import BaseMultitenantManager
from .....multitenant.manager import MultitenantManager
from .....protocols.routing.v1_0.manager import RoutingManager
from .....resolver.did_resolver import DIDResolver
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"""Handler for mediate-grant message."""

from aries_cloudagent.multitenant.base import BaseMultitenantManager
from .....messaging.base_handler import BaseHandler, HandlerException
from .....messaging.request_context import RequestContext
from .....messaging.responder import BaseResponder
from .....multitenant.base import BaseMultitenantManager
from .....storage.error import StorageNotFoundError

from ..manager import MediationManager
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
"""Test mediate grant message handler."""
from aries_cloudagent.multitenant.base import BaseMultitenantManager

import pytest
from asynctest import TestCase as AsyncTestCase
from asynctest import mock as async_mock

from .. import mediation_grant_handler as test_module

from ......connections.models.conn_record import ConnRecord
from ......messaging.base_handler import HandlerException
from ......messaging.request_context import RequestContext
from ......messaging.responder import MockResponder
from ......multitenant.base import BaseMultitenantManager

from ...messages.mediate_grant import MediationGrant
from ...models.mediation_record import MediationRecord
from ...manager import MediationManager

from ..mediation_grant_handler import MediationGrantHandler
from .. import mediation_grant_handler as test_module

TEST_CONN_ID = "conn-id"
TEST_VERKEY = "3Dn1SJNPaCXcvvJvSbsFWP2xaCjMom3can8CQNhWrTRx"
Expand Down
2 changes: 1 addition & 1 deletion aries_cloudagent/protocols/didexchange/v1_0/manager.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Classes to manage connection establishment under RFC 23 (DID exchange)."""

from aries_cloudagent.multitenant.base import BaseMultitenantManager
import json
import logging

Expand All @@ -12,6 +11,7 @@
from ....core.profile import ProfileSession
from ....messaging.decorators.attach_decorator import AttachDecorator
from ....messaging.responder import BaseResponder
from ....multitenant.base import BaseMultitenantManager
from ....storage.error import StorageNotFoundError
from ....transport.inbound.receipt import MessageReceipt
from ....wallet.base import BaseWallet
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from aries_cloudagent.multitenant.base import BaseMultitenantManager
import json

from asynctest import mock as async_mock, TestCase as AsyncTestCase
Expand All @@ -17,6 +16,7 @@
from .....ledger.base import BaseLedger
from .....messaging.responder import BaseResponder, MockResponder
from .....messaging.decorators.attach_decorator import AttachDecorator
from .....multitenant.base import BaseMultitenantManager
from .....multitenant.manager import MultitenantManager
from .....storage.error import StorageNotFoundError
from .....transport.inbound.receipt import MessageReceipt
Expand Down
2 changes: 1 addition & 1 deletion aries_cloudagent/protocols/out_of_band/v1_0/manager.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Classes to manage connections."""

from aries_cloudagent.multitenant.base import BaseMultitenantManager
import asyncio
import json
import logging
Expand All @@ -17,6 +16,7 @@
from ....indy.models.xform import indy_proof_req_preview2indy_requested_creds
from ....messaging.decorators.attach_decorator import AttachDecorator
from ....messaging.responder import BaseResponder
from ....multitenant.base import BaseMultitenantManager
from ....storage.error import StorageNotFoundError
from ....transport.inbound.receipt import MessageReceipt
from ....wallet.base import BaseWallet
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""Test OOB Manager."""
from aries_cloudagent.multitenant.base import BaseMultitenantManager

import asyncio
import json

Expand All @@ -22,6 +22,7 @@
from .....messaging.decorators.attach_decorator import AttachDecorator
from .....messaging.responder import BaseResponder, MockResponder
from .....messaging.util import str_to_epoch
from .....multitenant.base import BaseMultitenantManager
from .....multitenant.manager import MultitenantManager
from .....protocols.coordinate_mediation.v1_0.models.mediation_record import (
MediationRecord,
Expand Down
5 changes: 2 additions & 3 deletions aries_cloudagent/revocation/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
request_schema,
response_schema,
)
from aries_cloudagent.protocols.endorse_transaction.v1_0.manager import (
TransactionManager,
)
from marshmallow import fields, validate, validates_schema
from marshmallow.exceptions import ValidationError

Expand All @@ -35,12 +32,14 @@
WHOLE_NUM,
UUIDFour,
)
from ..protocols.endorse_transaction.v1_0.manager import TransactionManager
from ..protocols.endorse_transaction.v1_0.models.transaction_record import (
TransactionRecordSchema,
)
from ..storage.base import BaseStorage
from ..storage.error import StorageError, StorageNotFoundError
from ..tails.base import BaseTailsServer

from .error import RevocationError, RevocationNotSupportedError
from .indy import IndyRevocation
from .manager import RevocationManager, RevocationManagerError
Expand Down
2 changes: 1 addition & 1 deletion aries_cloudagent/transport/inbound/session.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
"""Inbound connection handling classes."""

from aries_cloudagent.multitenant.base import BaseMultitenantManager
import asyncio
import logging
from typing import Callable, Sequence, Union

from ...admin.server import AdminResponder
from ...core.profile import Profile
from ...messaging.responder import BaseResponder
from ...multitenant.base import BaseMultitenantManager

from ..error import WireFormatError
from ..outbound.message import OutboundMessage
Expand Down
2 changes: 1 addition & 1 deletion aries_cloudagent/transport/inbound/tests/test_session.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from aries_cloudagent.multitenant.base import BaseMultitenantManager
import asyncio
import pytest

Expand All @@ -7,6 +6,7 @@
from ....admin.server import AdminResponder
from ....core.in_memory import InMemoryProfile
from ....messaging.responder import BaseResponder
from ....multitenant.base import BaseMultitenantManager
from ....multitenant.manager import MultitenantManager

from ...error import WireFormatError
Expand Down
7 changes: 4 additions & 3 deletions aries_cloudagent/wallet/routes.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Wallet admin routes."""

from aries_cloudagent.multitenant.base import BaseMultitenantManager
from aiohttp import web
from aiohttp_apispec import (
docs,
Expand All @@ -24,12 +23,14 @@
ENDPOINT_TYPE,
INDY_RAW_PUBLIC_KEY,
)
from .key_type import KeyType
from .did_method import DIDMethod
from ..multitenant.base import BaseMultitenantManager

from .base import BaseWallet
from .did_info import DIDInfo
from .did_posture import DIDPosture
from .did_method import DIDMethod
from .error import WalletError, WalletNotFoundError
from .key_type import KeyType


class WalletModuleResponseSchema(OpenAPISchema):
Expand Down
3 changes: 2 additions & 1 deletion aries_cloudagent/wallet/tests/test_routes.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
from aries_cloudagent.multitenant.base import BaseMultitenantManager
from asynctest import mock as async_mock, TestCase as AsyncTestCase
from aiohttp.web import HTTPForbidden

from ...admin.request_context import AdminRequestContext
from ...ledger.base import BaseLedger
from ...multitenant.base import BaseMultitenantManager
from ...multitenant.manager import MultitenantManager
from ...wallet.key_type import KeyType
from ...wallet.did_method import DIDMethod

from .. import routes as test_module
from ..base import BaseWallet
from ..did_info import DIDInfo
Expand Down