From 32f7a16e8e668c0cd473846db9c3efa9651b30d5 Mon Sep 17 00:00:00 2001 From: FrantzT Date: Tue, 28 Jul 2020 18:33:49 -0400 Subject: [PATCH] Update test_cronjob.py Fixing review issues. --- tests/k8s/test_cronjob.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/tests/k8s/test_cronjob.py b/tests/k8s/test_cronjob.py index ef66050..8425899 100644 --- a/tests/k8s/test_cronjob.py +++ b/tests/k8s/test_cronjob.py @@ -21,9 +21,9 @@ from k8s.client import NotFound from k8s.models.common import ObjectMeta -from k8s.models.cronjob import CronJob -from k8s.models.job import Job, JobSpec -from k8s.models.pod import Container, LocalObjectReference, PodTemplateSpec, PodSpec +from k8s.models.cronjob import CronJob, CronJobSpec +from k8s.models.job import JobSpec, JobTemplateSpec +from k8s.models.pod import Container, PodTemplateSpec, PodSpec NAME = "my-name" @@ -39,7 +39,7 @@ def test_create_blank_job(self): def test_created_if_not_exists(self, post, api_get): api_get.side_effect = NotFound() - cronjob = _create_default_job() + cronjob = _create_default_cronjob() call_params = cronjob.as_dict() post.return_value.json.return_value = call_params @@ -49,9 +49,8 @@ def test_created_if_not_exists(self, post, api_get): pytest.helpers.assert_any_call(post, _uri(NAMESPACE), call_params) - + def _create_default_cronjob(): - labels = {"test": "true"} object_meta = ObjectMeta(name=NAME, namespace=NAMESPACE) container = Container( name="container",