aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_taskipy.py
diff options
context:
space:
mode:
authorRoy Sommer <illBeRoy@users.noreply.github.com>2020-03-21 01:11:44 +0200
committerGitHub <noreply@github.com>2020-03-21 01:11:44 +0200
commitcae9e34aed733cde4cdf9d62dddfe6ee08e564c4 (patch)
treeaadcb9f0f8d9f45f7db0b134bb80d52032e14b1c /tests/test_taskipy.py
parentRelease version 1.2.0 (diff)
downloadtaskipy2-cae9e34aed733cde4cdf9d62dddfe6ee08e564c4.zip
Passed Arguments Are Escaped Properly (#12)
passed arguments are now escaped properly. can pass arguments with spaces.
Diffstat (limited to 'tests/test_taskipy.py')
-rw-r--r--tests/test_taskipy.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/test_taskipy.py b/tests/test_taskipy.py
index 1764504..78c2e10 100644
--- a/tests/test_taskipy.py
+++ b/tests/test_taskipy.py
@@ -145,6 +145,15 @@ class PassArgumentsTestCase(TaskipyTestCase):
self.assertSubstr(f'the argument count is 5', stdout)
self.assertEqual(exit_code, 0)
+ def test_running_task_with_arguments_with_spaces(self):
+ cwd = self.create_test_dir_from_fixture('project_with_task_that_checks_args_passed_with_spaces')
+ name = 'Roy Sommer'
+ age = random.randrange(1, 100)
+ exit_code, stdout, _ = self.run_task('identify', args=['--full-name', name, '--age', f'{age}'], cwd=cwd)
+
+ self.assertSubstr(f'name: {name} age: {age}', stdout)
+ self.assertEqual(exit_code, 0)
+
def test_running_task_arguments_not_passed_to_pre_hook(self):
cwd = self.create_test_dir_from_fixture('project_with_tasks_that_accept_arguments')
some_random_number = random.randint(1, 1000)