@@ -278,10 +278,32 @@ def test_builders_accept_a_charset_override(self):
278278
279279class SwitchWiringTest (unittest .TestCase ):
280280 def test_switch_is_registered_and_mutually_exclusive (self ):
281+ from lib .core .data import conf
282+ from lib .core .exception import SqlmapSyntaxException
281283 from lib .core .optiondict import optDict
284+ from lib .core .settings import NONSQL_TECHNIQUES
285+
282286 self .assertEqual (optDict ["Techniques" ].get ("xslt" ), "boolean" )
283287
284- self .assertIn ('("--xslt", conf.xslt)' , _source ("lib" , "core" , "option.py" ))
288+ # exclusivity used to be asserted by grepping option.py for a literal `("--xslt", conf.xslt)`
289+ # pair; the switches now come from one registry, so assert the PROPERTY instead of the spelling
290+ self .assertIn ("xslt" , NONSQL_TECHNIQUES )
291+
292+ saved = dict ((_ , conf .get (_ )) for _ in NONSQL_TECHNIQUES )
293+ try :
294+ from lib .core .option import _basicOptionValidation
295+
296+ for _ in NONSQL_TECHNIQUES :
297+ conf [_ ] = False
298+ conf .xslt = conf .nosql = True
299+ try :
300+ _basicOptionValidation ()
301+ except SqlmapSyntaxException as ex :
302+ self .assertIn ("--xslt" , str (ex ))
303+ else :
304+ self .fail ("'--xslt --nosql' was accepted" )
305+ finally :
306+ conf .update (saved )
285307
286308 def test_controller_dispatches_the_scan (self ):
287309 self .assertIn ("from lib.techniques.xslt.inject import xsltScan" , _source ("lib" , "controller" , "controller.py" ))
0 commit comments