From 2624f6d95748057eaa49cb910335958a30c308bd Mon Sep 17 00:00:00 2001 From: hejunli Date: Mon, 14 Nov 2022 17:29:16 +0800 Subject: [PATCH] Supplement a unit test case for 'typical_logs'. Change-Id: Id08cbd3d5a713b5d5f86ef007f06a1694d3fcca0 --- venus/tests/unit/api/test_search_action.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/venus/tests/unit/api/test_search_action.py b/venus/tests/unit/api/test_search_action.py index aa9db4e..3051f9d 100644 --- a/venus/tests/unit/api/test_search_action.py +++ b/venus/tests/unit/api/test_search_action.py @@ -574,6 +574,14 @@ class TestSearchAction(unittest.TestCase): 'interval_en': '30minutes'}} self.assertEqual(expected, result) + def test_typical_logs_invalid_param(self): + action = SearchCore() + expected = {"code": -1, "msg": "invalid param"} + result = action.typical_logs('', '', '') + self.assertEqual(expected, result) + result = action.typical_logs(None, '', '') + self.assertEqual(expected, result) + def test_typical_logs_no_index(self): action = SearchCore() expected = {"code": 0, "msg": "no data, no index"}