diff --git a/src/charm.py b/src/charm.py index ecfc0db..5db2526 100755 --- a/src/charm.py +++ b/src/charm.py @@ -12,14 +12,14 @@ from charms.data_platform_libs.v0.data_interfaces import DatabaseRequires # type: ignore[import] from charms.sdcore_nrf_k8s.v0.fiveg_nrf import NRFProvides # type: ignore[import] from charms.tls_certificates_interface.v3.tls_certificates import ( # type: ignore[import] - CertificateAvailableEvent, CertificateExpiringEvent, TLSCertificatesRequiresV3, generate_csr, generate_private_key, ) from jinja2 import Environment, FileSystemLoader # type: ignore[import] -from ops.charm import CharmBase, EventBase, RelationJoinedEvent +from ops.charm import CharmBase, RelationJoinedEvent +from ops.framework import EventBase from ops.main import main from ops.model import ActiveStatus, BlockedStatus, ModelError, WaitingStatus from ops.pebble import Layer @@ -119,7 +119,7 @@ def __init__(self, *args): self._certificates.on.certificate_expiring, self._on_certificate_expiring ) - def _configure_nrf(self, event: EventBase) -> None: + def _configure_nrf(self, event: EventBase) -> None: # noqa C901 """Adds pebble layer and manages Juju unit status. Args: diff --git a/tests/unit/test_charm.py b/tests/unit/test_charm.py index 89f8783..055bf02 100644 --- a/tests/unit/test_charm.py +++ b/tests/unit/test_charm.py @@ -4,11 +4,11 @@ import unittest from unittest.mock import Mock, patch +from charms.tls_certificates_interface.v3.tls_certificates import ProviderCertificate from ops import testing from ops.model import ActiveStatus, BlockedStatus, WaitingStatus from charm import NRFOperatorCharm -from charms.tls_certificates_interface.v3.tls_certificates import ProviderCertificate # type: ignore[import] DB_APPLICATION_NAME = "mongodb-k8s" BASE_CONFIG_PATH = "/etc/nrf"