Skip to content

Commit b41b97c

Browse files
committed
test/xfreerdp: skip --help failure cases
1 parent 53f624f commit b41b97c

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

test/t/test_xfreerdp.py

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,20 @@
55

66
class TestXfreerdp:
77
def _help(self, bash):
8-
return assert_bash_exec(bash, "xfreerdp --help || :", want_output=True)
8+
return assert_bash_exec(
9+
bash, "xfreerdp --help 2>&1 || :", want_output=True
10+
)
911

1012
@pytest.fixture(scope="class")
11-
def slash_syntax(self, bash):
13+
def help_success(self, bash):
14+
output = self._help(bash)
15+
# Example from our CentOS 7 container
16+
# [04:51:31:663] [238:238] [ERROR][com.freerdp.client.x11] - Failed to get pixmap info
17+
if not output or "ERROR" in output.strip().splitlines()[0]:
18+
pytest.skip("--help errored")
19+
20+
@pytest.fixture(scope="class")
21+
def slash_syntax(self, bash, help_success):
1222
if "/help" not in self._help(bash):
1323
pytest.skip("Not slash syntax")
1424

@@ -18,31 +28,31 @@ def dash_syntax(self, bash):
1828
pytest.skip("Not dash syntax")
1929

2030
@pytest.mark.complete("xfreerdp /", require_cmd=True)
21-
def test_1(self, bash, completion, slash_syntax):
31+
def test_1(self, bash, completion, help_success, slash_syntax):
2232
assert completion
2333

2434
@pytest.mark.complete("xfreerdp -", require_cmd=True)
25-
def test_2(self, completion):
35+
def test_2(self, completion, help_success):
2636
assert completion
2737

2838
@pytest.mark.complete("xfreerdp +", require_cmd=True)
29-
def test_3(self, bash, completion, slash_syntax):
39+
def test_3(self, bash, completion, help_success, slash_syntax):
3040
assert completion
3141

3242
@pytest.mark.complete(
3343
"xfreerdp /kbd:",
3444
require_cmd=True,
3545
skipif='test -z "$(xfreerdp /kbd-list 2>/dev/null)"',
3646
)
37-
def test_4(self, bash, completion, slash_syntax):
47+
def test_4(self, bash, completion, help_success, slash_syntax):
3848
assert completion
3949

4050
@pytest.mark.complete("xfreerdp /help ", require_cmd=True)
41-
def test_5(self, completion):
51+
def test_5(self, completion, help_success):
4252
assert not completion
4353

4454
@pytest.mark.complete("xfreerdp -k ", require_cmd=True)
45-
def test_6(self, bash, completion, dash_syntax):
55+
def test_6(self, bash, completion, help_success, dash_syntax):
4656
assert completion
4757

4858
@pytest.mark.complete("xfreerdp --help ", require_cmd=True)

0 commit comments

Comments
 (0)