summaryrefslogtreecommitdiff
path: root/tests/test_commands.py
diff options
context:
space:
mode:
authorElena ``of Valhalla'' Grandi <valhalla@trueelena.org>2021-12-24 10:16:36 +0100
committerElena ``of Valhalla'' Grandi <valhalla@trueelena.org>2021-12-24 10:16:41 +0100
commitd9665cab55078aa6e0c6ca4dce4a2c7ea8c4177d (patch)
tree9cb0afaa480fef995a19e46672ad198a7512e0f1 /tests/test_commands.py
parent0e4924ebca62b6767639aad773816a62c6a3c9af (diff)
Add support for search_aliases in the settings file.
Refs: https://todo.sr.ht/~valhalla/lesana/11
Diffstat (limited to 'tests/test_commands.py')
-rw-r--r--tests/test_commands.py18
1 files changed, 18 insertions, 0 deletions
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()