How to use get_tools method in prospector

Best Python code snippet using prospector_python

test_suites.py

Source: test_suites.py Github

copy

Full Screen

...26 name = uuid.uuid4().hex27 path = os.path.join(self.root, name)28 suite.save(path)29 suite2 = Suite.load(path)30 self.assertEqual(suite.get_tools(), suite2.get_tools())31 self.assertEqual(set(suite.context_names), set(suite2.context_names))32 def test_1(self):33 """Test empty suite."""34 path = os.path.join(self.root, "suite1")35 s = Suite()36 tools = s.get_tools()37 self.assertEqual(tools, {})38 self._test_serialization(s)39 def test_2(self):40 """Test basic suite."""41 c_foo = ResolvedContext(["foo"])42 c_bah = ResolvedContext(["bah"])43 s = Suite()44 s.add_context("foo", c_foo)45 s.add_context("bah", c_bah)46 expected_tools = set(["fooer", "bahbah", "blacksheep"])47 self.assertEqual(set(s.get_tools().keys()), expected_tools)48 s.set_context_prefix("foo", "fx_")49 expected_tools = set(["fx_fooer", "bahbah", "blacksheep"])50 self.assertEqual(set(s.get_tools().keys()), expected_tools)51 s.set_context_suffix("foo", "_fun")52 s.set_context_suffix("bah", "_anim")53 expected_tools = set(["fx_fooer_fun", "bahbah_anim", "blacksheep_anim"])54 self.assertEqual(set(s.get_tools().keys()), expected_tools)55 s.remove_context("bah")56 expected_tools = set(["fx_fooer_fun"])57 self.assertEqual(set(s.get_tools().keys()), expected_tools)58 s.add_context("bah", c_bah)59 expected_tools = set(["fx_fooer_fun", "bahbah", "blacksheep"])60 self.assertEqual(set(s.get_tools().keys()), expected_tools)61 s.alias_tool("bah", "blacksheep", "whitesheep")62 expected_tools = set(["fx_fooer_fun", "bahbah", "whitesheep"])63 self.assertEqual(set(s.get_tools().keys()), expected_tools)64 # explicit alias takes precedence over prefix/​suffix65 s.alias_tool("foo", "fooer", "floober")66 expected_tools = set(["floober", "bahbah", "whitesheep"])67 self.assertEqual(set(s.get_tools().keys()), expected_tools)68 s.unalias_tool("foo", "fooer")69 s.unalias_tool("bah", "blacksheep")70 expected_tools = set(["fx_fooer_fun", "bahbah", "blacksheep"])71 self.assertEqual(set(s.get_tools().keys()), expected_tools)72 s.hide_tool("bah", "bahbah")73 expected_tools = set(["fx_fooer_fun", "blacksheep"])74 self.assertEqual(set(s.get_tools().keys()), expected_tools)75 s.unhide_tool("bah", "bahbah")76 expected_tools = set(["fx_fooer_fun", "bahbah", "blacksheep"])77 self.assertEqual(set(s.get_tools().keys()), expected_tools)78 self._test_serialization(s)79 def test_3(self):80 """Test tool clashes in a suite."""81 c_foo = ResolvedContext(["foo"])82 c_bah = ResolvedContext(["bah"])83 s = Suite()84 s.add_context("foo", c_foo)85 s.add_context("bah", c_bah)86 s.add_context("bah2", c_bah)87 expected_tools = set(["fooer", "bahbah", "blacksheep"])88 self.assertEqual(set(s.get_tools().keys()), expected_tools)89 self.assertEqual(s.get_tool_context("bahbah"), "bah2")90 self.assertEqual(s.get_tool_context("blacksheep"), "bah2")91 s.bump_context("bah")92 self.assertEqual(s.get_tool_context("bahbah"), "bah")93 self.assertEqual(s.get_tool_context("blacksheep"), "bah")94 expected_conflicts = set(["bahbah", "blacksheep"])95 self.assertEqual(set(s.get_conflicting_aliases()), expected_conflicts)96 s.set_context_prefix("bah", "hey_")97 expected_tools = set(["fooer", "bahbah", "blacksheep",98 "hey_bahbah", "hey_blacksheep"])99 self.assertEqual(set(s.get_tools().keys()), expected_tools)100 s.remove_context_prefix("bah")101 expected_tools = set(["fooer", "bahbah", "blacksheep"])102 self.assertEqual(set(s.get_tools().keys()), expected_tools)103 self.assertEqual(s.get_tool_context("bahbah"), "bah")104 self.assertEqual(s.get_tool_context("blacksheep"), "bah")105 s.hide_tool("bah", "bahbah")106 self.assertEqual(s.get_tool_context("bahbah"), "bah2")107 s.unhide_tool("bah", "bahbah")108 self.assertEqual(s.get_tool_context("bahbah"), "bah")109 self._test_serialization(s)110if __name__ == '__main__':111 unittest.main()112# Copyright 2013-2016 Allan Johns.113#114# This library is free software: you can redistribute it and/​or115# modify it under the terms of the GNU Lesser General Public116# License as published by the Free Software Foundation, either...

Full Screen

Full Screen

Blogs

Check out the latest blogs from LambdaTest on this topic:

Fault-Based Testing and the Pesticide Paradox

In some sense, testing can be more difficult than coding, as validating the efficiency of the test cases (i.e., the ‘goodness’ of your tests) can be much harder than validating code correctness. In practice, the tests are just executed without any validation beyond the pass/fail verdict. On the contrary, the code is (hopefully) always validated by testing. By designing and executing the test cases the result is that some tests have passed, and some others have failed. Testers do not know much about how many bugs remain in the code, nor about their bug-revealing efficiency.

How To Get Started With Cypress Debugging

One of the most important tasks of a software developer is not just writing code fast; it is the ability to find what causes errors and bugs whenever you encounter one and the ability to solve them quickly.

How To Choose The Best JavaScript Unit Testing Frameworks

JavaScript is one of the most widely used programming languages. This popularity invites a lot of JavaScript development and testing frameworks to ease the process of working with it. As a result, numerous JavaScript testing frameworks can be used to perform unit testing.

Do you possess the necessary characteristics to adopt an Agile testing mindset?

To understand the agile testing mindset, we first need to determine what makes a team “agile.” To me, an agile team continually focuses on becoming self-organized and cross-functional to be able to complete any challenge they may face during a project.

[LambdaTest Spartans Panel Discussion]: What Changed For Testing & QA Community And What Lies Ahead

The rapid shift in the use of technology has impacted testing and quality assurance significantly, especially around the cloud adoption of agile development methodologies. With this, the increasing importance of quality and automation testing has risen enough to deliver quality work.

Automation Testing Tutorials

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.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run prospector automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful