diff --git a/charms/gnocchi-k8s/tests/unit/test_charm.py b/charms/gnocchi-k8s/tests/unit/test_charm.py index a52ccfaf..2d5da5cc 100644 --- a/charms/gnocchi-k8s/tests/unit/test_charm.py +++ b/charms/gnocchi-k8s/tests/unit/test_charm.py @@ -17,6 +17,9 @@ """Tests for gnocchi charm.""" import ops_sunbeam.test_utils as test_utils +from mock import ( + patch, +) import charm @@ -49,6 +52,10 @@ class TestGnocchiCephOperatorCharm(test_utils.CharmTestCase): self.harness = test_utils.get_harness( _GnocchiCephOperatorCharm, 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 TestGnocchiCephOperatorCharm(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/gnocchi-k8s/tox.ini b/charms/gnocchi-k8s/tox.ini index 0bc536c1..067963f9 100644 --- a/charms/gnocchi-k8s/tox.ini +++ b/charms/gnocchi-k8s/tox.ini @@ -72,6 +72,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}