]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/pybind/mgr/dashboard/tests/test_prometheus.py
import 15.2.0 Octopus source
[ceph.git] / ceph / src / pybind / mgr / dashboard / tests / test_prometheus.py
index 73dedbab843e1cd5bcf8c40e65d3411fa7f23b50..3385d66a974e4f559d27baa82bfc16846c5451f9 100644 (file)
@@ -1,6 +1,9 @@
 # -*- coding: utf-8 -*-
 # pylint: disable=protected-access
-from mock import patch
+try:
+    from mock import patch
+except ImportError:
+    from unittest.mock import patch
 
 from . import ControllerTestCase
 from .. import mgr
@@ -125,4 +128,4 @@ class PrometheusControllerTest(ControllerTestCase):
         self._get('/api/prometheus/notifications?from=' + next_to_last['id'])
         forelast = PrometheusReceiver.notifications[1]
         last = PrometheusReceiver.notifications[2]
-        self.assertEqual(self.jsonBody(), [forelast, last])
+        self.assertEqual(self.json_body(), [forelast, last])