as final step we now can do system piping. fixes #50

This commit is contained in:
Edwin Eefting
2021-05-09 14:03:57 +02:00
parent 0ce3bf1297
commit 171f0ac5ad
3 changed files with 25 additions and 12 deletions

View File

@ -28,7 +28,7 @@ class TestExecuteNode(unittest2.TestCase):
#escaping test
with self.subTest("escape test"):
s="><`'\"@&$()$bla\\/.* !#test _+-={}[]| ${bla} $bla"
s="><`'\"@&$()$bla\\/.* !#test _+-={}[]|${bla} $bla"
self.assertEqual(node.run(["echo",s]), [s])
#return std err as well, trigger stderr by listing something non existing
@ -51,6 +51,15 @@ class TestExecuteNode(unittest2.TestCase):
with self.subTest("stdin process with inp=None (shouldn't hang)"):
self.assertEqual(node.run(["cat"]), [])
# let the system do the piping with an unescaped |:
with self.subTest("system piping test"):
#first make sure the actual | character is still properly escaped:
self.assertEqual(node.run(["echo","|"]), ["|"])
#now pipe
self.assertEqual(node.run(["echo", "abc", node.PIPE, "tr", "a", "A" ]), ["Abc"])
def test_basics_local(self):
node=ExecuteNode(debug_output=True)
self.basics(node)