Skip to content

Commit

Permalink
fix: reorder imports for ruff 0.6.x (#392)
Browse files Browse the repository at this point in the history
  • Loading branch information
ca-scribner authored Aug 21, 2024
1 parent b48489a commit 521e00e
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
WaitingStatus,
)
from ops.pebble import PathError

from traefik import (
CA,
SERVER_CERT_PATH,
Expand Down
1 change: 1 addition & 0 deletions src/traefik.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from charms.oathkeeper.v0.forward_auth import ForwardAuthConfig
from ops import Container
from ops.pebble import LayerDict, PathError

from utils import is_hostname

logger = logging.getLogger(__name__)
Expand Down
3 changes: 2 additions & 1 deletion tests/interface/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
from unittest.mock import patch

import pytest
from charm import TraefikIngressCharm
from interface_tester import InterfaceTester
from ops.pebble import Layer
from scenario.state import Container, ExecOutput, State

from charm import TraefikIngressCharm


# Interface tests are centrally hosted at https://github.com/canonical/charm-relation-interfaces.
# this fixture is used by the test runner of charm-relation-interfaces to test traefik's compliance
Expand Down
3 changes: 2 additions & 1 deletion tests/scenario/conftest.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
from unittest.mock import PropertyMock, patch

import pytest
from charm import TraefikIngressCharm
from ops import pebble
from scenario import Container, Context, ExecOutput, Model, Mount

from charm import TraefikIngressCharm

MOCK_EXTERNAL_HOSTNAME = "testhostname"


Expand Down
3 changes: 2 additions & 1 deletion tests/scenario/test_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@

from unittest.mock import PropertyMock, patch

from charm import TraefikIngressCharm
from scenario import Container, Context, State

from charm import TraefikIngressCharm
from traefik import Traefik


Expand Down
1 change: 1 addition & 0 deletions tests/scenario/test_tracing_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from charms.tempo_k8s.v1.charm_tracing import charm_tracing_disabled
from charms.tempo_k8s.v2.tracing import ProtocolType, Receiver, TracingProviderAppData
from scenario import Relation, State

from traefik import CA_CERT_PATH, DYNAMIC_TRACING_PATH


Expand Down
3 changes: 2 additions & 1 deletion tests/scenario/test_workload_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
import unittest
from unittest.mock import PropertyMock, patch

from charm import TraefikIngressCharm
from ops.model import ActiveStatus
from scenario import Container, Context, State

from charm import TraefikIngressCharm


@patch("charm.KubernetesServicePatch")
@patch("lightkube.core.client.GenericSyncClient")
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/test_charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@

import ops.testing
import yaml
from charm import TraefikIngressCharm
from charms.traefik_k8s.v2.ingress import IngressRequirerAppData, IngressRequirerUnitData
from ops.charm import ActionEvent
from ops.model import ActiveStatus, Application, BlockedStatus, Relation, WaitingStatus
from ops.pebble import PathError
from ops.testing import Harness

from charm import TraefikIngressCharm
from traefik import STATIC_CONFIG_PATH

ops.testing.SIMULATE_CAN_CONNECT = True
Expand Down
1 change: 1 addition & 0 deletions tests/unit/test_deep_merge.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pytest

from traefik import StaticConfigMergeConflictError, static_config_deep_merge


Expand Down
3 changes: 2 additions & 1 deletion tests/unit/test_route.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
import ops
import pytest
import yaml
from charm import TraefikIngressCharm
from ops.testing import Harness

from charm import TraefikIngressCharm
from traefik import StaticConfigMergeConflictError, Traefik

MODEL_NAME = "test-model"
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/test_tls_certificates.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
from unittest.mock import patch

import ops.testing
from charm import TraefikIngressCharm
from ops.testing import Harness

from charm import TraefikIngressCharm

ops.testing.SIMULATE_CAN_CONNECT = True


Expand Down

0 comments on commit 521e00e

Please sign in to comment.