mirror of
https://github.com/checktheroads/hyperglass
synced 2024-05-11 05:55:08 +00:00
Restructure utilities, add tests
This commit is contained in:
4
hyperglass/external/_base.py
vendored
4
hyperglass/external/_base.py
vendored
@@ -13,7 +13,7 @@ import httpx
|
||||
|
||||
# Project
|
||||
from hyperglass.log import log
|
||||
from hyperglass.util import make_repr, parse_exception
|
||||
from hyperglass.util import parse_exception, repr_from_attrs
|
||||
from hyperglass.constants import __version__
|
||||
from hyperglass.models.fields import JsonValue, HttpMethod, Primitives
|
||||
from hyperglass.exceptions.private import ExternalError
|
||||
@@ -124,7 +124,7 @@ class BaseExternal:
|
||||
|
||||
def __repr__(self: "BaseExternal") -> str:
|
||||
"""Return user friendly representation of instance."""
|
||||
return make_repr(self)
|
||||
return repr_from_attrs(self, ("name", "base_url", "config", "parse"))
|
||||
|
||||
def _exception(
|
||||
self: "BaseExternal",
|
||||
|
2
hyperglass/external/msteams.py
vendored
2
hyperglass/external/msteams.py
vendored
@@ -1,5 +1,6 @@
|
||||
"""Session handler for Microsoft Teams API."""
|
||||
|
||||
# Standard Library
|
||||
import typing as t
|
||||
|
||||
# Project
|
||||
@@ -8,6 +9,7 @@ from hyperglass.external._base import BaseExternal
|
||||
from hyperglass.models.webhook import Webhook
|
||||
|
||||
if t.TYPE_CHECKING:
|
||||
# Project
|
||||
from hyperglass.models.config.logging import Http
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user