From c81336f0692b89272c0453ad48c27a4651035ff0 Mon Sep 17 00:00:00 2001 From: hejunli Date: Mon, 14 Nov 2022 19:10:13 +0800 Subject: [PATCH] Supplement a test case for instance_call_chain. Change-Id: I114d9ff410d65280b604c5a3dbc9fb90dc000106 --- venus/tests/unit/api/test_search_controller.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/venus/tests/unit/api/test_search_controller.py b/venus/tests/unit/api/test_search_controller.py index dd2fcfa..1f5965c 100644 --- a/venus/tests/unit/api/test_search_controller.py +++ b/venus/tests/unit/api/test_search_controller.py @@ -112,3 +112,12 @@ class TestSearchController(unittest.TestCase): '?end_time=1') res1 = self.controller.search_typical_logs(req) self.assertEqual(ret, res1) + + @mock.patch('venus.modules.search.action.SearchCore.instance_call_chain') + def test_search_instance_call_chain_no_index(self, + action_instance_call_chain): + ret = {"code": 0, "msg": "no data, no index"} + action_instance_call_chain.return_value = ret + req = fakes.HTTPRequest.blank('?request_id=test&?uuid=test') + res1 = self.controller.instance_call_chain(req) + self.assertEqual(ret, res1)