diff --git a/venus/tests/unit/api/test_search_controller.py b/venus/tests/unit/api/test_search_controller.py index 7c33d00..dd2fcfa 100644 --- a/venus/tests/unit/api/test_search_controller.py +++ b/venus/tests/unit/api/test_search_controller.py @@ -103,3 +103,12 @@ class TestSearchController(unittest.TestCase): req = fakes.HTTPRequest.blank('?type=None') res1 = self.controller.search_typical_logs(req) self.assertEqual(ret, res1) + + @mock.patch('venus.modules.search.action.SearchCore.typical_logs') + def test_search_typical_logs_no_index(self, action_typical_logs): + ret = {"code": 0, "msg": "no data, no index"} + action_typical_logs.return_value = ret + req = fakes.HTTPRequest.blank('?type=error_stats?start_time=2&' + '?end_time=1') + res1 = self.controller.search_typical_logs(req) + self.assertEqual(ret, res1)