From f1e4655eaafed34fc4c73a883198ed3b2a14f7a5 Mon Sep 17 00:00:00 2001 From: averevki Date: Fri, 26 Jan 2024 12:40:15 +0100 Subject: [PATCH] Apply black changes from new version --- testsuite/certificates.py | 1 + testsuite/config/tools.py | 1 + testsuite/gateway/__init__.py | 1 + testsuite/gateway/envoy/__init__.py | 1 + testsuite/gateway/envoy/config.py | 1 + testsuite/gateway/envoy/route.py | 1 + testsuite/gateway/envoy/tls.py | 1 + testsuite/gateway/envoy/wristband.py | 1 + testsuite/gateway/gateway_api/gateway.py | 1 + testsuite/gateway/gateway_api/hostname.py | 1 + testsuite/httpx/__init__.py | 1 + testsuite/httpx/auth.py | 1 + testsuite/hyperfoil/__init__.py | 1 + testsuite/lifecycle.py | 1 + testsuite/mockserver.py | 1 + testsuite/oidc/__init__.py | 1 + testsuite/oidc/auth0.py | 1 + testsuite/oidc/rhsso/__init__.py | 1 + testsuite/oidc/rhsso/objects.py | 1 + testsuite/openshift/__init__.py | 1 + testsuite/openshift/api_key.py | 1 + testsuite/openshift/authorino.py | 1 + testsuite/openshift/config_map.py | 1 + testsuite/openshift/deployment.py | 1 + testsuite/openshift/httpbin.py | 1 + testsuite/openshift/ingress.py | 1 + testsuite/openshift/metrics/__init__.py | 1 + testsuite/openshift/metrics/prometheus.py | 1 + testsuite/openshift/metrics/service_monitor.py | 1 + testsuite/openshift/route.py | 1 + testsuite/openshift/secret.py | 1 + testsuite/openshift/service.py | 1 + testsuite/policy/authorization/__init__.py | 1 + testsuite/policy/authorization/auth_config.py | 1 + testsuite/policy/authorization/auth_policy.py | 1 + testsuite/policy/authorization/sections.py | 1 + testsuite/policy/dns_policy.py | 1 + testsuite/policy/rate_limit_policy.py | 1 + testsuite/policy/tls_policy.py | 1 + testsuite/tests/conftest.py | 1 + .../authorino/authorization/opa/external_registry/conftest.py | 1 + .../opa/external_registry/test_auto_refresh_policy.py | 1 + .../kuadrant/authorino/authorization/opa/test_inline_rego.py | 1 + .../tests/kuadrant/authorino/caching/metadata/test_caching.py | 1 + .../tests/kuadrant/authorino/caching/metadata/test_not_cached.py | 1 + .../section_conditions/test_authorization_condition.py | 1 + .../conditions/section_conditions/test_identity_condition.py | 1 + .../conditions/section_conditions/test_metadata_condition.py | 1 + .../conditions/section_conditions/test_response_condition.py | 1 + .../kuadrant/authorino/conditions/test_patternref_expressions.py | 1 + .../kuadrant/authorino/conditions/test_top_level_condition.py | 1 + testsuite/tests/kuadrant/authorino/conftest.py | 1 + testsuite/tests/kuadrant/authorino/dinosaur/conftest.py | 1 + .../authorino/identity/anonymous/test_anonymous_context.py | 1 + .../authorino/identity/anonymous/test_anonymous_identity.py | 1 + testsuite/tests/kuadrant/authorino/identity/api_key/conftest.py | 1 + .../kuadrant/authorino/identity/api_key/test_api_key_context.py | 1 + .../kuadrant/authorino/identity/api_key/test_auth_credentials.py | 1 + .../kuadrant/authorino/identity/api_key/test_match_expression.py | 1 + .../kuadrant/authorino/identity/api_key/test_match_label.py | 1 + .../kuadrant/authorino/identity/api_key/test_reconciliation.py | 1 + .../tests/kuadrant/authorino/identity/auth/test_auth_identity.py | 1 + testsuite/tests/kuadrant/authorino/identity/conftest.py | 1 + .../identity/extended_properties/test_extended_properties.py | 1 + .../authorino/identity/extended_properties/test_overwriting.py | 1 + .../identity/extended_properties/test_token_normalization.py | 1 + testsuite/tests/kuadrant/authorino/identity/rhsso/conftest.py | 1 + .../kuadrant/authorino/identity/rhsso/test_auth_credentials.py | 1 + .../kuadrant/authorino/identity/rhsso/test_rhsso_context.py | 1 + .../tests/kuadrant/authorino/identity/rhsso/test_rhsso_roles.py | 1 + testsuite/tests/kuadrant/authorino/metadata/conftest.py | 1 + testsuite/tests/kuadrant/authorino/metadata/test_http.py | 1 + testsuite/tests/kuadrant/authorino/metadata/test_user_info.py | 1 + testsuite/tests/kuadrant/authorino/metrics/conftest.py | 1 + testsuite/tests/kuadrant/authorino/metrics/test_deep_metrics.py | 1 + testsuite/tests/kuadrant/authorino/metrics/test_metrics.py | 1 + testsuite/tests/kuadrant/authorino/multiple_hosts/conftest.py | 1 + .../tests/kuadrant/authorino/operator/clusterwide/conftest.py | 1 + .../authorino/operator/clusterwide/test_all_namespace_api_key.py | 1 + .../kuadrant/authorino/operator/clusterwide/test_clusterwide.py | 1 + testsuite/tests/kuadrant/authorino/operator/conftest.py | 1 + testsuite/tests/kuadrant/authorino/operator/raw_http/conftest.py | 1 + testsuite/tests/kuadrant/authorino/operator/sharding/conftest.py | 1 + .../tests/kuadrant/authorino/operator/sharding/test_sharding.py | 1 + testsuite/tests/kuadrant/authorino/operator/test_wildcard.py | 1 + testsuite/tests/kuadrant/authorino/operator/tls/conftest.py | 1 + testsuite/tests/kuadrant/authorino/operator/tls/mtls/conftest.py | 1 + .../kuadrant/authorino/operator/tls/mtls/test_mtls_attributes.py | 1 + .../kuadrant/authorino/operator/tls/mtls/test_mtls_identity.py | 1 + .../authorino/operator/tls/mtls/test_mtls_trust_chain.py | 1 + testsuite/tests/kuadrant/authorino/operator/tls/test_webhook.py | 1 + testsuite/tests/kuadrant/authorino/performance/conftest.py | 1 + .../tests/kuadrant/authorino/performance/test_perf_basic.py | 1 + testsuite/tests/kuadrant/authorino/priority/conftest.py | 1 + testsuite/tests/kuadrant/authorino/priority/test_dependency.py | 1 + .../tests/kuadrant/authorino/priority/test_sequence_anonymous.py | 1 + .../tests/kuadrant/authorino/priority/test_sequence_api_key.py | 1 + testsuite/tests/kuadrant/authorino/response/test_base64.py | 1 + testsuite/tests/kuadrant/authorino/response/test_deny_with.py | 1 + testsuite/tests/kuadrant/authorino/response/test_headers.py | 1 + .../tests/kuadrant/authorino/response/test_multiple_responses.py | 1 + testsuite/tests/kuadrant/authorino/response/test_redirect.py | 1 + .../tests/kuadrant/authorino/response/test_simple_response.py | 1 + testsuite/tests/kuadrant/authorino/wristband/test_wristband.py | 1 + testsuite/tests/kuadrant/conftest.py | 1 + testsuite/tests/kuadrant/gateway/conftest.py | 1 + testsuite/tests/kuadrant/gateway/test_basic.py | 1 + testsuite/tests/kuadrant/limitador/test_multiple_iterations.py | 1 + testsuite/tests/kuadrant/limitador/test_route_rule.py | 1 + testsuite/tests/kuadrant/reconciliation/conftest.py | 1 + testsuite/tests/kuadrant/reconciliation/test_httproute_delete.py | 1 + testsuite/tests/kuadrant/reconciliation/test_httproute_hosts.py | 1 + .../tests/kuadrant/reconciliation/test_httproute_matches.py | 1 + testsuite/tests/mgc/conftest.py | 1 + testsuite/tests/mgc/dnspolicy/conftest.py | 1 + testsuite/tests/mgc/dnspolicy/health_check/conftest.py | 1 + .../tests/mgc/dnspolicy/health_check/test_healthy_endpoint.py | 1 + .../tests/mgc/dnspolicy/health_check/test_unhealthy_endpoint.py | 1 + testsuite/tests/mgc/test_basic.py | 1 + testsuite/tests/mgc/tlspolicy/test_cert_parameters.py | 1 + testsuite/utils.py | 1 + 121 files changed, 121 insertions(+) diff --git a/testsuite/certificates.py b/testsuite/certificates.py index 8cac1aec..a92d1c5e 100644 --- a/testsuite/certificates.py +++ b/testsuite/certificates.py @@ -1,4 +1,5 @@ """Module containing classes for working with TLS certificates""" + import dataclasses import datetime import json diff --git a/testsuite/config/tools.py b/testsuite/config/tools.py index f61927a2..95cd2dfd 100644 --- a/testsuite/config/tools.py +++ b/testsuite/config/tools.py @@ -1,4 +1,5 @@ """Dynaconf loader for fetching data from tools namespace""" + import logging logger = logging.getLogger(__name__) diff --git a/testsuite/gateway/__init__.py b/testsuite/gateway/__init__.py index 798e96ff..94fc2895 100644 --- a/testsuite/gateway/__init__.py +++ b/testsuite/gateway/__init__.py @@ -1,4 +1,5 @@ """Classes related to Gateways""" + import enum from abc import ABC, abstractmethod from dataclasses import dataclass diff --git a/testsuite/gateway/envoy/__init__.py b/testsuite/gateway/envoy/__init__.py index b83a6fc3..5cc88003 100644 --- a/testsuite/gateway/envoy/__init__.py +++ b/testsuite/gateway/envoy/__init__.py @@ -1,4 +1,5 @@ """Envoy Gateway module""" + import time from typing import Optional diff --git a/testsuite/gateway/envoy/config.py b/testsuite/gateway/envoy/config.py index 4bea30fc..59dce3b3 100644 --- a/testsuite/gateway/envoy/config.py +++ b/testsuite/gateway/envoy/config.py @@ -1,4 +1,5 @@ """Envoy Config""" + import yaml from testsuite.openshift.httpbin import Httpbin diff --git a/testsuite/gateway/envoy/route.py b/testsuite/gateway/envoy/route.py index e032aace..bb679ba3 100644 --- a/testsuite/gateway/envoy/route.py +++ b/testsuite/gateway/envoy/route.py @@ -1,4 +1,5 @@ """GatewayRoute implementation for pure Envoy Deployment""" + import typing from testsuite.gateway import Gateway, GatewayRoute diff --git a/testsuite/gateway/envoy/tls.py b/testsuite/gateway/envoy/tls.py index 3297833d..a932c426 100644 --- a/testsuite/gateway/envoy/tls.py +++ b/testsuite/gateway/envoy/tls.py @@ -1,4 +1,5 @@ """Envoy Gateway implementation with TLS setup""" + from typing import TYPE_CHECKING import yaml diff --git a/testsuite/gateway/envoy/wristband.py b/testsuite/gateway/envoy/wristband.py index cde6c2be..c9849430 100644 --- a/testsuite/gateway/envoy/wristband.py +++ b/testsuite/gateway/envoy/wristband.py @@ -1,4 +1,5 @@ """Wristband Envoy""" + import yaml from testsuite.gateway.envoy import Envoy, EnvoyConfig diff --git a/testsuite/gateway/gateway_api/gateway.py b/testsuite/gateway/gateway_api/gateway.py index 8ca951fb..bb257cfe 100644 --- a/testsuite/gateway/gateway_api/gateway.py +++ b/testsuite/gateway/gateway_api/gateway.py @@ -1,4 +1,5 @@ """Module containing all gateway classes""" + # mypy: disable-error-code="override" import json from typing import Optional diff --git a/testsuite/gateway/gateway_api/hostname.py b/testsuite/gateway/gateway_api/hostname.py index df535f5b..02f3bf03 100644 --- a/testsuite/gateway/gateway_api/hostname.py +++ b/testsuite/gateway/gateway_api/hostname.py @@ -1,4 +1,5 @@ """Module containing implementation for Hostname related classes of Gateway API""" + from httpx import Client from testsuite.certificates import Certificate diff --git a/testsuite/httpx/__init__.py b/testsuite/httpx/__init__.py index 8748a39c..ac289987 100644 --- a/testsuite/httpx/__init__.py +++ b/testsuite/httpx/__init__.py @@ -1,4 +1,5 @@ """Common classes for Httpx""" + # I change return type of HTTPX client to Kuadrant Result # mypy: disable-error-code="override, return-value" from tempfile import NamedTemporaryFile diff --git a/testsuite/httpx/auth.py b/testsuite/httpx/auth.py index d78a5f86..622778df 100644 --- a/testsuite/httpx/auth.py +++ b/testsuite/httpx/auth.py @@ -1,4 +1,5 @@ """Auth Classes for HttpX""" + from functools import cached_property from typing import Generator, Callable, Union diff --git a/testsuite/hyperfoil/__init__.py b/testsuite/hyperfoil/__init__.py index a6dbd955..23fca4d2 100644 --- a/testsuite/hyperfoil/__init__.py +++ b/testsuite/hyperfoil/__init__.py @@ -1,4 +1,5 @@ """Module containing facade for hyperfoil manipulation""" + import shutil import typing from io import StringIO diff --git a/testsuite/lifecycle.py b/testsuite/lifecycle.py index 7f7d6bae..f0a00a51 100644 --- a/testsuite/lifecycle.py +++ b/testsuite/lifecycle.py @@ -1,4 +1,5 @@ """Classes related to lifecycle management""" + import abc diff --git a/testsuite/mockserver.py b/testsuite/mockserver.py index 67e4598c..6efde84a 100644 --- a/testsuite/mockserver.py +++ b/testsuite/mockserver.py @@ -1,4 +1,5 @@ """Module for Mockserver integration""" + from typing import Union import httpx diff --git a/testsuite/oidc/__init__.py b/testsuite/oidc/__init__.py index d5a4b751..a124650a 100644 --- a/testsuite/oidc/__init__.py +++ b/testsuite/oidc/__init__.py @@ -1,4 +1,5 @@ """Common classes for OIDC provider""" + from abc import ABC, abstractmethod from dataclasses import dataclass from typing import Callable, Tuple diff --git a/testsuite/oidc/auth0.py b/testsuite/oidc/auth0.py index 7cfeab81..d7d44667 100644 --- a/testsuite/oidc/auth0.py +++ b/testsuite/oidc/auth0.py @@ -1,4 +1,5 @@ """Module containing all classes necessary to work with Auth0""" + from functools import cached_property import httpx diff --git a/testsuite/oidc/rhsso/__init__.py b/testsuite/oidc/rhsso/__init__.py index f9fd3a3f..d2a7bac4 100644 --- a/testsuite/oidc/rhsso/__init__.py +++ b/testsuite/oidc/rhsso/__init__.py @@ -1,4 +1,5 @@ """Objects for RHSSO""" + from functools import cached_property from urllib.parse import urlparse diff --git a/testsuite/oidc/rhsso/objects.py b/testsuite/oidc/rhsso/objects.py index 24c00a1e..efe6e2f5 100644 --- a/testsuite/oidc/rhsso/objects.py +++ b/testsuite/oidc/rhsso/objects.py @@ -1,4 +1,5 @@ """Object wrappers of RHSSO resources""" + from functools import cached_property from typing import List diff --git a/testsuite/openshift/__init__.py b/testsuite/openshift/__init__.py index 24ca482c..435bc803 100644 --- a/testsuite/openshift/__init__.py +++ b/testsuite/openshift/__init__.py @@ -1,4 +1,5 @@ """OpenShift common objects""" + import functools from dataclasses import dataclass, field from typing import Optional, Literal diff --git a/testsuite/openshift/api_key.py b/testsuite/openshift/api_key.py index 00e2400a..04a569b6 100644 --- a/testsuite/openshift/api_key.py +++ b/testsuite/openshift/api_key.py @@ -1,4 +1,5 @@ """API Key Secret CR object""" + import base64 from functools import cached_property diff --git a/testsuite/openshift/authorino.py b/testsuite/openshift/authorino.py index 3b8cf85d..a960b7d7 100644 --- a/testsuite/openshift/authorino.py +++ b/testsuite/openshift/authorino.py @@ -1,4 +1,5 @@ """Authorino CR object""" + import abc from typing import Any, Dict, List diff --git a/testsuite/openshift/config_map.py b/testsuite/openshift/config_map.py index 87e57b8b..c9071433 100644 --- a/testsuite/openshift/config_map.py +++ b/testsuite/openshift/config_map.py @@ -1,4 +1,5 @@ """Config map""" + from testsuite.openshift import OpenShiftObject diff --git a/testsuite/openshift/deployment.py b/testsuite/openshift/deployment.py index 80adc68c..9cc8a59e 100644 --- a/testsuite/openshift/deployment.py +++ b/testsuite/openshift/deployment.py @@ -1,4 +1,5 @@ """Deployment related objects""" + from dataclasses import dataclass from typing import Any diff --git a/testsuite/openshift/httpbin.py b/testsuite/openshift/httpbin.py index 92910133..9ba76c7c 100644 --- a/testsuite/openshift/httpbin.py +++ b/testsuite/openshift/httpbin.py @@ -1,4 +1,5 @@ """Httpbin related classes""" + from functools import cached_property from testsuite.lifecycle import LifecycleObject diff --git a/testsuite/openshift/ingress.py b/testsuite/openshift/ingress.py index e5ce59d9..f6c708cb 100644 --- a/testsuite/openshift/ingress.py +++ b/testsuite/openshift/ingress.py @@ -1,4 +1,5 @@ """Kubernetes Ingress object""" + from typing import Any, Dict, List, Optional, TYPE_CHECKING from testsuite.openshift import OpenShiftObject diff --git a/testsuite/openshift/metrics/__init__.py b/testsuite/openshift/metrics/__init__.py index 41565eb2..45ae8c43 100644 --- a/testsuite/openshift/metrics/__init__.py +++ b/testsuite/openshift/metrics/__init__.py @@ -1,4 +1,5 @@ """Package implements objects to work with metrics from Prometheus client for OpenShift""" + from .prometheus import Prometheus, Metrics from .service_monitor import ServiceMonitor, MetricsEndpoint diff --git a/testsuite/openshift/metrics/prometheus.py b/testsuite/openshift/metrics/prometheus.py index 93583455..80376c6e 100644 --- a/testsuite/openshift/metrics/prometheus.py +++ b/testsuite/openshift/metrics/prometheus.py @@ -1,4 +1,5 @@ """Simple client for the OpenShift metrics""" + from typing import Callable from datetime import datetime diff --git a/testsuite/openshift/metrics/service_monitor.py b/testsuite/openshift/metrics/service_monitor.py index 504bb5a1..d01f4adb 100644 --- a/testsuite/openshift/metrics/service_monitor.py +++ b/testsuite/openshift/metrics/service_monitor.py @@ -1,4 +1,5 @@ """Module implements Service Monitor CR for OpenShift""" + from dataclasses import dataclass from testsuite.utils import asdict diff --git a/testsuite/openshift/route.py b/testsuite/openshift/route.py index 08092c2b..9fdfdd32 100644 --- a/testsuite/openshift/route.py +++ b/testsuite/openshift/route.py @@ -1,4 +1,5 @@ """Module containing Route related stuff""" + from functools import cached_property from httpx import Client diff --git a/testsuite/openshift/secret.py b/testsuite/openshift/secret.py index 7f0fb7bd..465bd1eb 100644 --- a/testsuite/openshift/secret.py +++ b/testsuite/openshift/secret.py @@ -1,4 +1,5 @@ """Module containing Secret related classes""" + import base64 from typing import Literal diff --git a/testsuite/openshift/service.py b/testsuite/openshift/service.py index 6188eb85..0245850e 100644 --- a/testsuite/openshift/service.py +++ b/testsuite/openshift/service.py @@ -1,4 +1,5 @@ """Service related objects""" + from dataclasses import dataclass, asdict from testsuite.openshift import OpenShiftObject diff --git a/testsuite/policy/authorization/__init__.py b/testsuite/policy/authorization/__init__.py index ca44eed1..0c9af70c 100644 --- a/testsuite/policy/authorization/__init__.py +++ b/testsuite/policy/authorization/__init__.py @@ -1,4 +1,5 @@ """Authorization related objects""" + import abc from dataclasses import dataclass from typing import Literal, Optional diff --git a/testsuite/policy/authorization/auth_config.py b/testsuite/policy/authorization/auth_config.py index f404ebdc..3b616246 100644 --- a/testsuite/policy/authorization/auth_config.py +++ b/testsuite/policy/authorization/auth_config.py @@ -1,4 +1,5 @@ """AuthConfig object""" + from functools import cached_property from typing import Dict diff --git a/testsuite/policy/authorization/auth_policy.py b/testsuite/policy/authorization/auth_policy.py index 94003e7e..bcb6ebc1 100644 --- a/testsuite/policy/authorization/auth_policy.py +++ b/testsuite/policy/authorization/auth_policy.py @@ -1,4 +1,5 @@ """Module containing classes related to AuthPolicy""" + from typing import Dict, TYPE_CHECKING from testsuite.utils import asdict diff --git a/testsuite/policy/authorization/sections.py b/testsuite/policy/authorization/sections.py index c7d38d27..ebc34a9f 100644 --- a/testsuite/policy/authorization/sections.py +++ b/testsuite/policy/authorization/sections.py @@ -1,4 +1,5 @@ """Sections inside of AuthConfig""" + from typing import Literal, Iterable, TYPE_CHECKING, Union from testsuite.policy.authorization import ( diff --git a/testsuite/policy/dns_policy.py b/testsuite/policy/dns_policy.py index 4d277450..f7f32cf1 100644 --- a/testsuite/policy/dns_policy.py +++ b/testsuite/policy/dns_policy.py @@ -1,4 +1,5 @@ """Module for DNSPolicy related classes""" + from dataclasses import dataclass from typing import Optional, Literal diff --git a/testsuite/policy/rate_limit_policy.py b/testsuite/policy/rate_limit_policy.py index 26110c78..107bda3a 100644 --- a/testsuite/policy/rate_limit_policy.py +++ b/testsuite/policy/rate_limit_policy.py @@ -1,4 +1,5 @@ """RateLimitPolicy related objects""" + from dataclasses import dataclass from time import sleep from typing import Iterable, Literal, Optional, List diff --git a/testsuite/policy/tls_policy.py b/testsuite/policy/tls_policy.py index e257a61b..2d34910f 100644 --- a/testsuite/policy/tls_policy.py +++ b/testsuite/policy/tls_policy.py @@ -1,4 +1,5 @@ """Module for TLSPolicy related classes""" + from testsuite.gateway import Referencable from testsuite.openshift.client import OpenShiftClient from testsuite.openshift import OpenShiftObject diff --git a/testsuite/tests/conftest.py b/testsuite/tests/conftest.py index 3306707d..063c65c2 100644 --- a/testsuite/tests/conftest.py +++ b/testsuite/tests/conftest.py @@ -1,4 +1,5 @@ """Root conftest""" + import signal from urllib.parse import urlparse diff --git a/testsuite/tests/kuadrant/authorino/authorization/opa/external_registry/conftest.py b/testsuite/tests/kuadrant/authorino/authorization/opa/external_registry/conftest.py index 3d544c8b..e2738c76 100644 --- a/testsuite/tests/kuadrant/authorino/authorization/opa/external_registry/conftest.py +++ b/testsuite/tests/kuadrant/authorino/authorization/opa/external_registry/conftest.py @@ -1,4 +1,5 @@ """Conftest for OPA policy located on external registry""" + import pytest from testsuite.utils import rego_allow_header diff --git a/testsuite/tests/kuadrant/authorino/authorization/opa/external_registry/test_auto_refresh_policy.py b/testsuite/tests/kuadrant/authorino/authorization/opa/external_registry/test_auto_refresh_policy.py index e7368dbe..ba7b08df 100644 --- a/testsuite/tests/kuadrant/authorino/authorization/opa/external_registry/test_auto_refresh_policy.py +++ b/testsuite/tests/kuadrant/authorino/authorization/opa/external_registry/test_auto_refresh_policy.py @@ -2,6 +2,7 @@ Tests for Open Policy Agent (OPA) policy pulled from external registry. Registry is represented by Mockserver Expectation that returns Rego query. """ + import time import pytest diff --git a/testsuite/tests/kuadrant/authorino/authorization/opa/test_inline_rego.py b/testsuite/tests/kuadrant/authorino/authorization/opa/test_inline_rego.py index 0c57dacb..0faf570b 100644 --- a/testsuite/tests/kuadrant/authorino/authorization/opa/test_inline_rego.py +++ b/testsuite/tests/kuadrant/authorino/authorization/opa/test_inline_rego.py @@ -1,4 +1,5 @@ """Tests for Open Policy Agent (OPA) Rego policies""" + import pytest from testsuite.utils import rego_allow_header diff --git a/testsuite/tests/kuadrant/authorino/caching/metadata/test_caching.py b/testsuite/tests/kuadrant/authorino/caching/metadata/test_caching.py index 834a8758..94526404 100644 --- a/testsuite/tests/kuadrant/authorino/caching/metadata/test_caching.py +++ b/testsuite/tests/kuadrant/authorino/caching/metadata/test_caching.py @@ -1,4 +1,5 @@ """Tests metadata caching""" + from time import sleep import pytest diff --git a/testsuite/tests/kuadrant/authorino/caching/metadata/test_not_cached.py b/testsuite/tests/kuadrant/authorino/caching/metadata/test_not_cached.py index 0fb46d0c..a5262ba5 100644 --- a/testsuite/tests/kuadrant/authorino/caching/metadata/test_not_cached.py +++ b/testsuite/tests/kuadrant/authorino/caching/metadata/test_not_cached.py @@ -1,4 +1,5 @@ """Tests for metadata without caching feature""" + import pytest from testsuite.utils import extract_response diff --git a/testsuite/tests/kuadrant/authorino/conditions/section_conditions/test_authorization_condition.py b/testsuite/tests/kuadrant/authorino/conditions/section_conditions/test_authorization_condition.py index 5a00f07e..ca43d062 100644 --- a/testsuite/tests/kuadrant/authorino/conditions/section_conditions/test_authorization_condition.py +++ b/testsuite/tests/kuadrant/authorino/conditions/section_conditions/test_authorization_condition.py @@ -1,4 +1,5 @@ """Test condition to skip the authorization section of AuthConfig""" + import pytest from testsuite.policy.authorization import Pattern diff --git a/testsuite/tests/kuadrant/authorino/conditions/section_conditions/test_identity_condition.py b/testsuite/tests/kuadrant/authorino/conditions/section_conditions/test_identity_condition.py index 1751b4af..006b6776 100644 --- a/testsuite/tests/kuadrant/authorino/conditions/section_conditions/test_identity_condition.py +++ b/testsuite/tests/kuadrant/authorino/conditions/section_conditions/test_identity_condition.py @@ -1,4 +1,5 @@ """Test condition to skip the identity section of AuthConfig""" + import pytest from testsuite.policy.authorization import Pattern diff --git a/testsuite/tests/kuadrant/authorino/conditions/section_conditions/test_metadata_condition.py b/testsuite/tests/kuadrant/authorino/conditions/section_conditions/test_metadata_condition.py index 38251425..b9aecb89 100644 --- a/testsuite/tests/kuadrant/authorino/conditions/section_conditions/test_metadata_condition.py +++ b/testsuite/tests/kuadrant/authorino/conditions/section_conditions/test_metadata_condition.py @@ -1,4 +1,5 @@ """Test condition to skip the metadata section of AuthConfig""" + import pytest from testsuite.policy.authorization import Pattern diff --git a/testsuite/tests/kuadrant/authorino/conditions/section_conditions/test_response_condition.py b/testsuite/tests/kuadrant/authorino/conditions/section_conditions/test_response_condition.py index 83083412..dfc44c09 100644 --- a/testsuite/tests/kuadrant/authorino/conditions/section_conditions/test_response_condition.py +++ b/testsuite/tests/kuadrant/authorino/conditions/section_conditions/test_response_condition.py @@ -1,4 +1,5 @@ """Test condition to skip the response section of AuthConfig""" + import pytest from testsuite.policy.authorization import Pattern, Value, JsonResponse diff --git a/testsuite/tests/kuadrant/authorino/conditions/test_patternref_expressions.py b/testsuite/tests/kuadrant/authorino/conditions/test_patternref_expressions.py index 18ae40a5..f9406df8 100644 --- a/testsuite/tests/kuadrant/authorino/conditions/test_patternref_expressions.py +++ b/testsuite/tests/kuadrant/authorino/conditions/test_patternref_expressions.py @@ -1,4 +1,5 @@ """Test patterns reference functionality and All/Any logical expressions.""" + import pytest from testsuite.policy.authorization import Pattern, PatternRef, AnyPattern, AllPattern diff --git a/testsuite/tests/kuadrant/authorino/conditions/test_top_level_condition.py b/testsuite/tests/kuadrant/authorino/conditions/test_top_level_condition.py index e4cc5098..3e93c118 100644 --- a/testsuite/tests/kuadrant/authorino/conditions/test_top_level_condition.py +++ b/testsuite/tests/kuadrant/authorino/conditions/test_top_level_condition.py @@ -1,4 +1,5 @@ """Test condition to skip the entire AuthConfig""" + import pytest from testsuite.policy.authorization import Pattern diff --git a/testsuite/tests/kuadrant/authorino/conftest.py b/testsuite/tests/kuadrant/authorino/conftest.py index c4b3e6d8..c3d7fcc6 100644 --- a/testsuite/tests/kuadrant/authorino/conftest.py +++ b/testsuite/tests/kuadrant/authorino/conftest.py @@ -1,4 +1,5 @@ """Conftest for Authorino tests""" + import pytest from testsuite.httpx.auth import HttpxOidcClientAuth diff --git a/testsuite/tests/kuadrant/authorino/dinosaur/conftest.py b/testsuite/tests/kuadrant/authorino/dinosaur/conftest.py index 50bc065a..431f4319 100644 --- a/testsuite/tests/kuadrant/authorino/dinosaur/conftest.py +++ b/testsuite/tests/kuadrant/authorino/dinosaur/conftest.py @@ -1,6 +1,7 @@ """ Conftest for dinosaur test """ + import pytest from testsuite.httpx.auth import HttpxOidcClientAuth diff --git a/testsuite/tests/kuadrant/authorino/identity/anonymous/test_anonymous_context.py b/testsuite/tests/kuadrant/authorino/identity/anonymous/test_anonymous_context.py index 956c2038..7bc688ec 100644 --- a/testsuite/tests/kuadrant/authorino/identity/anonymous/test_anonymous_context.py +++ b/testsuite/tests/kuadrant/authorino/identity/anonymous/test_anonymous_context.py @@ -1,4 +1,5 @@ """Test for anonymous identity context""" + import pytest from testsuite.utils import extract_response diff --git a/testsuite/tests/kuadrant/authorino/identity/anonymous/test_anonymous_identity.py b/testsuite/tests/kuadrant/authorino/identity/anonymous/test_anonymous_identity.py index 8af9dae8..a302a214 100644 --- a/testsuite/tests/kuadrant/authorino/identity/anonymous/test_anonymous_identity.py +++ b/testsuite/tests/kuadrant/authorino/identity/anonymous/test_anonymous_identity.py @@ -1,4 +1,5 @@ """Test for anonymous identity""" + import pytest diff --git a/testsuite/tests/kuadrant/authorino/identity/api_key/conftest.py b/testsuite/tests/kuadrant/authorino/identity/api_key/conftest.py index d4ca95f4..ebf35006 100644 --- a/testsuite/tests/kuadrant/authorino/identity/api_key/conftest.py +++ b/testsuite/tests/kuadrant/authorino/identity/api_key/conftest.py @@ -1,4 +1,5 @@ """Conftest for authorino API key identity""" + import pytest from testsuite.httpx.auth import HeaderApiKeyAuth diff --git a/testsuite/tests/kuadrant/authorino/identity/api_key/test_api_key_context.py b/testsuite/tests/kuadrant/authorino/identity/api_key/test_api_key_context.py index fd2c5a12..ee732d22 100644 --- a/testsuite/tests/kuadrant/authorino/identity/api_key/test_api_key_context.py +++ b/testsuite/tests/kuadrant/authorino/identity/api_key/test_api_key_context.py @@ -1,4 +1,5 @@ """Test for API key identity context""" + import pytest from testsuite.utils import extract_response diff --git a/testsuite/tests/kuadrant/authorino/identity/api_key/test_auth_credentials.py b/testsuite/tests/kuadrant/authorino/identity/api_key/test_auth_credentials.py index cc6416fe..9eb9f5e3 100644 --- a/testsuite/tests/kuadrant/authorino/identity/api_key/test_auth_credentials.py +++ b/testsuite/tests/kuadrant/authorino/identity/api_key/test_auth_credentials.py @@ -1,4 +1,5 @@ """Test for API key auth credentials""" + import pytest from testsuite.policy.authorization import Credentials diff --git a/testsuite/tests/kuadrant/authorino/identity/api_key/test_match_expression.py b/testsuite/tests/kuadrant/authorino/identity/api_key/test_match_expression.py index 8c07be87..f6f24d0a 100644 --- a/testsuite/tests/kuadrant/authorino/identity/api_key/test_match_expression.py +++ b/testsuite/tests/kuadrant/authorino/identity/api_key/test_match_expression.py @@ -3,6 +3,7 @@ Using K8 notation for API key Secret label selector - selector.matchExpressions https://pkg.go.dev/k8s.io/apimachinery@v0.23.0/pkg/apis/meta/v1#LabelSelector """ + import pytest from testsuite.openshift import Selector, MatchExpression diff --git a/testsuite/tests/kuadrant/authorino/identity/api_key/test_match_label.py b/testsuite/tests/kuadrant/authorino/identity/api_key/test_match_label.py index 565f3df3..4ea5a9b0 100644 --- a/testsuite/tests/kuadrant/authorino/identity/api_key/test_match_label.py +++ b/testsuite/tests/kuadrant/authorino/identity/api_key/test_match_label.py @@ -1,4 +1,5 @@ """Tests identity verification & authentication with API keys. Using selector.matchLabels""" + import pytest diff --git a/testsuite/tests/kuadrant/authorino/identity/api_key/test_reconciliation.py b/testsuite/tests/kuadrant/authorino/identity/api_key/test_reconciliation.py index 9da52c49..606ad275 100644 --- a/testsuite/tests/kuadrant/authorino/identity/api_key/test_reconciliation.py +++ b/testsuite/tests/kuadrant/authorino/identity/api_key/test_reconciliation.py @@ -1,4 +1,5 @@ """Tests Secret reconciliation for API key identity verification & authentication""" + import pytest from testsuite.httpx.auth import HeaderApiKeyAuth diff --git a/testsuite/tests/kuadrant/authorino/identity/auth/test_auth_identity.py b/testsuite/tests/kuadrant/authorino/identity/auth/test_auth_identity.py index 67ced84c..22fff120 100644 --- a/testsuite/tests/kuadrant/authorino/identity/auth/test_auth_identity.py +++ b/testsuite/tests/kuadrant/authorino/identity/auth/test_auth_identity.py @@ -1,4 +1,5 @@ """Tests basic authentication with RHSSO/Auth0 as identity provider""" + import pytest from testsuite.httpx.auth import HttpxOidcClientAuth diff --git a/testsuite/tests/kuadrant/authorino/identity/conftest.py b/testsuite/tests/kuadrant/authorino/identity/conftest.py index 4fc48bc7..70dedc2c 100644 --- a/testsuite/tests/kuadrant/authorino/identity/conftest.py +++ b/testsuite/tests/kuadrant/authorino/identity/conftest.py @@ -1,4 +1,5 @@ """Conftest for all Identity tests""" + import pytest diff --git a/testsuite/tests/kuadrant/authorino/identity/extended_properties/test_extended_properties.py b/testsuite/tests/kuadrant/authorino/identity/extended_properties/test_extended_properties.py index 7ef11a1b..caf8a277 100644 --- a/testsuite/tests/kuadrant/authorino/identity/extended_properties/test_extended_properties.py +++ b/testsuite/tests/kuadrant/authorino/identity/extended_properties/test_extended_properties.py @@ -1,4 +1,5 @@ """Basic tests for extended properties""" + import pytest from testsuite.policy.authorization import Value, ValueFrom diff --git a/testsuite/tests/kuadrant/authorino/identity/extended_properties/test_overwriting.py b/testsuite/tests/kuadrant/authorino/identity/extended_properties/test_overwriting.py index 311ca020..7ecdb350 100644 --- a/testsuite/tests/kuadrant/authorino/identity/extended_properties/test_overwriting.py +++ b/testsuite/tests/kuadrant/authorino/identity/extended_properties/test_overwriting.py @@ -1,4 +1,5 @@ """https://github.com/Kuadrant/authorino/pull/399""" + import pytest from testsuite.policy.authorization import Value diff --git a/testsuite/tests/kuadrant/authorino/identity/extended_properties/test_token_normalization.py b/testsuite/tests/kuadrant/authorino/identity/extended_properties/test_token_normalization.py index 6e3c14b0..04e5d437 100644 --- a/testsuite/tests/kuadrant/authorino/identity/extended_properties/test_token_normalization.py +++ b/testsuite/tests/kuadrant/authorino/identity/extended_properties/test_token_normalization.py @@ -1,4 +1,5 @@ """https://github.com/Kuadrant/authorino/blob/main/docs/user-guides/token-normalization.md""" + import pytest from testsuite.policy.authorization import Pattern, Value, ValueFrom from testsuite.httpx.auth import HeaderApiKeyAuth, HttpxOidcClientAuth diff --git a/testsuite/tests/kuadrant/authorino/identity/rhsso/conftest.py b/testsuite/tests/kuadrant/authorino/identity/rhsso/conftest.py index d8760e53..c5774ffe 100644 --- a/testsuite/tests/kuadrant/authorino/identity/rhsso/conftest.py +++ b/testsuite/tests/kuadrant/authorino/identity/rhsso/conftest.py @@ -1,4 +1,5 @@ """Conftest for authorino rhsso tests""" + import pytest diff --git a/testsuite/tests/kuadrant/authorino/identity/rhsso/test_auth_credentials.py b/testsuite/tests/kuadrant/authorino/identity/rhsso/test_auth_credentials.py index b2089998..11a35289 100644 --- a/testsuite/tests/kuadrant/authorino/identity/rhsso/test_auth_credentials.py +++ b/testsuite/tests/kuadrant/authorino/identity/rhsso/test_auth_credentials.py @@ -1,4 +1,5 @@ """Test for RHSSO auth credentials""" + import pytest from testsuite.policy.authorization import Credentials diff --git a/testsuite/tests/kuadrant/authorino/identity/rhsso/test_rhsso_context.py b/testsuite/tests/kuadrant/authorino/identity/rhsso/test_rhsso_context.py index a28fe7a2..64d9cfae 100644 --- a/testsuite/tests/kuadrant/authorino/identity/rhsso/test_rhsso_context.py +++ b/testsuite/tests/kuadrant/authorino/identity/rhsso/test_rhsso_context.py @@ -1,4 +1,5 @@ """Test for RHSSO identity context""" + import json import time diff --git a/testsuite/tests/kuadrant/authorino/identity/rhsso/test_rhsso_roles.py b/testsuite/tests/kuadrant/authorino/identity/rhsso/test_rhsso_roles.py index e630179f..56012e30 100644 --- a/testsuite/tests/kuadrant/authorino/identity/rhsso/test_rhsso_roles.py +++ b/testsuite/tests/kuadrant/authorino/identity/rhsso/test_rhsso_roles.py @@ -1,4 +1,5 @@ """Basic test of role based authentication""" + import pytest from testsuite.httpx.auth import HttpxOidcClientAuth diff --git a/testsuite/tests/kuadrant/authorino/metadata/conftest.py b/testsuite/tests/kuadrant/authorino/metadata/conftest.py index 7161685f..9bbf3ff7 100644 --- a/testsuite/tests/kuadrant/authorino/metadata/conftest.py +++ b/testsuite/tests/kuadrant/authorino/metadata/conftest.py @@ -1,4 +1,5 @@ """Conftest for metadata feature tests""" + import pytest from testsuite.openshift import OpenShiftObject diff --git a/testsuite/tests/kuadrant/authorino/metadata/test_http.py b/testsuite/tests/kuadrant/authorino/metadata/test_http.py index 75f3468a..962c3a06 100644 --- a/testsuite/tests/kuadrant/authorino/metadata/test_http.py +++ b/testsuite/tests/kuadrant/authorino/metadata/test_http.py @@ -7,6 +7,7 @@ 2. Add OPA policy to AuthConfig. Rego query (`CHECK_COUNTRY_REGO`) parses the request path and allows only those containing country code saved in metadata. """ + import pytest from testsuite.utils import ContentType diff --git a/testsuite/tests/kuadrant/authorino/metadata/test_user_info.py b/testsuite/tests/kuadrant/authorino/metadata/test_user_info.py index 8b02c87b..e78f661c 100644 --- a/testsuite/tests/kuadrant/authorino/metadata/test_user_info.py +++ b/testsuite/tests/kuadrant/authorino/metadata/test_user_info.py @@ -2,6 +2,7 @@ Tests for external auth metadata. Online fetching of (OIDC) UserInfo data, associated with an OIDC identity source: https://github.com/Kuadrant/authorino/blob/main/docs/features.md#oidc-userinfo-metadatauserinfo """ + import pytest from testsuite.httpx.auth import HttpxOidcClientAuth diff --git a/testsuite/tests/kuadrant/authorino/metrics/conftest.py b/testsuite/tests/kuadrant/authorino/metrics/conftest.py index bcc831c0..529b74f2 100644 --- a/testsuite/tests/kuadrant/authorino/metrics/conftest.py +++ b/testsuite/tests/kuadrant/authorino/metrics/conftest.py @@ -1,4 +1,5 @@ """Conftest for the Authorino metrics tests""" + import yaml import pytest diff --git a/testsuite/tests/kuadrant/authorino/metrics/test_deep_metrics.py b/testsuite/tests/kuadrant/authorino/metrics/test_deep_metrics.py index 459085e7..df27d2d5 100644 --- a/testsuite/tests/kuadrant/authorino/metrics/test_deep_metrics.py +++ b/testsuite/tests/kuadrant/authorino/metrics/test_deep_metrics.py @@ -1,4 +1,5 @@ """Tests for the functionality of the deep-evaluator metric samples""" + import pytest from testsuite.policy.authorization import Value, JsonResponse diff --git a/testsuite/tests/kuadrant/authorino/metrics/test_metrics.py b/testsuite/tests/kuadrant/authorino/metrics/test_metrics.py index 7b1384ef..d36b54ae 100644 --- a/testsuite/tests/kuadrant/authorino/metrics/test_metrics.py +++ b/testsuite/tests/kuadrant/authorino/metrics/test_metrics.py @@ -1,4 +1,5 @@ """Tests for integrity of the metrics endpoints""" + import pytest diff --git a/testsuite/tests/kuadrant/authorino/multiple_hosts/conftest.py b/testsuite/tests/kuadrant/authorino/multiple_hosts/conftest.py index be03a26a..5b86c739 100644 --- a/testsuite/tests/kuadrant/authorino/multiple_hosts/conftest.py +++ b/testsuite/tests/kuadrant/authorino/multiple_hosts/conftest.py @@ -1,4 +1,5 @@ """Conftest for multiple hosts tests""" + import pytest diff --git a/testsuite/tests/kuadrant/authorino/operator/clusterwide/conftest.py b/testsuite/tests/kuadrant/authorino/operator/clusterwide/conftest.py index ca13b3bc..9afaa61d 100644 --- a/testsuite/tests/kuadrant/authorino/operator/clusterwide/conftest.py +++ b/testsuite/tests/kuadrant/authorino/operator/clusterwide/conftest.py @@ -1,4 +1,5 @@ """Conftest for clusterwide tests""" + import pytest from testsuite.policy.authorization.auth_config import AuthConfig diff --git a/testsuite/tests/kuadrant/authorino/operator/clusterwide/test_all_namespace_api_key.py b/testsuite/tests/kuadrant/authorino/operator/clusterwide/test_all_namespace_api_key.py index 1e9c952e..215a426d 100644 --- a/testsuite/tests/kuadrant/authorino/operator/clusterwide/test_all_namespace_api_key.py +++ b/testsuite/tests/kuadrant/authorino/operator/clusterwide/test_all_namespace_api_key.py @@ -2,6 +2,7 @@ Tests for API key identity for AuthConfig configured with all_namespaces=true for cluster-wide API key secret placement. """ + import pytest from testsuite.httpx.auth import HeaderApiKeyAuth diff --git a/testsuite/tests/kuadrant/authorino/operator/clusterwide/test_clusterwide.py b/testsuite/tests/kuadrant/authorino/operator/clusterwide/test_clusterwide.py index 60366e6e..48b311b1 100644 --- a/testsuite/tests/kuadrant/authorino/operator/clusterwide/test_clusterwide.py +++ b/testsuite/tests/kuadrant/authorino/operator/clusterwide/test_clusterwide.py @@ -1,4 +1,5 @@ """Test that Authorino can reconcile resources in multiple namespaces""" + import pytest diff --git a/testsuite/tests/kuadrant/authorino/operator/conftest.py b/testsuite/tests/kuadrant/authorino/operator/conftest.py index f6b423e1..d5ddef26 100644 --- a/testsuite/tests/kuadrant/authorino/operator/conftest.py +++ b/testsuite/tests/kuadrant/authorino/operator/conftest.py @@ -1,4 +1,5 @@ """Module containing common features of all Operator tests""" + import pytest diff --git a/testsuite/tests/kuadrant/authorino/operator/raw_http/conftest.py b/testsuite/tests/kuadrant/authorino/operator/raw_http/conftest.py index f16e26a3..7ce20578 100644 --- a/testsuite/tests/kuadrant/authorino/operator/raw_http/conftest.py +++ b/testsuite/tests/kuadrant/authorino/operator/raw_http/conftest.py @@ -1,4 +1,5 @@ """Conftest for all tests requiring custom deployment of Authorino""" + import pytest from testsuite.policy.authorization import Value, JsonResponse diff --git a/testsuite/tests/kuadrant/authorino/operator/sharding/conftest.py b/testsuite/tests/kuadrant/authorino/operator/sharding/conftest.py index e76c89ca..e5be6f9f 100644 --- a/testsuite/tests/kuadrant/authorino/operator/sharding/conftest.py +++ b/testsuite/tests/kuadrant/authorino/operator/sharding/conftest.py @@ -1,4 +1,5 @@ """Conftest for authorino sharding tests""" + import pytest from testsuite.policy.authorization import Value, JsonResponse diff --git a/testsuite/tests/kuadrant/authorino/operator/sharding/test_sharding.py b/testsuite/tests/kuadrant/authorino/operator/sharding/test_sharding.py index c92a39a9..526fa7f2 100644 --- a/testsuite/tests/kuadrant/authorino/operator/sharding/test_sharding.py +++ b/testsuite/tests/kuadrant/authorino/operator/sharding/test_sharding.py @@ -1,4 +1,5 @@ """Test for authorino sharding""" + import pytest diff --git a/testsuite/tests/kuadrant/authorino/operator/test_wildcard.py b/testsuite/tests/kuadrant/authorino/operator/test_wildcard.py index 63728d9f..032334b5 100644 --- a/testsuite/tests/kuadrant/authorino/operator/test_wildcard.py +++ b/testsuite/tests/kuadrant/authorino/operator/test_wildcard.py @@ -1,6 +1,7 @@ """ Test for wildcard host """ + import pytest from testsuite.policy.authorization.auth_config import AuthConfig diff --git a/testsuite/tests/kuadrant/authorino/operator/tls/conftest.py b/testsuite/tests/kuadrant/authorino/operator/tls/conftest.py index 96928a38..07403b0a 100644 --- a/testsuite/tests/kuadrant/authorino/operator/tls/conftest.py +++ b/testsuite/tests/kuadrant/authorino/operator/tls/conftest.py @@ -1,4 +1,5 @@ """Conftest for all TLS-enabled tests""" + from typing import Optional, Dict import pytest diff --git a/testsuite/tests/kuadrant/authorino/operator/tls/mtls/conftest.py b/testsuite/tests/kuadrant/authorino/operator/tls/mtls/conftest.py index a0638e4a..d15824d7 100644 --- a/testsuite/tests/kuadrant/authorino/operator/tls/mtls/conftest.py +++ b/testsuite/tests/kuadrant/authorino/operator/tls/mtls/conftest.py @@ -1,4 +1,5 @@ """Conftest for all mTLS tests""" + import pytest from testsuite.certificates import CertInfo diff --git a/testsuite/tests/kuadrant/authorino/operator/tls/mtls/test_mtls_attributes.py b/testsuite/tests/kuadrant/authorino/operator/tls/mtls/test_mtls_attributes.py index 5a232039..c488f077 100644 --- a/testsuite/tests/kuadrant/authorino/operator/tls/mtls/test_mtls_attributes.py +++ b/testsuite/tests/kuadrant/authorino/operator/tls/mtls/test_mtls_attributes.py @@ -1,4 +1,5 @@ """Tests on mTLS authentication with multiple attributes""" + import pytest from testsuite.policy.authorization import Pattern diff --git a/testsuite/tests/kuadrant/authorino/operator/tls/mtls/test_mtls_identity.py b/testsuite/tests/kuadrant/authorino/operator/tls/mtls/test_mtls_identity.py index baf08a42..bb9fc9a0 100644 --- a/testsuite/tests/kuadrant/authorino/operator/tls/mtls/test_mtls_identity.py +++ b/testsuite/tests/kuadrant/authorino/operator/tls/mtls/test_mtls_identity.py @@ -1,4 +1,5 @@ """mTLS authentication tests""" + from typing import Callable import pytest diff --git a/testsuite/tests/kuadrant/authorino/operator/tls/mtls/test_mtls_trust_chain.py b/testsuite/tests/kuadrant/authorino/operator/tls/mtls/test_mtls_trust_chain.py index 18b92cf9..c067cbd2 100644 --- a/testsuite/tests/kuadrant/authorino/operator/tls/mtls/test_mtls_trust_chain.py +++ b/testsuite/tests/kuadrant/authorino/operator/tls/mtls/test_mtls_trust_chain.py @@ -1,4 +1,5 @@ """mTLS trust chain tests""" + import pytest diff --git a/testsuite/tests/kuadrant/authorino/operator/tls/test_webhook.py b/testsuite/tests/kuadrant/authorino/operator/tls/test_webhook.py index 0443da85..aa4e489f 100644 --- a/testsuite/tests/kuadrant/authorino/operator/tls/test_webhook.py +++ b/testsuite/tests/kuadrant/authorino/operator/tls/test_webhook.py @@ -1,6 +1,7 @@ """ Test raw http authorization used in Kubernetes Validating Webhooks. """ + import base64 from typing import Any, Dict import pytest diff --git a/testsuite/tests/kuadrant/authorino/performance/conftest.py b/testsuite/tests/kuadrant/authorino/performance/conftest.py index 74332ba7..ed1315aa 100644 --- a/testsuite/tests/kuadrant/authorino/performance/conftest.py +++ b/testsuite/tests/kuadrant/authorino/performance/conftest.py @@ -1,6 +1,7 @@ """ Conftest for performance tests """ + import os import warnings from datetime import datetime diff --git a/testsuite/tests/kuadrant/authorino/performance/test_perf_basic.py b/testsuite/tests/kuadrant/authorino/performance/test_perf_basic.py index 47a66765..39bdfc1a 100644 --- a/testsuite/tests/kuadrant/authorino/performance/test_perf_basic.py +++ b/testsuite/tests/kuadrant/authorino/performance/test_perf_basic.py @@ -3,6 +3,7 @@ Fill necessary data to benchmark template. Run the test and assert results. """ + from importlib import resources import pytest diff --git a/testsuite/tests/kuadrant/authorino/priority/conftest.py b/testsuite/tests/kuadrant/authorino/priority/conftest.py index 4ea4fd0f..750926d8 100644 --- a/testsuite/tests/kuadrant/authorino/priority/conftest.py +++ b/testsuite/tests/kuadrant/authorino/priority/conftest.py @@ -1,4 +1,5 @@ """Conftest for Authorino priorities tests""" + import pytest diff --git a/testsuite/tests/kuadrant/authorino/priority/test_dependency.py b/testsuite/tests/kuadrant/authorino/priority/test_dependency.py index 529aa100..d6b606da 100644 --- a/testsuite/tests/kuadrant/authorino/priority/test_dependency.py +++ b/testsuite/tests/kuadrant/authorino/priority/test_dependency.py @@ -1,4 +1,5 @@ """Test for evaluators dependencies resolving according to their priorities""" + import pytest from testsuite.utils import extract_response diff --git a/testsuite/tests/kuadrant/authorino/priority/test_sequence_anonymous.py b/testsuite/tests/kuadrant/authorino/priority/test_sequence_anonymous.py index 25beb87a..1596b65c 100644 --- a/testsuite/tests/kuadrant/authorino/priority/test_sequence_anonymous.py +++ b/testsuite/tests/kuadrant/authorino/priority/test_sequence_anonymous.py @@ -2,6 +2,7 @@ Test for anonymous identity low priority trigger. Anonymous identity should trigger after the oidc identity evaluation """ + import pytest from testsuite.utils import extract_response diff --git a/testsuite/tests/kuadrant/authorino/priority/test_sequence_api_key.py b/testsuite/tests/kuadrant/authorino/priority/test_sequence_api_key.py index 03bb18f7..85e81be3 100644 --- a/testsuite/tests/kuadrant/authorino/priority/test_sequence_api_key.py +++ b/testsuite/tests/kuadrant/authorino/priority/test_sequence_api_key.py @@ -1,4 +1,5 @@ """Test for api key identities, with different credential methods, sequential trigger according to their priorities""" + import pytest from testsuite.policy.authorization import Credentials diff --git a/testsuite/tests/kuadrant/authorino/response/test_base64.py b/testsuite/tests/kuadrant/authorino/response/test_base64.py index 27eab6bc..130c0031 100644 --- a/testsuite/tests/kuadrant/authorino/response/test_base64.py +++ b/testsuite/tests/kuadrant/authorino/response/test_base64.py @@ -1,6 +1,7 @@ """ Tests base64 decoding abilities of Authorino and it's escaping of strings """ + import json from base64 import standard_b64encode diff --git a/testsuite/tests/kuadrant/authorino/response/test_deny_with.py b/testsuite/tests/kuadrant/authorino/response/test_deny_with.py index 86cb3828..c95228c3 100644 --- a/testsuite/tests/kuadrant/authorino/response/test_deny_with.py +++ b/testsuite/tests/kuadrant/authorino/response/test_deny_with.py @@ -1,4 +1,5 @@ """Test for custom deny responses.""" + from json import loads import pytest diff --git a/testsuite/tests/kuadrant/authorino/response/test_headers.py b/testsuite/tests/kuadrant/authorino/response/test_headers.py index 432b44ee..c2fce0e0 100644 --- a/testsuite/tests/kuadrant/authorino/response/test_headers.py +++ b/testsuite/tests/kuadrant/authorino/response/test_headers.py @@ -1,4 +1,5 @@ """Tests that wrapperKey property returns value in the correct header""" + import json import pytest diff --git a/testsuite/tests/kuadrant/authorino/response/test_multiple_responses.py b/testsuite/tests/kuadrant/authorino/response/test_multiple_responses.py index 7fe2a0b2..93bc720a 100644 --- a/testsuite/tests/kuadrant/authorino/response/test_multiple_responses.py +++ b/testsuite/tests/kuadrant/authorino/response/test_multiple_responses.py @@ -1,4 +1,5 @@ """Tests multiple responses specified""" + import json import pytest diff --git a/testsuite/tests/kuadrant/authorino/response/test_redirect.py b/testsuite/tests/kuadrant/authorino/response/test_redirect.py index 6f8656af..a985749d 100644 --- a/testsuite/tests/kuadrant/authorino/response/test_redirect.py +++ b/testsuite/tests/kuadrant/authorino/response/test_redirect.py @@ -1,6 +1,7 @@ """ Test for authorino redirect """ + import pytest from testsuite.policy.authorization import ValueFrom, DenyResponse diff --git a/testsuite/tests/kuadrant/authorino/response/test_simple_response.py b/testsuite/tests/kuadrant/authorino/response/test_simple_response.py index 9da2202a..63605b61 100644 --- a/testsuite/tests/kuadrant/authorino/response/test_simple_response.py +++ b/testsuite/tests/kuadrant/authorino/response/test_simple_response.py @@ -1,4 +1,5 @@ """Tests that simplest JSON response returns correct header""" + import json import pytest diff --git a/testsuite/tests/kuadrant/authorino/wristband/test_wristband.py b/testsuite/tests/kuadrant/authorino/wristband/test_wristband.py index 9025063d..2e33ae2d 100644 --- a/testsuite/tests/kuadrant/authorino/wristband/test_wristband.py +++ b/testsuite/tests/kuadrant/authorino/wristband/test_wristband.py @@ -1,4 +1,5 @@ """Test api authentication with wristband-token that was acquired after authentication on the edge layer""" + from jose import jwt diff --git a/testsuite/tests/kuadrant/conftest.py b/testsuite/tests/kuadrant/conftest.py index 5f879c6e..b884f0aa 100644 --- a/testsuite/tests/kuadrant/conftest.py +++ b/testsuite/tests/kuadrant/conftest.py @@ -1,5 +1,6 @@ """Configure all the components through Kuadrant, all methods are placeholders for now since we do not work with Kuadrant""" + import pytest from testsuite.policy.authorization.auth_policy import AuthPolicy diff --git a/testsuite/tests/kuadrant/gateway/conftest.py b/testsuite/tests/kuadrant/gateway/conftest.py index 267a5af4..384f6e42 100644 --- a/testsuite/tests/kuadrant/gateway/conftest.py +++ b/testsuite/tests/kuadrant/gateway/conftest.py @@ -1,4 +1,5 @@ """Conftest for gateway tests""" + import pytest from testsuite.httpx.auth import HttpxOidcClientAuth diff --git a/testsuite/tests/kuadrant/gateway/test_basic.py b/testsuite/tests/kuadrant/gateway/test_basic.py index 4edaba6a..35ecc3a1 100644 --- a/testsuite/tests/kuadrant/gateway/test_basic.py +++ b/testsuite/tests/kuadrant/gateway/test_basic.py @@ -1,4 +1,5 @@ """Test for AuthPolicy attached directly to gateway""" + import pytest diff --git a/testsuite/tests/kuadrant/limitador/test_multiple_iterations.py b/testsuite/tests/kuadrant/limitador/test_multiple_iterations.py index e7f6ba5c..901529d5 100644 --- a/testsuite/tests/kuadrant/limitador/test_multiple_iterations.py +++ b/testsuite/tests/kuadrant/limitador/test_multiple_iterations.py @@ -1,6 +1,7 @@ """ Tests that a single limit is enforced as expected over multiple iterations """ + from time import sleep import pytest diff --git a/testsuite/tests/kuadrant/limitador/test_route_rule.py b/testsuite/tests/kuadrant/limitador/test_route_rule.py index 0ca99515..787b7b1e 100644 --- a/testsuite/tests/kuadrant/limitador/test_route_rule.py +++ b/testsuite/tests/kuadrant/limitador/test_route_rule.py @@ -1,4 +1,5 @@ """Tests that the RLP is correctly apply to the route rule""" + import pytest from testsuite.gateway import RouteMatch, PathMatch, MatchType diff --git a/testsuite/tests/kuadrant/reconciliation/conftest.py b/testsuite/tests/kuadrant/reconciliation/conftest.py index dc0932b9..c756394c 100644 --- a/testsuite/tests/kuadrant/reconciliation/conftest.py +++ b/testsuite/tests/kuadrant/reconciliation/conftest.py @@ -1,4 +1,5 @@ """Conftest for reconciliation tests""" + import backoff import pytest diff --git a/testsuite/tests/kuadrant/reconciliation/test_httproute_delete.py b/testsuite/tests/kuadrant/reconciliation/test_httproute_delete.py index db3f37ab..2d819a6c 100644 --- a/testsuite/tests/kuadrant/reconciliation/test_httproute_delete.py +++ b/testsuite/tests/kuadrant/reconciliation/test_httproute_delete.py @@ -1,4 +1,5 @@ """Tests that AuthPolicy is reconciled after HTTPRoute deletion.""" + import pytest diff --git a/testsuite/tests/kuadrant/reconciliation/test_httproute_hosts.py b/testsuite/tests/kuadrant/reconciliation/test_httproute_hosts.py index b80c679c..ca985d2b 100644 --- a/testsuite/tests/kuadrant/reconciliation/test_httproute_hosts.py +++ b/testsuite/tests/kuadrant/reconciliation/test_httproute_hosts.py @@ -1,4 +1,5 @@ """Tests that HTTPRoute spec.hostnames changes are reconciled when changed.""" + import pytest diff --git a/testsuite/tests/kuadrant/reconciliation/test_httproute_matches.py b/testsuite/tests/kuadrant/reconciliation/test_httproute_matches.py index 85229b12..37ed7fe7 100644 --- a/testsuite/tests/kuadrant/reconciliation/test_httproute_matches.py +++ b/testsuite/tests/kuadrant/reconciliation/test_httproute_matches.py @@ -1,4 +1,5 @@ """Tests that HTTPRoute spec.routes.matches changes are reconciled when changed.""" + from testsuite.gateway import RouteMatch, PathMatch diff --git a/testsuite/tests/mgc/conftest.py b/testsuite/tests/mgc/conftest.py index ec599664..c3a7748f 100644 --- a/testsuite/tests/mgc/conftest.py +++ b/testsuite/tests/mgc/conftest.py @@ -1,4 +1,5 @@ """Conftest for MGC tests""" + import pytest from openshift import selector from weakget import weakget diff --git a/testsuite/tests/mgc/dnspolicy/conftest.py b/testsuite/tests/mgc/dnspolicy/conftest.py index 86a1495a..ab44f9f2 100644 --- a/testsuite/tests/mgc/dnspolicy/conftest.py +++ b/testsuite/tests/mgc/dnspolicy/conftest.py @@ -1,4 +1,5 @@ """Conftest for DNSPolicy tests""" + import pytest from testsuite.gateway.gateway_api.gateway import MGCGateway diff --git a/testsuite/tests/mgc/dnspolicy/health_check/conftest.py b/testsuite/tests/mgc/dnspolicy/health_check/conftest.py index 2135a2c6..fad38b1d 100644 --- a/testsuite/tests/mgc/dnspolicy/health_check/conftest.py +++ b/testsuite/tests/mgc/dnspolicy/health_check/conftest.py @@ -1,4 +1,5 @@ """Conftest for DNSPolicy health checks""" + import time import pytest diff --git a/testsuite/tests/mgc/dnspolicy/health_check/test_healthy_endpoint.py b/testsuite/tests/mgc/dnspolicy/health_check/test_healthy_endpoint.py index 4fe2ad05..e1fff42f 100644 --- a/testsuite/tests/mgc/dnspolicy/health_check/test_healthy_endpoint.py +++ b/testsuite/tests/mgc/dnspolicy/health_check/test_healthy_endpoint.py @@ -1,4 +1,5 @@ """Tests for DNSPolicy health checks - healthy endpoint""" + import pytest from testsuite.policy.dns_policy import HealthCheck diff --git a/testsuite/tests/mgc/dnspolicy/health_check/test_unhealthy_endpoint.py b/testsuite/tests/mgc/dnspolicy/health_check/test_unhealthy_endpoint.py index b5df3589..3139c409 100644 --- a/testsuite/tests/mgc/dnspolicy/health_check/test_unhealthy_endpoint.py +++ b/testsuite/tests/mgc/dnspolicy/health_check/test_unhealthy_endpoint.py @@ -1,4 +1,5 @@ """Tests for DNSPolicy health checks - unhealthy endpoint""" + import pytest from testsuite.policy.dns_policy import HealthCheck diff --git a/testsuite/tests/mgc/test_basic.py b/testsuite/tests/mgc/test_basic.py index a168b43f..15f78419 100644 --- a/testsuite/tests/mgc/test_basic.py +++ b/testsuite/tests/mgc/test_basic.py @@ -7,6 +7,7 @@ * gateway class "kuadrant-multi-cluster-gateway-instance-per-cluster" is created """ + import pytest pytestmark = [pytest.mark.mgc] diff --git a/testsuite/tests/mgc/tlspolicy/test_cert_parameters.py b/testsuite/tests/mgc/tlspolicy/test_cert_parameters.py index 0d633ede..8d905f9f 100644 --- a/testsuite/tests/mgc/tlspolicy/test_cert_parameters.py +++ b/testsuite/tests/mgc/tlspolicy/test_cert_parameters.py @@ -1,4 +1,5 @@ """Test parameters of TLS certificate generated by the TLSPolicy""" + from datetime import timedelta import pytest diff --git a/testsuite/utils.py b/testsuite/utils.py index f599b6cc..061327ee 100644 --- a/testsuite/utils.py +++ b/testsuite/utils.py @@ -1,4 +1,5 @@ """Utility functions for testsuite""" + import csv import enum import json