@@ -518,8 +518,7 @@ def get(url, version, **kwargs):
518518 ORIGINAL_REPLICAS_ANNOTATION
519519 ]
520520
521-
522- def test_scaler_upscale_on_exclude (monkeypatch ):
521+ def test_scaler_no_upscale_on_exclude (monkeypatch ):
523522 api = MagicMock ()
524523 monkeypatch .setattr (
525524 "kube_downscaler.scaler.helper.get_kube_api" , MagicMock (return_value = api )
@@ -575,18 +574,9 @@ def get(url, version, **kwargs):
575574 enable_events = False ,
576575 )
577576
578- assert api .patch .call_count == 1
579- assert api .patch .call_args [1 ]["url" ] == "/deployments/deploy-1"
580- assert (
581- json .loads (api .patch .call_args [1 ]["data" ])["spec" ]["replicas" ]
582- == ORIGINAL_REPLICAS
583- )
584- assert not json .loads (api .patch .call_args [1 ]["data" ])["metadata" ]["annotations" ][
585- ORIGINAL_REPLICAS_ANNOTATION
586- ]
587-
577+ assert api .patch .call_count == 0
588578
589- def test_scaler_upscale_on_exclude_namespace (monkeypatch ):
579+ def test_scaler_no_upscale_on_exclude_namespace (monkeypatch ):
590580 api = MagicMock ()
591581 monkeypatch .setattr (
592582 "kube_downscaler.scaler.helper.get_kube_api" , MagicMock (return_value = api )
@@ -641,16 +631,7 @@ def get(url, version, **kwargs):
641631 enable_events = False ,
642632 )
643633
644- assert api .patch .call_count == 1
645- assert api .patch .call_args [1 ]["url" ] == "/deployments/deploy-1"
646- assert (
647- json .loads (api .patch .call_args [1 ]["data" ])["spec" ]["replicas" ]
648- == ORIGINAL_REPLICAS
649- )
650- assert not json .loads (api .patch .call_args [1 ]["data" ])["metadata" ]["annotations" ][
651- ORIGINAL_REPLICAS_ANNOTATION
652- ]
653-
634+ assert api .patch .call_count == 0
654635
655636def test_scaler_always_upscale (monkeypatch ):
656637 api = MagicMock ()
0 commit comments