user/bash-completion: multiple test failures
See !497 (closed).
Found on ppc64:
============================================================================================================================= test session starts ==============================================================================================================================
platform linux -- Python 3.10.1, pytest-6.2.5, py-1.11.0, pluggy-0.13.1
rootdir: /root/packages/user/bash-completion/src/bash-completion-2.11/test, configfile: setup.cfg
collected 1607 items
...
test_aclocal.py Fs
...
test_ifdown.py F.
...
test_ifup.py Fs.
...
test_service.py F
...
test_xmlwf.py .F
...
unit/test_unit_expand.py ..FF
unit/test_unit_expand_tilde_by_ref.py ...F.F.F.F.F...
self = <test_aclocal.TestAclocal object at 0x3fff86cd46d0>, completion = <CompletionResult []>
@pytest.mark.complete("aclocal ")
def test_1(self, completion):
> assert completion
E assert <CompletionResult []>
/root/packages/user/bash-completion/src/bash-completion-2.11/test/t/test_aclocal.py:7: AssertionError
self = <test_ifdown.TestIfdown object at 0x3fff8647b610>, completion = <CompletionResult []>
@pytest.mark.xfail(in_container(), reason="Probably fails in a container")
@pytest.mark.complete("ifdown ")
def test_1(self, completion):
> assert completion
E assert <CompletionResult []>
/root/packages/user/bash-completion/src/bash-completion-2.11/test/t/test_ifdown.py:10: AssertionError
self = <test_ifup.TestIfup object at 0x3fff86479ab0>, completion = <CompletionResult []>
@pytest.mark.xfail(in_container(), reason="Probably fails in a container")
@pytest.mark.complete("ifup ")
def test_1(self, completion):
> assert completion
E assert <CompletionResult []>
/root/packages/user/bash-completion/src/bash-completion-2.11/test/t/test_ifup.py:10: AssertionError
self = <test_service.TestService object at 0x3fff85cce5f0>, completion = <CompletionResult []>
@pytest.mark.complete("service ")
def test_1(self, completion):
> assert completion
E assert <CompletionResult []>
/root/packages/user/bash-completion/src/bash-completion-2.11/test/t/test_service.py:7: AssertionError
self = <test_xmlwf.TestXmlwf object at 0x3fff8588aad0>, completion = <CompletionResult []>
@pytest.mark.complete("xmlwf -", require_cmd=True)
def test_2(self, completion):
> assert completion
E assert <CompletionResult []>
/root/packages/user/bash-completion/src/bash-completion-2.11/test/t/test_xmlwf.py:11: AssertionError
self = <test_unit_expand.TestUnitExpand object at 0x3fff8591d150>, bash = <pexpect.pty_spawn.spawn object at 0x3fff8591d420>, user_home = ('builder', '/root')
def test_user_home_compreply(self, bash, user_home):
user, home = user_home
output = assert_bash_exec(
bash,
r'cur="~%s"; _expand; printf "%%s\n" "$COMPREPLY"' % user,
want_output=True,
)
> assert output.strip() == home
E AssertionError: assert '/home/builder' == '/root'
E - /root
E + /home/builder
/root/packages/user/bash-completion/src/bash-completion-2.11/test/t/unit/test_unit_expand.py:22: AssertionError
self = <test_unit_expand.TestUnitExpand object at 0x3fff8591eaa0>, bash = <pexpect.pty_spawn.spawn object at 0x3fff8591d420>, user_home = ('builder', '/root')
def test_user_home_cur(self, bash, user_home):
user, home = user_home
output = assert_bash_exec(
bash,
r'cur="~%s/a"; _expand; printf "%%s\n" "$cur"' % user,
want_output=True,
)
> assert output.strip() == "%s/a" % home
E AssertionError: assert '/home/builder/a' == '/root/a'
E - /root/a
E + /home/builder/a
/root/packages/user/bash-completion/src/bash-completion-2.11/test/t/unit/test_unit_expand.py:31: AssertionError
self = <test_unit_expand_tilde_by_ref.TestUnitExpandTildeByRef object at 0x3fff8591ec80>, bash = <pexpect.pty_spawn.spawn object at 0x3fff8591db10>, user_home = ('builder', '/root'), plain_tilde = False, suffix_expanded = ('', True)
@pytest.mark.parametrize("plain_tilde", (True, False))
@pytest.mark.parametrize(
"suffix_expanded",
(
("", True),
("/foo", True),
(r"/\$HOME", True),
("/a b", True),
("/*", True),
(";echo hello", False),
("/a;echo hello", True),
),
)
def test_expand(self, bash, user_home, plain_tilde, suffix_expanded):
user, home = user_home
suffix, expanded = suffix_expanded
if plain_tilde:
user = ""
if not suffix or not expanded:
home = "~"
elif not expanded:
home = "~%s" % user
output = assert_bash_exec(
bash,
r'var="~%s%s"; __expand_tilde_by_ref var; printf "%%s\n" "$var"'
% (user, suffix),
want_output=True,
)
> assert output.strip() == "%s%s" % (home, suffix.replace(r"\$", "$"),)
E AssertionError: assert '/home/builder' == '/root'
E - /root
E + /home/builder
/root/packages/user/bash-completion/src/bash-completion-2.11/test/t/unit/test_unit_expand_tilde_by_ref.py:46: AssertionError
self = <test_unit_expand_tilde_by_ref.TestUnitExpandTildeByRef object at 0x3fff8591eb90>, bash = <pexpect.pty_spawn.spawn object at 0x3fff8591db10>, user_home = ('builder', '/root'), plain_tilde = False, suffix_expanded = ('/foo', True)
@pytest.mark.parametrize("plain_tilde", (True, False))
@pytest.mark.parametrize(
"suffix_expanded",
(
("", True),
("/foo", True),
(r"/\$HOME", True),
("/a b", True),
("/*", True),
(";echo hello", False),
("/a;echo hello", True),
),
)
def test_expand(self, bash, user_home, plain_tilde, suffix_expanded):
user, home = user_home
suffix, expanded = suffix_expanded
if plain_tilde:
user = ""
if not suffix or not expanded:
home = "~"
elif not expanded:
home = "~%s" % user
output = assert_bash_exec(
bash,
r'var="~%s%s"; __expand_tilde_by_ref var; printf "%%s\n" "$var"'
% (user, suffix),
want_output=True,
)
> assert output.strip() == "%s%s" % (home, suffix.replace(r"\$", "$"),)
E AssertionError: assert '/home/builder/foo' == '/root/foo'
E - /root/foo
E + /home/builder/foo
/root/packages/user/bash-completion/src/bash-completion-2.11/test/t/unit/test_unit_expand_tilde_by_ref.py:46: AssertionError
self = <test_unit_expand_tilde_by_ref.TestUnitExpandTildeByRef object at 0x3fff856ff760>, bash = <pexpect.pty_spawn.spawn object at 0x3fff8591db10>, user_home = ('builder', '/root'), plain_tilde = False, suffix_expanded = ('/\\$HOME', True)
@pytest.mark.parametrize("plain_tilde", (True, False))
@pytest.mark.parametrize(
"suffix_expanded",
(
("", True),
("/foo", True),
(r"/\$HOME", True),
("/a b", True),
("/*", True),
(";echo hello", False),
("/a;echo hello", True),
),
)
def test_expand(self, bash, user_home, plain_tilde, suffix_expanded):
user, home = user_home
suffix, expanded = suffix_expanded
if plain_tilde:
user = ""
if not suffix or not expanded:
home = "~"
elif not expanded:
home = "~%s" % user
output = assert_bash_exec(
bash,
r'var="~%s%s"; __expand_tilde_by_ref var; printf "%%s\n" "$var"'
% (user, suffix),
want_output=True,
)
> assert output.strip() == "%s%s" % (home, suffix.replace(r"\$", "$"),)
E AssertionError: assert '/home/builder/$HOME' == '/root/$HOME'
E - /root/$HOME
E + /home/builder/$HOME
/root/packages/user/bash-completion/src/bash-completion-2.11/test/t/unit/test_unit_expand_tilde_by_ref.py:46: AssertionError
self = <test_unit_expand_tilde_by_ref.TestUnitExpandTildeByRef object at 0x3fff8591f5e0>, bash = <pexpect.pty_spawn.spawn object at 0x3fff8591db10>, user_home = ('builder', '/root'), plain_tilde = False, suffix_expanded = ('/a b', True)
@pytest.mark.parametrize("plain_tilde", (True, False))
@pytest.mark.parametrize(
"suffix_expanded",
(
("", True),
("/foo", True),
(r"/\$HOME", True),
("/a b", True),
("/*", True),
(";echo hello", False),
("/a;echo hello", True),
),
)
def test_expand(self, bash, user_home, plain_tilde, suffix_expanded):
user, home = user_home
suffix, expanded = suffix_expanded
if plain_tilde:
user = ""
if not suffix or not expanded:
home = "~"
elif not expanded:
home = "~%s" % user
output = assert_bash_exec(
bash,
r'var="~%s%s"; __expand_tilde_by_ref var; printf "%%s\n" "$var"'
% (user, suffix),
want_output=True,
)
> assert output.strip() == "%s%s" % (home, suffix.replace(r"\$", "$"),)
E AssertionError: assert '/home/builder/a b' == '/root/a b'
E - /root/a b
E + /home/builder/a b
/root/packages/user/bash-completion/src/bash-completion-2.11/test/t/unit/test_unit_expand_tilde_by_ref.py:46: AssertionError
self = <test_unit_expand_tilde_by_ref.TestUnitExpandTildeByRef object at 0x3fff856fe530>, bash = <pexpect.pty_spawn.spawn object at 0x3fff8591db10>, user_home = ('builder', '/root'), plain_tilde = False, suffix_expanded = ('/*', True)
@pytest.mark.parametrize("plain_tilde", (True, False))
@pytest.mark.parametrize(
"suffix_expanded",
(
("", True),
("/foo", True),
(r"/\$HOME", True),
("/a b", True),
("/*", True),
(";echo hello", False),
("/a;echo hello", True),
),
)
def test_expand(self, bash, user_home, plain_tilde, suffix_expanded):
user, home = user_home
suffix, expanded = suffix_expanded
if plain_tilde:
user = ""
if not suffix or not expanded:
home = "~"
elif not expanded:
home = "~%s" % user
output = assert_bash_exec(
bash,
r'var="~%s%s"; __expand_tilde_by_ref var; printf "%%s\n" "$var"'
% (user, suffix),
want_output=True,
)
> assert output.strip() == "%s%s" % (home, suffix.replace(r"\$", "$"),)
E AssertionError: assert '/home/builder/*' == '/root/*'
E - /root/*
E + /home/builder/*
/root/packages/user/bash-completion/src/bash-completion-2.11/test/t/unit/test_unit_expand_tilde_by_ref.py:46: AssertionError
self = <test_unit_expand_tilde_by_ref.TestUnitExpandTildeByRef object at 0x3fff8591d510>, bash = <pexpect.pty_spawn.spawn object at 0x3fff8591db10>, user_home = ('builder', '/root'), plain_tilde = False, suffix_expanded = ('/a;echo hello', True)
@pytest.mark.parametrize("plain_tilde", (True, False))
@pytest.mark.parametrize(
"suffix_expanded",
(
("", True),
("/foo", True),
(r"/\$HOME", True),
("/a b", True),
("/*", True),
(";echo hello", False),
("/a;echo hello", True),
),
)
def test_expand(self, bash, user_home, plain_tilde, suffix_expanded):
user, home = user_home
suffix, expanded = suffix_expanded
if plain_tilde:
user = ""
if not suffix or not expanded:
home = "~"
elif not expanded:
home = "~%s" % user
output = assert_bash_exec(
bash,
r'var="~%s%s"; __expand_tilde_by_ref var; printf "%%s\n" "$var"'
% (user, suffix),
want_output=True,
)
> assert output.strip() == "%s%s" % (home, suffix.replace(r"\$", "$"),)
E AssertionError: assert '/home/builder/a;echo hello' == '/root/a;echo hello'
E - /root/a;echo hello
E + /home/builder/a;echo hello
/root/packages/user/bash-completion/src/bash-completion-2.11/test/t/unit/test_unit_expand_tilde_by_ref.py:46: AssertionError
FAILED test_aclocal.py::TestAclocal::test_1 - assert <CompletionResult []>
FAILED test_ifdown.py::TestIfdown::test_1 - assert <CompletionResult []>
FAILED test_ifup.py::TestIfup::test_1 - assert <CompletionResult []>
FAILED test_service.py::TestService::test_1 - assert <CompletionResult []>
FAILED test_xmlwf.py::TestXmlwf::test_2 - assert <CompletionResult []>
FAILED unit/test_unit_expand.py::TestUnitExpand::test_user_home_compreply - AssertionError: assert '/home/builder' == '/root'
FAILED unit/test_unit_expand.py::TestUnitExpand::test_user_home_cur - AssertionError: assert '/home/builder/a' == '/root/a'
FAILED unit/test_unit_expand_tilde_by_ref.py::TestUnitExpandTildeByRef::test_expand[suffix_expanded0-False] - AssertionError: assert '/home/builder' == '/root'
FAILED unit/test_unit_expand_tilde_by_ref.py::TestUnitExpandTildeByRef::test_expand[suffix_expanded1-False] - AssertionError: assert '/home/builder/foo' == '/root/foo'
FAILED unit/test_unit_expand_tilde_by_ref.py::TestUnitExpandTildeByRef::test_expand[suffix_expanded2-False] - AssertionError: assert '/home/builder/$HOME' == '/root/$HOME'
FAILED unit/test_unit_expand_tilde_by_ref.py::TestUnitExpandTildeByRef::test_expand[suffix_expanded3-False] - AssertionError: assert '/home/builder/a b' == '/root/a b'
FAILED unit/test_unit_expand_tilde_by_ref.py::TestUnitExpandTildeByRef::test_expand[suffix_expanded4-False] - AssertionError: assert '/home/builder/*' == '/root/*'
FAILED unit/test_unit_expand_tilde_by_ref.py::TestUnitExpandTildeByRef::test_expand[suffix_expanded6-False] - AssertionError: assert '/home/builder/a;echo hello' == '/root/a;echo hello'