summaryrefslogtreecommitdiff
path: root/tests/pyscript/recursive.py
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2019-07-23 21:00:32 -0400
committerKevin Van Brunt <kmvanbrunt@gmail.com>2019-07-23 21:00:32 -0400
commit99ec5265e2e80ecca1252670657c50693da5254a (patch)
treed06e75c15a981ee23e5a95f8c2bbbe694ea5c08c /tests/pyscript/recursive.py
parent5b8c80921a720122fc4e7f723ea712c640125412 (diff)
downloadcmd2-git-99ec5265e2e80ecca1252670657c50693da5254a.tar.gz
Fixed issue where run_pyscript failed if the script's filename had a space
Diffstat (limited to 'tests/pyscript/recursive.py')
-rw-r--r--tests/pyscript/recursive.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/pyscript/recursive.py b/tests/pyscript/recursive.py
new file mode 100644
index 00000000..21550592
--- /dev/null
+++ b/tests/pyscript/recursive.py
@@ -0,0 +1,11 @@
+#!/usr/bin/env python
+# coding=utf-8
+# flake8: noqa F821
+"""
+Example demonstrating that calling run_pyscript recursively inside another Python script isn't allowed
+"""
+import os
+
+app.cmd_echo = True
+my_dir = (os.path.dirname(os.path.realpath(sys.argv[0])))
+app('run_pyscript {}'.format(os.path.join(my_dir, 'stop.py')))