aboutsummaryrefslogtreecommitdiff
path: root/src/suites/path.py
diff options
context:
space:
mode:
authorCharles Cabergs <me@cacharle.xyz>2020-10-09 11:19:58 +0200
committerCharles Cabergs <me@cacharle.xyz>2020-10-09 11:19:58 +0200
commit84b23010e0d0515ad3ed17a605440e50439781e8 (patch)
tree2c71f2d4afbb7b0a8e9e128f1d1383f5637de88c /src/suites/path.py
parent5d1410a9b08eb8df82a43312b8b6d3d9c1c9eb00 (diff)
downloadminishell_test-84b23010e0d0515ad3ed17a605440e50439781e8.tar.gz
minishell_test-84b23010e0d0515ad3ed17a605440e50439781e8.tar.bz2
minishell_test-84b23010e0d0515ad3ed17a605440e50439781e8.zip
Formatting/Refactoring, Added pretty ascii art
Diffstat (limited to 'src/suites/path.py')
-rw-r--r--src/suites/path.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/suites/path.py b/src/suites/path.py
index 13866de..5ac25ae 100644
--- a/src/suites/path.py
+++ b/src/suites/path.py
@@ -6,7 +6,7 @@
# By: charles <me@cacharle.xyz> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2020/09/09 15:12:58 by charles #+# #+# #
-# Updated: 2020/10/08 08:41:38 by cacharle ### ########.fr #
+# Updated: 2020/10/09 11:00:46 by cacharle ### ########.fr #
# #
# ############################################################################ #
@@ -19,9 +19,9 @@ from suite import suite
def suite_path(test):
""" searching a command in the path tests """
whoami_path = distutils.spawn.find_executable("which")
- mode_fmt = ("mkdir path && cp " +
- whoami_path +
- " ./path/a && chmod {} ./path/a")
+ mode_fmt = ("mkdir path && cp "
+ + whoami_path
+ + " ./path/a && chmod {} ./path/a")
test("a", setup=mode_fmt.format("000"), exports={"PATH": "path"})
test("a", setup=mode_fmt.format("001"), exports={"PATH": "path"})
test("a", setup=mode_fmt.format("002"), exports={"PATH": "path"})
@@ -66,13 +66,13 @@ def suite_path(test):
test("a", setup=mode_fmt.format("6777"), exports={"PATH": "path"})
test("a", setup=mode_fmt.format("7777"), exports={"PATH": "path"})
test("a", setup=mode_fmt.format("0000"), exports={"PATH": "path"})
- test("b", setup="mkdir path && cp " + whoami_path + " ./path/a && ln -s ./path/a ./path/b",
- exports={"PATH": "path"})
+ # test("b", setup="mkdir path && cp " + whoami_path + " ./path/a && ln -s ./path/a ./path/b",
+ # exports={"PATH": "path"})
test("b", setup="mkdir path && ln -s " + whoami_path + " ./path/b", exports={"PATH": "path"})
test("a", setup="mkdir path && mkfifo path/a")
test("a", setup="mkdir path && mkfifo path/a && chmod 777 path/a")
- test("a", setup="mkdir path1 path2 && cp " + whoami_path + " path1/a"
- "&& cp " + whoami_path + " path2/a && chmod 000 path1/a", exports={"PATH": "path1:path2"})
+ # test("a", setup="mkdir path1 path2 && cp " + whoami_path + " path1/a"
+ # "&& cp " + whoami_path + " path2/a && chmod 000 path1/a", exports={"PATH": "path1:path2"})
test("a", setup="mkdir path1 path2 && cp " + whoami_path + " path1/a"
"&& cp " + whoami_path + " path2/a && chmod 000 path1/a", exports={"PATH": "path2:path1"})
@@ -106,6 +106,7 @@ def suite_path_variable(test):
test("whoami", exports={"PATH": " /sbin "})
test("whoami", exports={"PATH": "/sbin:/sbin:/sbin:/sbin"})
test("whoami", exports={"PATH": ""}) # error message explicit enough
+ test("unset PATH; whoami") # error message explicit enough
test("whoami", exports={"PATH": ":"})
test("whoami", exports={"PATH": ":::::::::::::::::::"})
test("whoami", exports={"PATH": "/asdfasdf"})