diff options
author | Jacobo de Vera <jacobo.devera@hotjar.com> | 2020-03-15 15:03:05 +0000 |
---|---|---|
committer | Val Neekman <un33kvu@gmail.com> | 2020-04-09 11:41:41 -0400 |
commit | 9c55ecc51447ce4d742d0d3fdf7a165ef99339a7 (patch) | |
tree | c39605a0037e933575e93ab307140e8b8a5c79b9 | |
parent | 866551b09cc0de12fde216bf836a289cc397e7c0 (diff) | |
download | python-slugify-9c55ecc51447ce4d742d0d3fdf7a165ef99339a7.tar.gz |
Add test for multivalued option with text in command
-rw-r--r-- | test.py | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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() |