@@ -75,7 +75,7 @@ def test_check_tlp_disabled(self):
7575
7676 # Using the _Analyzer__check_tlp notation to access managed method
7777 # __check_tlp
78- self .assertEqual (self .analyzer ._Analyzer__check_tlp (), True )
78+ self .assertEqual (self .analyzer ._Worker__check_tlp (), True )
7979
8080 def test_check_tlp_ko (self ):
8181 self .analyzer .enable_check_tlp = True
@@ -84,7 +84,7 @@ def test_check_tlp_ko(self):
8484
8585 # Using the _Analyzer__check_tlp notation to access managed method
8686 # __check_tlp
87- self .assertEqual (self .analyzer ._Analyzer__check_tlp (), False )
87+ self .assertEqual (self .analyzer ._Worker__check_tlp (), False )
8888
8989 def test_check_tlp_ok (self ):
9090 self .analyzer .enable_check_tlp = True
@@ -93,7 +93,7 @@ def test_check_tlp_ok(self):
9393
9494 # Using the _Analyzer__check_tlp notation to access managed method
9595 # __check_tlp
96- self .assertEqual (self .analyzer ._Analyzer__check_tlp (), True )
96+ self .assertEqual (self .analyzer ._Worker__check_tlp (), True )
9797
9898
9999class TestErrorResponse (unittest .TestCase ):
@@ -107,13 +107,17 @@ def test_error_response(self):
107107 self .assertEqual (self .analyzer .get_param ('config.key' ), "secret" )
108108 self .assertEqual (self .analyzer .get_param ('config.apikey' ), "secret" )
109109 self .assertEqual (self .analyzer .get_param ('config.api_key' ), "secret" )
110+ self .assertEqual (self .analyzer .get_param ('config.apiSecret' ), "secret" )
111+ self .assertEqual (self .analyzer .get_param ('config.api_Pass' ), "secret" )
112+ self .assertEqual (self .analyzer .get_param ('config.API' ), "secret" )
113+
110114
111115 # Run the error method
112116 with self .assertRaises (SystemExit ):
113117 self .analyzer .error ('Error' , True )
114118
115119 # Get the output
116- output = self . analyzer . fpoutput .getvalue ().strip ()
120+ output = sys . stdout .getvalue ().strip ()
117121 json_output = json .loads (output )
118122
119123 self .assertEqual (json_output ['success' ], False )
@@ -124,6 +128,10 @@ def test_error_response(self):
124128 self .assertEqual (json_output ['input' ]['config' ]['key' ], 'REMOVED' )
125129 self .assertEqual (json_output ['input' ]['config' ]['apikey' ], 'REMOVED' )
126130 self .assertEqual (json_output ['input' ]['config' ]['api_key' ], 'REMOVED' )
131+ self .assertEqual (json_output ['input' ]['config' ]['apiSecret' ], 'REMOVED' )
132+ self .assertEqual (json_output ['input' ]['config' ]['api_Pass' ], 'secret' )
133+ self .assertEqual (json_output ['input' ]['config' ]['API' ], 'secret' )
134+
127135
128136
129137class TestReportResponse (unittest .TestCase ):
@@ -137,7 +145,7 @@ def test_report_response(self):
137145 self .analyzer .report ({'report_id' : '12345' })
138146
139147 # Get the output
140- output = self . analyzer . fpoutput .getvalue ().strip ()
148+ output = sys . stdout .getvalue ().strip ()
141149 json_output = json .loads (output )
142150
143151 self .assertEqual (json_output .get ('success' ), True )
0 commit comments