summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacobo de Vera <jacobo.devera@hotjar.com>2020-03-15 15:03:05 +0000
committerVal Neekman <un33kvu@gmail.com>2020-04-09 11:41:41 -0400
commit9c55ecc51447ce4d742d0d3fdf7a165ef99339a7 (patch)
treec39605a0037e933575e93ab307140e8b8a5c79b9
parent866551b09cc0de12fde216bf836a289cc397e7c0 (diff)
downloadpython-slugify-9c55ecc51447ce4d742d0d3fdf7a165ef99339a7.tar.gz
Add test for multivalued option with text in command
-rw-r--r--test.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/test.py b/test.py
index 2433256..ddf1bf4 100644
--- a/test.py
+++ b/test.py
@@ -351,6 +351,13 @@ class TestCommandParams(unittest.TestCase):
self.assertEqual(err.exception.code, 2)
self.assertIn("Input strings and --stdin cannot work together", cse.getvalue())
+ def test_multivalued_options_with_text(self):
+ text = "the quick brown fox jumps over the lazy dog in a hurry"
+ cli_args = "--stopwords the in a hurry -- {}".format(text).split()
+ params = self.get_params_from_cli(*cli_args)
+ self.assertEqual(params['text'], text)
+ self.assertEqual(params['stopwords'], ['the', 'in', 'a', 'hurry'])
+
if __name__ == '__main__':
unittest.main()