MCPcopy Create free account
hub / github.com/SplootCode/splootcode / testComparisonChain

Method testComparisonChain

python/tests/test_execute.py:430–457  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

428
429
430 def testComparisonChain(self):
431 splootFile = splootFromPython('''
432print(5 > 4 > 2)
433print(5 > 4 < 10)
434print(5 > 3 == 3)
435print(3 == 3 == 0)
436print(3 == 3 == True)
437print(1 + 3 == 4 == 2 + 2 == 8 / 2)
438print(3 == 3 == 3 and True)
439print(False or 3 == 3 == True)
440''&#x27;)
441
442 f = io.StringIO()
443 f.write = wrapStdout(f.write)
444 with contextlib.redirect_stdout(f):
445 executePythonFile(splootFile)
446
447 f.seek(0)
448 res = f.read()
449 self.assertEqual(res, """True
450True
451True
452False
453False
454True
455True
456False
457""")
458
459 def testSlice(self):
460 splootFile = splootFromPython('''x = [1, 2, 3, 4, 5]\nprint(x[1:3])''')

Callers

nothing calls this directly

Calls 4

splootFromPythonFunction · 0.90
wrapStdoutFunction · 0.90
executePythonFileFunction · 0.90
readMethod · 0.80

Tested by

no test coverage detected