Best Python code snippet using autotest_python
config.py
Source:config.py
...9from configparser import ConfigParser10from lib.core.data import paths11class ConfigFileParser:12 @staticmethod13 def _get_option(section, option):14 try:15 cf = ConfigParser()16 cf.read(paths.CONFIG_PATH)17 return cf.get(section=section, option=option)18 except:19 print('Missing essential options, please check your config-file.')20 return ''21 def recursive_scan(self):22 return self._get_option('RecursiveScan','conf.recursive_scan')23 def recursive_status_code(self):24 return self._get_option('RecursiveScan','conf.recursive_status_code')25 def recursive_scan_max_url_length(self):26 return self._get_option('RecursiveScan','conf.recursive_scan_max_url_length')27 def recursive_blacklist_exts(self):28 return self._get_option('RecursiveScan','conf.recursive_blacklist_exts')29 def exclude_subdirs(self):30 return self._get_option('RecursiveScan','conf.exclude_subdirs')31 def dict_mode(self):32 return self._get_option('ScanModeHandler','conf.dict_mode')33 def dict_mode_load_single_dict(self):34 return self._get_option('ScanModeHandler','conf.dict_mode_load_single_dict')35 def dict_mode_load_mult_dict(self):36 return self._get_option('ScanModeHandler','conf.dict_mode_load_mult_dict')37 def blast_mode(self):38 return self._get_option('ScanModeHandler','conf.blast_mode')39 def blast_mode_min(self):40 return self._get_option('ScanModeHandler','conf.blast_mode_min')41 def blast_mode_max(self):42 return self._get_option('ScanModeHandler','conf.blast_mode_max')43 def blast_mode_az(self):44 return self._get_option('ScanModeHandler','conf.blast_mode_az')45 def blast_mode_num(self):46 return self._get_option('ScanModeHandler','conf.blast_mode_num')47 def blast_mode_custom_charset(self):48 return self._get_option('ScanModeHandler','conf.blast_mode_custom_charset')49 def blast_mode_resume_charset(self):50 return self._get_option('ScanModeHandler','conf.blast_mode_resume_charset')51 def crawl_mode(self):52 return self._get_option('ScanModeHandler','conf.crawl_mode')53 def crawl_mode_dynamic_fuzz_suffix(self):54 return self._get_option('ScanModeHandler','conf.crawl_mode_dynamic_fuzz_suffix')55 def crawl_mode_parse_robots(self):56 return self._get_option('ScanModeHandler','conf.crawl_mode_parse_robots')57 def crawl_mode_parse_html(self):58 return self._get_option('ScanModeHandler','conf.crawl_mode_parse_html')59 def crawl_mode_dynamic_fuzz(self):60 return self._get_option('ScanModeHandler','conf.crawl_mode_dynamic_fuzz')61 def fuzz_mode(self):62 return self._get_option('ScanModeHandler','conf.fuzz_mode')63 def fuzz_mode_load_single_dict(self):64 return self._get_option('ScanModeHandler','conf.fuzz_mode_load_single_dict')65 def fuzz_mode_load_mult_dict(self):66 return self._get_option('ScanModeHandler','conf.fuzz_mode_load_mult_dict')67 def fuzz_mode_label(self):68 return self._get_option('ScanModeHandler','conf.fuzz_mode_label')69 def request_headers(self):70 return self._get_option('RequestHandler','conf.request_headers')71 def request_header_ua(self):72 return self._get_option('RequestHandler','conf.request_header_ua')73 def request_header_cookie(self):74 return self._get_option('RequestHandler','conf.request_header_cookie')75 def request_header_401_auth(self):76 return self._get_option('RequestHandler','conf.request_header_401_auth')77 def request_timeout(self):78 return self._get_option('RequestHandler','conf.request_timeout')79 def request_delay(self):80 return self._get_option('RequestHandler','conf.request_delay')81 def request_limit(self):82 return self._get_option('RequestHandler','conf.request_limit')83 def request_max_retries(self):84 return self._get_option('RequestHandler','conf.request_max_retries')85 def request_persistent_connect(self):86 return self._get_option('RequestHandler','conf.request_persistent_connect')87 def request_method(self):88 return self._get_option('RequestHandler','conf.request_method')89 def redirection_302(self):90 return self._get_option('RequestHandler','conf.redirection_302')91 def file_extension(self):92 return self._get_option('RequestHandler','conf.file_extension')93 def response_status_code(self):94 return self._get_option('ResponseHandler','conf.response_status_code')95 def response_header_content_type(self):96 return self._get_option('ResponseHandler','conf.response_header_content_type')97 def response_size(self):98 return self._get_option('ResponseHandler','conf.response_size')99 def auto_check_404_page(self):100 return self._get_option('ResponseHandler','conf.auto_check_404_page')101 def custom_503_page(self):102 return self._get_option('ResponseHandler','conf.custom_503_page')103 def custom_response_page(self):104 return self._get_option('ResponseHandler','conf.custom_response_page')105 def skip_size(self):106 return self._get_option('ResponseHandler','conf.skip_size')107 def proxy_server(self):108 return self._get_option('ProxyHandler','conf.proxy_server')109 def debug(self):110 return self._get_option('DebugMode','conf.debug')111 def update(self):...
configparser.py
Source:configparser.py
...7from configparser import ConfigParser8from lib.core.data import paths9class ConfigFileParser:10 @staticmethod11 def _get_option(section, option):12 try:13 cf = ConfigParser()14 cf.read(paths.CONFIG_FILE)15 return cf.get(section=section, option=option)16 except:17 print('Missing essential options, please check your config-file.')18 return ''19 def ZoomEyeEmail(self):20 return self._get_option('zoomeye', 'email')21 def ZoomEyePassword(self):22 return self._get_option('zoomeye', 'password')23 def fofa_email(self):24 return self._get_option('fofa', 'email')25 def fofa_key(self):26 return self._get_option('fofa', 'key')27 def shodan_apikey(self):28 return self._get_option('shodan', 'api_key')29 def censys_UID(self):30 return self._get_option('censys', 'UID')31 def censys_SECRET(self):32 return self._get_option('censys', 'SECRET')33 def proxy(self):...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!