From fe221df55fde6e55e100267be5641dc638417ce5 Mon Sep 17 00:00:00 2001 From: okozachenko Date: Tue, 12 May 2020 01:28:39 +0300 Subject: [PATCH] Add a unit test to confirm if the manifest does not specify a namespace Change-Id: I75f341aac9ef989e79704249ed2a2c545616bc4d --- openstack_operator/tests/unit/base.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/openstack_operator/tests/unit/base.py b/openstack_operator/tests/unit/base.py index 28ebff31..4a3de112 100644 --- a/openstack_operator/tests/unit/base.py +++ b/openstack_operator/tests/unit/base.py @@ -46,6 +46,10 @@ class KubernetesObjectTestCase(testtools.TestCase): cls.object = utils.render_template(cls.TEMPLATE_FILE, name=name, spec=spec) + def test_metadata_has_no_namespace(self): + """Ensure that the metadata does not specify the namespace.""" + self.assertNotIn("namespace", self.object["metadata"]) + class KubernetesAppTestCaseMixin: """Mix-in to be used for tests that involve apps and containers."""