From d9665cab55078aa6e0c6ca4dce4a2c7ea8c4177d Mon Sep 17 00:00:00 2001 From: Elena ``of Valhalla'' Grandi Date: Fri, 24 Dec 2021 10:16:36 +0100 Subject: Add support for search_aliases in the settings file. Refs: https://todo.sr.ht/~valhalla/lesana/11 --- tests/test_commands.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'tests/test_commands.py') diff --git a/tests/test_commands.py b/tests/test_commands.py index 1a7d83b..91a8894 100644 --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -115,6 +115,7 @@ class testCommandsSimple(unittest.TestCase, CommandsMixin): 'offset': None, 'pagesize': None, 'sort': None, + 'expand_query_template': False, 'all': False, } streams = self._run_command(command.Search(), args) @@ -205,6 +206,23 @@ class testCommandsComplex(unittest.TestCase, CommandsMixin): self.assertIn('this: 1', streams['stdout'].getvalue()) self.assertEqual(streams['stderr'].getvalue(), '') + def test_search_template(self): + args = { + 'collection': self.tmpdir.name, + 'git': True, + 'template': False, + 'query': '{{ nice }}', + 'expand_query_template': True, + 'offset': None, + 'pagesize': None, + 'sort': None, + 'all': False, + } + streams = self._run_command(command.Search(), args) + self.assertIn('8e9fa1ed', streams['stdout'].getvalue()) + self.assertIn('5084bc6e', streams['stdout'].getvalue()) + self.assertEqual(streams['stderr'].getvalue(), '') + if __name__ == '__main__': unittest.main() -- cgit v1.2.3