From e16dcbd9899fc4ff0178dc33b6138a126f8c49f2 Mon Sep 17 00:00:00 2001 From: hejunli Date: Fri, 8 Jul 2022 19:20:56 +0800 Subject: [PATCH] Add a test cases for unit tests Add a test case to 'generate_must' so that if there are lowercase characters in the input, it will be uppercase in the output. Change-Id: I50443af0aa040cee228b539dbea2ba4b990e7d73 --- venus/tests/unit/api/test_search_action.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/venus/tests/unit/api/test_search_action.py b/venus/tests/unit/api/test_search_action.py index 63e3790..bfbb10c 100644 --- a/venus/tests/unit/api/test_search_action.py +++ b/venus/tests/unit/api/test_search_action.py @@ -219,6 +219,12 @@ class TestSearchAction(unittest.TestCase): expected = {'code': 1, 'msg': 'OK', "values": ['val1', 'val2']} self.assertEqual(expected, result) + def test_generate_must_upper(self): + action = SearchCore() + result = action.generate_must({'log_level.keyword': 'test'}) + expected = [{'terms': {'log_level.keyword': ['test', 'TEST']}}] + self.assertEqual(expected, result) + def test_generate_must_not(self): action = SearchCore() result = action.generate_must_not({'log_level.keyword':