5
5
6
6
class TestXfreerdp :
7
7
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
+ )
9
11
10
12
@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 ):
12
22
if "/help" not in self ._help (bash ):
13
23
pytest .skip ("Not slash syntax" )
14
24
@@ -18,31 +28,31 @@ def dash_syntax(self, bash):
18
28
pytest .skip ("Not dash syntax" )
19
29
20
30
@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 ):
22
32
assert completion
23
33
24
34
@pytest .mark .complete ("xfreerdp -" , require_cmd = True )
25
- def test_2 (self , completion ):
35
+ def test_2 (self , completion , help_success ):
26
36
assert completion
27
37
28
38
@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 ):
30
40
assert completion
31
41
32
42
@pytest .mark .complete (
33
43
"xfreerdp /kbd:" ,
34
44
require_cmd = True ,
35
45
skipif = 'test -z "$(xfreerdp /kbd-list 2>/dev/null)"' ,
36
46
)
37
- def test_4 (self , bash , completion , slash_syntax ):
47
+ def test_4 (self , bash , completion , help_success , slash_syntax ):
38
48
assert completion
39
49
40
50
@pytest .mark .complete ("xfreerdp /help " , require_cmd = True )
41
- def test_5 (self , completion ):
51
+ def test_5 (self , completion , help_success ):
42
52
assert not completion
43
53
44
54
@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 ):
46
56
assert completion
47
57
48
58
@pytest .mark .complete ("xfreerdp --help " , require_cmd = True )
0 commit comments