summaryrefslogtreecommitdiffstats
path: root/test/t/test_umount.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:03:18 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:03:18 +0000
commitf4acb49ea148cdd899f7f29f1591c7bc853c2135 (patch)
treeb62d60873864065d6428a84a119dd8a3c90f1397 /test/t/test_umount.py
parentAdding upstream version 1:2.11. (diff)
downloadbash-completion-f4acb49ea148cdd899f7f29f1591c7bc853c2135.tar.xz
bash-completion-f4acb49ea148cdd899f7f29f1591c7bc853c2135.zip
Adding upstream version 1:2.12.0.upstream/1%2.12.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test/t/test_umount.py')
-rw-r--r--test/t/test_umount.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/test/t/test_umount.py b/test/t/test_umount.py
index 2baf0da..de18835 100644
--- a/test/t/test_umount.py
+++ b/test/t/test_umount.py
@@ -1,3 +1,5 @@
+import sys
+
import pytest
from conftest import assert_bash_exec
@@ -11,12 +13,14 @@ class TestUmount:
(correctly) uses absolute paths. So we create a custom completion which
reads from a file in our text fixture instead.
"""
+ if sys.platform != "linux":
+ pytest.skip("Linux specific")
assert_bash_exec(bash, "unset COMPREPLY cur; unset -f _mnt_completion")
assert_bash_exec(
bash,
"_mnt_completion() { "
- "local cur=$(_get_cword); "
- "_linux_fstab $(_get_pword) < mount/test-fstab; "
+ "local cur prev;_comp_get_words cur prev; "
+ '_comp_cmd_umount__linux_fstab "$prev" < mount/test-fstab; '
"} && complete -F _mnt_completion _mnt",
)
request.addfinalizer(
@@ -75,9 +79,10 @@ class TestUmount:
def test_mnt_label_quote(self, completion, dummy_mnt):
assert completion == r"ian-it\'s\ awesome"
+ @pytest.mark.skipif(sys.platform != "linux", reason="Linux specific")
def test_linux_fstab_unescape(self, bash):
assert_bash_exec(bash, r"var=one\'two\\040three\\")
- assert_bash_exec(bash, "__linux_fstab_unescape var")
+ assert_bash_exec(bash, "_comp_cmd_umount__linux_fstab_unescape var")
output = assert_bash_exec(
bash, r'printf "%s\n" "$var"', want_output=True
)