@@ -109,11 +109,7 @@ def test_skips(self):
109
109
"""Tests the skips option"""
110
110
111
111
logger = logging .getLogger ()
112
- test_path = os .path .join (
113
- os .path .abspath (os .path .dirname (__file__ )),
114
- "binaries" ,
115
- "test-sqlite-3.12.2.out" ,
116
- )
112
+ test_path = os .path .join (os .path .abspath (os .path .dirname (__file__ )), "csv" )
117
113
118
114
skip_checkers = ["systemd" , "xerces" , "xml2" , "kerberos" ]
119
115
include_checkers = ["expat" , "libgcrypt" , "openssl" , "sqlite" ]
@@ -122,7 +118,9 @@ def test_skips(self):
122
118
main (["cve-bin-tool" , test_path , "-s" , "," .join (skip_checkers )])
123
119
124
120
# The final log has all the checkers detected
125
- final_log = cm .output [1 ]
121
+ final_log = [i for i in cm .output if "Checkers:" in i ]
122
+ self .assertTrue (len (final_log ) > 0 , "Could not find checkers line in log" )
123
+ final_log = final_log [0 ]
126
124
for checker in skip_checkers :
127
125
self .assertTrue (
128
126
checker not in final_log , "found skipped checker {}" .format (checker )
@@ -139,7 +137,9 @@ def test_skips(self):
139
137
with self .assertLogs (logger , logging .INFO ) as cm :
140
138
main (["cve-bin-tool" , test_path , "-s" , "," .join (skip_checkers )])
141
139
142
- final_log = cm .output [1 ]
140
+ final_log = [i for i in cm .output if "Checkers:" in i ]
141
+ self .assertTrue (len (final_log ) > 0 , "Could not find checkers line in log" )
142
+ final_log = final_log [0 ]
143
143
for checker in skip_checkers :
144
144
self .assertTrue (
145
145
checker not in final_log , "found skipped checker {}" .format (checker )
0 commit comments