diff --git a/charms/glance-k8s/tests/unit/test_glance_charm.py b/charms/glance-k8s/tests/unit/test_glance_charm.py index 257c21f1..3cd6887c 100644 --- a/charms/glance-k8s/tests/unit/test_glance_charm.py +++ b/charms/glance-k8s/tests/unit/test_glance_charm.py @@ -17,6 +17,9 @@ """Tests for glance charm.""" import ops_sunbeam.test_utils as test_utils +from mock import ( + patch, +) import charm @@ -49,6 +52,10 @@ class TestGlanceOperatorCharm(test_utils.CharmTestCase): self.harness = test_utils.get_harness( _GlanceOperatorCharm, container_calls=self.container_calls ) + mock_get_platform = patch( + "charmhelpers.osplatform.get_platform", return_value="ubuntu" + ) + mock_get_platform.start() # clean up events that were dynamically defined, # otherwise we get issues because they'll be redefined, @@ -67,6 +74,7 @@ class TestGlanceOperatorCharm(test_utils.CharmTestCase): except AttributeError: pass + self.addCleanup(mock_get_platform.stop) self.addCleanup(self.harness.cleanup) test_utils.add_complete_ingress_relation(self.harness) diff --git a/charms/glance-k8s/tox.ini b/charms/glance-k8s/tox.ini index 9606489f..a411adb3 100644 --- a/charms/glance-k8s/tox.ini +++ b/charms/glance-k8s/tox.ini @@ -75,6 +75,10 @@ deps = {[testenv:py3]deps} basepython = python3.10 deps = {[testenv:py3]deps} +[testenv:py311] +basepython = python3.11 +deps = {[testenv:py3]deps} + [testenv:cover] basepython = python3 deps = {[testenv:py3]deps}