Scale down Kubernetes deployments after work hours
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
691 B

import pytest
from kube_downscaler.cmd import check_include_resources
from kube_downscaler.cmd import get_parser
def test_parse_args():
parser = get_parser()
config = parser.parse_args(["--dry-run"])
assert config.dry_run
def test_check_include_resources():
assert check_include_resources("deployments,cronjobs") == "deployments,cronjobs"
def test_check_include_resources_invalid():
with pytest.raises(Exception) as excinfo:
assert (
"--include-resources argument should contain a subset of [cronjobs, deployments, horizontalpodautoscalers, stacks, statefulsets]"
in str(excinfo.value)