Add a test case for search_typical_logs.
Change-Id: Iba60ae595f64dce9ea3422e1e1249b5e6922655b
This commit is contained in:
@@ -95,3 +95,11 @@ class TestSearchController(unittest.TestCase):
|
||||
'?end_time=1')
|
||||
res1 = self.controller.search_analyse_logs(req)
|
||||
self.assertEqual(ret, res1)
|
||||
|
||||
@mock.patch('venus.modules.search.action.SearchCore.typical_logs')
|
||||
def test_search_typical_logs_invalid_param(self, action_typical_logs):
|
||||
ret = {"code": -1, "msg": "invalid param"}
|
||||
action_typical_logs.return_value = ret
|
||||
req = fakes.HTTPRequest.blank('?type=None')
|
||||
res1 = self.controller.search_typical_logs(req)
|
||||
self.assertEqual(ret, res1)
|
||||
|
||||
Reference in New Issue
Block a user