Skip to content

Commit 9c55ecc

Browse files
jdevera-hjun33k
authored andcommitted
Add test for multivalued option with text in command
1 parent 866551b commit 9c55ecc

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

test.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,13 @@ def test_two_text_sources_fails(self):
351351
self.assertEqual(err.exception.code, 2)
352352
self.assertIn("Input strings and --stdin cannot work together", cse.getvalue())
353353

354+
def test_multivalued_options_with_text(self):
355+
text = "the quick brown fox jumps over the lazy dog in a hurry"
356+
cli_args = "--stopwords the in a hurry -- {}".format(text).split()
357+
params = self.get_params_from_cli(*cli_args)
358+
self.assertEqual(params['text'], text)
359+
self.assertEqual(params['stopwords'], ['the', 'in', 'a', 'hurry'])
360+
354361

355362
if __name__ == '__main__':
356363
unittest.main()

0 commit comments

Comments
 (0)