@@ -109,7 +109,11 @@ def test_skips(self):
109
109
"""Tests the skips option"""
110
110
111
111
logger = logging .getLogger ()
112
- test_path = os .path .join (os .path .abspath (os .path .dirname (__file__ )), "binaries" )
112
+ test_path = os .path .join (
113
+ os .path .abspath (os .path .dirname (__file__ )),
114
+ "binaries" ,
115
+ "test-sqlite-3.12.2.out" ,
116
+ )
113
117
114
118
skip_checkers = ["systemd" , "xerces" , "xml2" , "kerberos" ]
115
119
include_checkers = ["expat" , "libgcrypt" , "openssl" , "sqlite" ]
@@ -118,21 +122,31 @@ def test_skips(self):
118
122
main (["cve-bin-tool" , test_path , "-s" , "," .join (skip_checkers )])
119
123
120
124
# The final log has all the checkers detected
121
- final_log = cm .output [- 1 ]
125
+ final_log = cm .output [1 ]
122
126
for checker in skip_checkers :
123
- self .assertTrue (checker not in final_log )
127
+ self .assertTrue (
128
+ checker not in final_log , "found skipped checker {}" .format (checker )
129
+ )
124
130
125
131
for checker in include_checkers :
126
- self .assertTrue (checker in final_log )
132
+ self .assertTrue (
133
+ checker in final_log ,
134
+ "could not find expected checker {}" .format (checker ),
135
+ )
127
136
128
137
# swap skip_checkers and include_checkers
129
138
include_checkers , skip_checkers = skip_checkers , include_checkers
130
139
with self .assertLogs (logger , logging .INFO ) as cm :
131
140
main (["cve-bin-tool" , test_path , "-s" , "," .join (skip_checkers )])
132
141
133
- final_log = cm .output [- 1 ]
142
+ final_log = cm .output [1 ]
134
143
for checker in skip_checkers :
135
- self .assertTrue (checker not in final_log )
144
+ self .assertTrue (
145
+ checker not in final_log , "found skipped checker {}" .format (checker )
146
+ )
136
147
137
148
for checker in include_checkers :
138
- self .assertTrue (checker in final_log )
149
+ self .assertTrue (
150
+ checker in final_log ,
151
+ "could not find expected checker {}" .format (checker ),
152
+ )
0 commit comments