From d4ef1de57992fa43f3d161ca44539f09db5590bd Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 17 Jul 2023 17:13:33 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- platform_disk_api/kube_client.py | 4 ++-- tests/integration/auth.py | 1 + tests/integration/test_usage_watcher.py | 1 + tests/unit/test_pvc.py | 12 ++++++------ 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/platform_disk_api/kube_client.py b/platform_disk_api/kube_client.py index 400c238..7eb2c0e 100644 --- a/platform_disk_api/kube_client.py +++ b/platform_disk_api/kube_client.py @@ -155,8 +155,8 @@ def from_primitive(cls, payload: dict[str, Any]) -> "PersistentVolumeClaimRead": payload["spec"]["resources"]["requests"]["storage"] ), storage_real=storage_real, - labels=payload["metadata"].get("labels", dict()), - annotations=payload["metadata"].get("annotations", dict()), + labels=payload["metadata"].get("labels", {}), + annotations=payload["metadata"].get("annotations", {}), ) diff --git a/tests/integration/auth.py b/tests/integration/auth.py index fb660c9..fbd9205 100644 --- a/tests/integration/auth.py +++ b/tests/integration/auth.py @@ -14,6 +14,7 @@ from yarl import URL from platform_disk_api.config import AuthConfig + from tests.integration.conftest import random_name diff --git a/tests/integration/test_usage_watcher.py b/tests/integration/test_usage_watcher.py index bfd191b..367976c 100644 --- a/tests/integration/test_usage_watcher.py +++ b/tests/integration/test_usage_watcher.py @@ -13,6 +13,7 @@ watch_disk_usage, watch_lifespan_ended, ) + from tests.integration.kube import KubeClientForTest diff --git a/tests/unit/test_pvc.py b/tests/unit/test_pvc.py index 92ec958..84cd5c3 100644 --- a/tests/unit/test_pvc.py +++ b/tests/unit/test_pvc.py @@ -90,8 +90,8 @@ def test_pvc_from_primitive_pending( phase=PersistentVolumeClaimRead.Phase.PENDING, storage_requested=storage, storage_real=None, - labels=dict(), - annotations=dict(), + labels={}, + annotations={}, ) @pytest.mark.parametrize( @@ -157,8 +157,8 @@ def test_pvc_from_primitive_bound( phase=PersistentVolumeClaimRead.Phase.BOUND, storage_requested=storage, storage_real=2 * storage, - labels=dict(), - annotations=dict(), + labels={}, + annotations={}, ) @pytest.mark.parametrize("name,storage_class,storage", [("test", "test-stor", 100)]) @@ -186,7 +186,7 @@ def test_pvc_from_primitive_with_labels( storage_requested=storage, storage_real=2 * storage, labels=dict(foo="bar"), - annotations=dict(), + annotations={}, ) @pytest.mark.parametrize("name,storage_class,storage", [("test", "test-stor", 100)]) @@ -213,6 +213,6 @@ def test_pvc_from_primitive_with_annotations( phase=PersistentVolumeClaimRead.Phase.BOUND, storage_requested=storage, storage_real=2 * storage, - labels=dict(), + labels={}, annotations=dict(foo="bar"), )