Best Python code snippet using Testify_python
test_manifest.py
Source:test_manifest.py
...4from cuddlefish.manifest import scan_module, scan_package, \5 update_manifest_with_fileinfo6class Extra:7 def failUnlessKeysAre(self, d, keys):8 self.failUnlessEqual(sorted(d.keys()), sorted(keys))9class Require(unittest.TestCase, Extra):10 def scan(self, text):11 lines = StringIO(text).readlines()12 requires, chrome, problems = scan_module("fake.js", lines)13 self.failUnlessEqual(problems, False)14 return requires, chrome15 def test_modules(self):16 mod = """var foo = require('one');"""17 requires, chrome = self.scan(mod)18 self.failUnlessKeysAre(requires, ["one"])19 self.failUnlessEqual(chrome, False)20 mod = """var foo = require(\"one\");"""21 requires, chrome = self.scan(mod)22 self.failUnlessKeysAre(requires, ["one"])23 self.failUnlessEqual(chrome, False)24 mod = """var foo=require( 'one' ) ; """25 requires, chrome = self.scan(mod)26 self.failUnlessKeysAre(requires, ["one"])27 self.failUnlessEqual(chrome, False)28 mod = """var foo = require('o'+'ne'); // tricky, denied"""29 requires, chrome = self.scan(mod)30 self.failUnlessKeysAre(requires, [])31 self.failUnlessEqual(chrome, False)32 mod = """require('one').immediately.do().stuff();"""33 requires, chrome = self.scan(mod)34 self.failUnlessKeysAre(requires, ["one"])35 self.failUnlessEqual(chrome, False)36 # these forms are commented out, and thus ignored37 mod = """// var foo = require('one');"""38 requires, chrome = self.scan(mod)39 self.failUnlessKeysAre(requires, [])40 self.failUnlessEqual(chrome, False)41 mod = """/* var foo = require('one');"""42 requires, chrome = self.scan(mod)43 self.failUnlessKeysAre(requires, [])44 self.failUnlessEqual(chrome, False)45 mod = """ * var foo = require('one');"""46 requires, chrome = self.scan(mod)47 self.failUnlessKeysAre(requires, [])48 self.failUnlessEqual(chrome, False)49 mod = """ ' var foo = require('one');"""50 requires, chrome = self.scan(mod)51 self.failUnlessKeysAre(requires, [])52 self.failUnlessEqual(chrome, False)53 mod = """ \" var foo = require('one');"""54 requires, chrome = self.scan(mod)55 self.failUnlessKeysAre(requires, [])56 self.failUnlessEqual(chrome, False)57 # multiple requires58 mod = """const foo = require('one');59 const foo = require('two');"""60 requires, chrome = self.scan(mod)61 self.failUnlessKeysAre(requires, ["one", "two"])62 self.failUnlessEqual(chrome, False)63 mod = """const foo = require('one'); const foo = require('two');"""64 requires, chrome = self.scan(mod)65 self.failUnlessKeysAre(requires, ["one", "two"])66 self.failUnlessEqual(chrome, False)67def scan2(text, fn="fake.js"):68 stderr = StringIO()69 lines = StringIO(text).readlines()70 requires, chrome, problems = scan_module(fn, lines, stderr)71 stderr.seek(0)72 return requires, chrome, problems, stderr.readlines()73class Chrome(unittest.TestCase, Extra):74 def test_ignore_loader(self):75 # we specifically ignore the two loader files76 mod = """let {Cc,Ci} = require('chrome');"""77 requires, chrome, problems, err = scan2(mod, "blah/cuddlefish.js")78 self.failUnlessKeysAre(requires, [])79 self.failUnlessEqual(chrome, False)80 self.failUnlessEqual(problems, False)81 self.failUnlessEqual(err, [])82 mod = """let {Cc,Ci} = require('chrome');"""83 requires, chrome, problems, err = scan2(mod, "securable-module.js")84 self.failUnlessKeysAre(requires, [])85 self.failUnlessEqual(chrome, False)86 self.failUnlessEqual(problems, False)87 self.failUnlessEqual(err, [])88 def test_chrome(self):89 mod = """let {Cc,Ci} = require('chrome');"""90 requires, chrome, problems, err = scan2(mod)91 self.failUnlessKeysAre(requires, [])92 self.failUnlessEqual(chrome, True)93 self.failUnlessEqual(problems, False)94 self.failUnlessEqual(err, [])95 mod = """var foo = require('foo');96 let {Cc,Ci} = require('chrome');"""97 requires, chrome, problems, err = scan2(mod)98 self.failUnlessKeysAre(requires, ["foo"])99 self.failUnlessEqual(chrome, True)100 self.failUnlessEqual(problems, False)101 self.failUnlessEqual(err, [])102 mod = """let c = require('chrome');"""103 requires, chrome, problems, err = scan2(mod)104 self.failUnlessKeysAre(requires, [])105 self.failUnlessEqual(chrome, True)106 self.failUnlessEqual(problems, False)107 self.failUnlessEqual(err, [])108 mod = """var foo = require('foo');109 let c = require('chrome');"""110 requires, chrome, problems, err = scan2(mod)111 self.failUnlessKeysAre(requires, ["foo"])112 self.failUnlessEqual(chrome, True)113 self.failUnlessEqual(problems, False)114 self.failUnlessEqual(err, [])115class BadChrome(unittest.TestCase, Extra):116 def test_bad_alias(self):117 # using Components.* gets you a warning. If it looks like you're118 # using it to build an alias, the warning suggests a better way.119 mod = """let Cc = Components.classes;"""120 requires, chrome, problems, err = scan2(mod)121 self.failUnlessKeysAre(requires, [])122 self.failUnlessEqual(chrome, False)123 self.failUnlessEqual(problems, True)124 self.failUnlessEqual(err[1], "To use chrome authority, as in:\n") 125 self.failUnlessEqual(err[-1], ' const {Cc} = require("chrome");\n')126 def test_bad_misc(self):127 # If it looks like you're using something that doesn't have an alias,128 # the warning also suggests a better way.129 mod = """if (Components.isSuccessCode(foo))"""130 requires, chrome, problems, err = scan2(mod)131 self.failUnlessKeysAre(requires, [])132 self.failUnlessEqual(chrome, False)133 self.failUnlessEqual(problems, True)134 self.failUnlessEqual(err[1], "To use chrome authority, as in:\n") 135 self.failUnlessEqual(err[-1],136 ' const {components} = require("chrome");\n')137 mod = """let CID = Components.ID""" # not one of the usual aliases138 requires, chrome, problems, err = scan2(mod)139 self.failUnlessKeysAre(requires, [])140 self.failUnlessEqual(chrome, False)141 self.failUnlessEqual(problems, True)142 self.failUnlessEqual(err[1], "To use chrome authority, as in:\n") 143 self.failUnlessEqual(err[-1],144 ' const {components} = require("chrome");\n')145 def test_use_too_much(self):146 # if you use more than you ask for, you also get a warning147 mod = """let {Cc,Ci} = require('chrome');148 Cu.something();"""149 requires, chrome, problems, err = scan2(mod)150 self.failUnlessKeysAre(requires, [])151 self.failUnlessEqual(chrome, True)152 self.failUnlessEqual(problems, True)153 err = "".join(err)154 self.failUnless("To use chrome authority, as in:" in err, err)155 self.failUnless("2> Cu.something()" in err, err)156 self.failUnless("You must enable it with something like:" in err, err)157 self.failUnless('const {Cc,Ci,Cu} = require("chrome");' in err, err)158class Package(unittest.TestCase):159 def test_bug_596573(self):160 jp_tests = "packages/jetpack-core/tests"161 manifest, has_problems = scan_package("prefix", "resource:foo",162 "jetpack-core", "tests", jp_tests)163 found = [i.name for i in manifest.values()164 if i.name == "interoperablejs-read-only/compliance/" +165 "nested/a/b/c/d"]166 self.failUnless(len(found) == 1)167 168 def test_jetpack_core(self):169 # this has a side-effect of asserting that all the SDK's jetpack-core170 # modules are clean.171 jp_core = "packages/jetpack-core/lib"172 assert os.path.isdir(jp_core) # we expect to be run from the SDK top173 stderr = StringIO()174 manifest, has_problems = scan_package("prefix-", "resource:foo/",175 "jetpack-core", "lib",176 jp_core, stderr)177 stderr.seek(0)178 err = stderr.readlines()179 self.failUnlessEqual(err, [], "".join(err))180 self.failUnlessEqual(has_problems, False)181 update_manifest_with_fileinfo(["jetpack-core"], "jetpack-core",182 manifest)183 # look at a few samples from the manifest: this depends upon the184 # behavior of other files in the SDK, so when those files change185 # (specifically when they move or add dependencies), this test must186 # be updated187 self.failUnless("resource:foo/tab-browser.js" in manifest, manifest.keys())188 tb = manifest["resource:foo/tab-browser.js"]189 self.failUnlessEqual(tb.chrome, True)190 self.failUnlessEqual(tb.name, "tab-browser")191 self.failUnlessEqual(tb.packageName, "jetpack-core")192 self.failUnless("window-utils" in tb.requires, tb.requires.values())193 self.failUnlessEqual(tb.requires["window-utils"].url,194 "resource:foo/window-utils.js")195 self.failUnlessEqual(tb.sectionName, "lib")196 self.failUnlessEqual(tb.zipname,197 "resources/prefix-jetpack-core-lib/tab-browser.js")198 h = tb.hash199 self.failUnless(re.search(r'^[0-9a-f]{64}$', h), h)200 # don't assert the actual value, since that will change each time201 # page-mod.js changes202 self.failUnless("resource:foo/api-utils.js" in manifest, manifest.keys())203if __name__ == '__main__':...
test_getargs2.py
Source:test_getargs2.py
...66class Unsigned_TestCase(unittest.TestCase):67 def test_b(self):68 from _testcapi import getargs_b69 # b returns 'unsigned char', and does range checking (0 ... UCHAR_MAX)70 self.failUnlessEqual(3, getargs_b(3.14))71 self.failUnlessEqual(99, getargs_b(Long()))72 self.failUnlessEqual(99, getargs_b(Int()))7374 self.assertRaises(OverflowError, getargs_b, -1)75 self.failUnlessEqual(0, getargs_b(0))76 self.failUnlessEqual(UCHAR_MAX, getargs_b(UCHAR_MAX))77 self.assertRaises(OverflowError, getargs_b, UCHAR_MAX + 1)7879 self.failUnlessEqual(42, getargs_b(42))80 self.failUnlessEqual(42, getargs_b(42L))81 self.assertRaises(OverflowError, getargs_b, VERY_LARGE)8283 def test_B(self):84 from _testcapi import getargs_B85 # B returns 'unsigned char', no range checking86 self.failUnlessEqual(3, getargs_B(3.14))87 self.failUnlessEqual(99, getargs_B(Long()))88 self.failUnlessEqual(99, getargs_B(Int()))8990 self.failUnlessEqual(UCHAR_MAX, getargs_B(-1))91 self.failUnlessEqual(UCHAR_MAX, getargs_B(-1L))92 self.failUnlessEqual(0, getargs_B(0))93 self.failUnlessEqual(UCHAR_MAX, getargs_B(UCHAR_MAX))94 self.failUnlessEqual(0, getargs_B(UCHAR_MAX+1))9596 self.failUnlessEqual(42, getargs_B(42))97 self.failUnlessEqual(42, getargs_B(42L))98 self.failUnlessEqual(UCHAR_MAX & VERY_LARGE, getargs_B(VERY_LARGE))99100 def test_H(self):101 from _testcapi import getargs_H102 # H returns 'unsigned short', no range checking103 self.failUnlessEqual(3, getargs_H(3.14))104 self.failUnlessEqual(99, getargs_H(Long()))105 self.failUnlessEqual(99, getargs_H(Int()))106107 self.failUnlessEqual(USHRT_MAX, getargs_H(-1))108 self.failUnlessEqual(0, getargs_H(0))109 self.failUnlessEqual(USHRT_MAX, getargs_H(USHRT_MAX))110 self.failUnlessEqual(0, getargs_H(USHRT_MAX+1))111112 self.failUnlessEqual(42, getargs_H(42))113 self.failUnlessEqual(42, getargs_H(42L))114115 self.failUnlessEqual(VERY_LARGE & USHRT_MAX, getargs_H(VERY_LARGE))116117 def test_I(self):118 from _testcapi import getargs_I119 # I returns 'unsigned int', no range checking120 self.failUnlessEqual(3, getargs_I(3.14))121 self.failUnlessEqual(99, getargs_I(Long()))122 self.failUnlessEqual(99, getargs_I(Int()))123124 self.failUnlessEqual(UINT_MAX, getargs_I(-1))125 self.failUnlessEqual(0, getargs_I(0))126 self.failUnlessEqual(UINT_MAX, getargs_I(UINT_MAX))127 self.failUnlessEqual(0, getargs_I(UINT_MAX+1))128129 self.failUnlessEqual(42, getargs_I(42))130 self.failUnlessEqual(42, getargs_I(42L))131132 self.failUnlessEqual(VERY_LARGE & UINT_MAX, getargs_I(VERY_LARGE))133134 def test_k(self):135 from _testcapi import getargs_k136 # k returns 'unsigned long', no range checking137 # it does not accept float, or instances with __int__138 self.assertRaises(TypeError, getargs_k, 3.14)139 self.assertRaises(TypeError, getargs_k, Long())140 self.assertRaises(TypeError, getargs_k, Int())141142 self.failUnlessEqual(ULONG_MAX, getargs_k(-1))143 self.failUnlessEqual(0, getargs_k(0))144 self.failUnlessEqual(ULONG_MAX, getargs_k(ULONG_MAX))145 self.failUnlessEqual(0, getargs_k(ULONG_MAX+1))146147 self.failUnlessEqual(42, getargs_k(42))148 self.failUnlessEqual(42, getargs_k(42L))149150 self.failUnlessEqual(VERY_LARGE & ULONG_MAX, getargs_k(VERY_LARGE))151152class Signed_TestCase(unittest.TestCase):153 def test_i(self):154 from _testcapi import getargs_i155 # i returns 'int', and does range checking (INT_MIN ... INT_MAX)156 self.failUnlessEqual(3, getargs_i(3.14))157 self.failUnlessEqual(99, getargs_i(Long()))158 self.failUnlessEqual(99, getargs_i(Int()))159160 self.assertRaises(OverflowError, getargs_i, INT_MIN-1)161 self.failUnlessEqual(INT_MIN, getargs_i(INT_MIN))162 self.failUnlessEqual(INT_MAX, getargs_i(INT_MAX))163 self.assertRaises(OverflowError, getargs_i, INT_MAX+1)164165 self.failUnlessEqual(42, getargs_i(42))166 self.failUnlessEqual(42, getargs_i(42L))167 self.assertRaises(OverflowError, getargs_i, VERY_LARGE)168169 def test_l(self):170 from _testcapi import getargs_l171 # l returns 'long', and does range checking (LONG_MIN ... LONG_MAX)172 self.failUnlessEqual(3, getargs_l(3.14))173 self.failUnlessEqual(99, getargs_l(Long()))174 self.failUnlessEqual(99, getargs_l(Int()))175176 self.assertRaises(OverflowError, getargs_l, LONG_MIN-1)177 self.failUnlessEqual(LONG_MIN, getargs_l(LONG_MIN))178 self.failUnlessEqual(LONG_MAX, getargs_l(LONG_MAX))179 self.assertRaises(OverflowError, getargs_l, LONG_MAX+1)180181 self.failUnlessEqual(42, getargs_l(42))182 self.failUnlessEqual(42, getargs_l(42L))183 self.assertRaises(OverflowError, getargs_l, VERY_LARGE)184185 def test_n(self):186 from _testcapi import getargs_n187 # n returns 'Py_ssize_t', and does range checking188 # (PY_SSIZE_T_MIN ... PY_SSIZE_T_MAX)189 self.failUnlessEqual(3, getargs_n(3.14))190 self.failUnlessEqual(99, getargs_n(Long()))191 self.failUnlessEqual(99, getargs_n(Int()))192193 self.assertRaises(OverflowError, getargs_n, PY_SSIZE_T_MIN-1)194 self.failUnlessEqual(PY_SSIZE_T_MIN, getargs_n(PY_SSIZE_T_MIN))195 self.failUnlessEqual(PY_SSIZE_T_MAX, getargs_n(PY_SSIZE_T_MAX))196 self.assertRaises(OverflowError, getargs_n, PY_SSIZE_T_MAX+1)197198 self.failUnlessEqual(42, getargs_n(42))199 self.failUnlessEqual(42, getargs_n(42L))200 self.assertRaises(OverflowError, getargs_n, VERY_LARGE)201202203class LongLong_TestCase(unittest.TestCase):204 def test_L(self):205 from _testcapi import getargs_L206 # L returns 'long long', and does range checking (LLONG_MIN ... LLONG_MAX)207 self.failUnlessRaises(TypeError, getargs_L, "Hello")208 self.failUnlessEqual(3, getargs_L(3.14))209 self.failUnlessEqual(99, getargs_L(Long()))210 self.failUnlessEqual(99, getargs_L(Int()))211212 self.assertRaises(OverflowError, getargs_L, LLONG_MIN-1)213 self.failUnlessEqual(LLONG_MIN, getargs_L(LLONG_MIN))214 self.failUnlessEqual(LLONG_MAX, getargs_L(LLONG_MAX))215 self.assertRaises(OverflowError, getargs_L, LLONG_MAX+1)216217 self.failUnlessEqual(42, getargs_L(42))218 self.failUnlessEqual(42, getargs_L(42L))219 self.assertRaises(OverflowError, getargs_L, VERY_LARGE)220221 def test_K(self):222 from _testcapi import getargs_K223 # K return 'unsigned long long', no range checking224 self.assertRaises(TypeError, getargs_K, 3.14)225 self.assertRaises(TypeError, getargs_K, Long())226 self.assertRaises(TypeError, getargs_K, Int())227 self.failUnlessEqual(ULLONG_MAX, getargs_K(ULLONG_MAX))228 self.failUnlessEqual(0, getargs_K(0))229 self.failUnlessEqual(0, getargs_K(ULLONG_MAX+1))230231 self.failUnlessEqual(42, getargs_K(42))232 self.failUnlessEqual(42, getargs_K(42L))233234 self.failUnlessEqual(VERY_LARGE & ULLONG_MAX, getargs_K(VERY_LARGE))235236237class Tuple_TestCase(unittest.TestCase):238 def test_tuple(self):239 from _testcapi import getargs_tuple240241 ret = getargs_tuple(1, (2, 3))242 self.assertEquals(ret, (1,2,3))243244 # make sure invalid tuple arguments are handled correctly245 class seq:246 def __len__(self):247 return 2248 def __getitem__(self, n):
...
test_mathutil.py
Source:test_mathutil.py
...10 for i in range(2, 5):11 self._help_test_is_power_of_k(i)12 def test_log_ceil(self):13 f = mathutil.log_ceil14 self.failUnlessEqual(f(1, 2), 0)15 self.failUnlessEqual(f(1, 3), 0)16 self.failUnlessEqual(f(2, 2), 1)17 self.failUnlessEqual(f(2, 3), 1)18 self.failUnlessEqual(f(3, 2), 2)19 def test_log_floor(self):20 f = mathutil.log_floor21 self.failUnlessEqual(f(1, 2), 0)22 self.failUnlessEqual(f(1, 3), 0)23 self.failUnlessEqual(f(2, 2), 1)24 self.failUnlessEqual(f(2, 3), 0)25 self.failUnlessEqual(f(3, 2), 1)26 def test_div_ceil(self):27 f = mathutil.div_ceil28 self.failUnlessEqual(f(0, 1), 0)29 self.failUnlessEqual(f(0, 2), 0)30 self.failUnlessEqual(f(0, 3), 0)31 self.failUnlessEqual(f(1, 3), 1)32 self.failUnlessEqual(f(2, 3), 1)33 self.failUnlessEqual(f(3, 3), 1)34 self.failUnlessEqual(f(4, 3), 2)35 self.failUnlessEqual(f(5, 3), 2)36 self.failUnlessEqual(f(6, 3), 2)37 self.failUnlessEqual(f(7, 3), 3)38 self.failUnless(isinstance(f(0.0, 1), int))39 self.failUnlessEqual(f(7.0, 3.0), 3)40 self.failUnlessEqual(f(7, 3.0), 3)41 self.failUnlessEqual(f(7.0, 3), 3)42 self.failUnlessEqual(f(6.0, 3.0), 2)43 self.failUnlessEqual(f(6.0, 3), 2)44 self.failUnlessEqual(f(6, 3.0), 2)45 def test_next_multiple(self):46 f = mathutil.next_multiple47 self.failUnlessEqual(f(5, 1), 5)48 self.failUnlessEqual(f(5, 2), 6)49 self.failUnlessEqual(f(5, 3), 6)50 self.failUnlessEqual(f(5, 4), 8)51 self.failUnlessEqual(f(5, 5), 5)52 self.failUnlessEqual(f(5, 6), 6)53 self.failUnlessEqual(f(32, 1), 32)54 self.failUnlessEqual(f(32, 2), 32)55 self.failUnlessEqual(f(32, 3), 33)56 self.failUnlessEqual(f(32, 4), 32)57 self.failUnlessEqual(f(32, 5), 35)58 self.failUnlessEqual(f(32, 6), 36)59 self.failUnlessEqual(f(32, 7), 35)60 self.failUnlessEqual(f(32, 8), 32)61 self.failUnlessEqual(f(32, 9), 36)62 self.failUnlessEqual(f(32, 10), 40)63 self.failUnlessEqual(f(32, 11), 33)64 self.failUnlessEqual(f(32, 12), 36)65 self.failUnlessEqual(f(32, 13), 39)66 self.failUnlessEqual(f(32, 14), 42)67 self.failUnlessEqual(f(32, 15), 45)68 self.failUnlessEqual(f(32, 16), 32)69 self.failUnlessEqual(f(32, 17), 34)70 self.failUnlessEqual(f(32, 18), 36)71 self.failUnlessEqual(f(32, 589), 589)72 def test_pad_size(self):73 f = mathutil.pad_size74 self.failUnlessEqual(f(0, 4), 0)75 self.failUnlessEqual(f(1, 4), 3)76 self.failUnlessEqual(f(2, 4), 2)77 self.failUnlessEqual(f(3, 4), 1)78 self.failUnlessEqual(f(4, 4), 0)79 self.failUnlessEqual(f(5, 4), 3)80 def test_is_power_of_k_part_2(self):81 f = mathutil.is_power_of_k82 for i in range(1, 100):83 if i in (1, 2, 4, 8, 16, 32, 64):84 self.failUnless(f(i, 2), "but %d *is* a power of 2" % i)85 else:86 self.failIf(f(i, 2), "but %d is *not* a power of 2" % i)87 for i in range(1, 100):88 if i in (1, 3, 9, 27, 81):89 self.failUnless(f(i, 3), "but %d *is* a power of 3" % i)90 else:91 self.failIf(f(i, 3), "but %d is *not* a power of 3" % i)92 def test_next_power_of_k(self):93 f = mathutil.next_power_of_k94 self.failUnlessEqual(f(0,2), 1)95 self.failUnlessEqual(f(1,2), 1)96 self.failUnlessEqual(f(2,2), 2)97 self.failUnlessEqual(f(3,2), 4)98 self.failUnlessEqual(f(4,2), 4)99 for i in range(5, 8): self.failUnlessEqual(f(i,2), 8, "%d" % i)100 for i in range(9, 16): self.failUnlessEqual(f(i,2), 16, "%d" % i)101 for i in range(17, 32): self.failUnlessEqual(f(i,2), 32, "%d" % i)102 for i in range(33, 64): self.failUnlessEqual(f(i,2), 64, "%d" % i)103 for i in range(65, 100): self.failUnlessEqual(f(i,2), 128, "%d" % i)104 self.failUnlessEqual(f(0,3), 1)105 self.failUnlessEqual(f(1,3), 1)106 self.failUnlessEqual(f(2,3), 3)107 self.failUnlessEqual(f(3,3), 3)108 for i in range(4, 9): self.failUnlessEqual(f(i,3), 9, "%d" % i)109 for i in range(10, 27): self.failUnlessEqual(f(i,3), 27, "%d" % i)110 for i in range(28, 81): self.failUnlessEqual(f(i,3), 81, "%d" % i)111 for i in range(82, 200): self.failUnlessEqual(f(i,3), 243, "%d" % i)112 def test_ave(self):113 f = mathutil.ave114 self.failUnlessEqual(f([1,2,3]), 2)115 self.failUnlessEqual(f([0,0,0,4]), 1)116 self.failUnlessAlmostEqual(f([0.0, 1.0, 1.0]), .666666666666)117 def failUnlessEqualContents(self, a, b):118 self.failUnlessEqual(sorted(a), sorted(b))119 def test_permute(self):120 f = mathutil.permute121 self.failUnlessEqualContents(f([]), [])122 self.failUnlessEqualContents(f([1]), [[1]])123 self.failUnlessEqualContents(f([1,2]), [[1,2], [2,1]])124 self.failUnlessEqualContents(f([1,2,3]),125 [[1,2,3], [1,3,2],126 [2,1,3], [2,3,1],...
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!!