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

Method testSlice

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

Source from the content-addressed store, hash-verified

457""")
458
459 def testSlice(self):
460 splootFile = splootFromPython('''x = [1, 2, 3, 4, 5]\nprint(x[1:3])''')
461
462 f = io.StringIO()
463 f.write = wrapStdout(f.write)
464 with contextlib.redirect_stdout(f):
465 executePythonFile(splootFile)
466
467 f.seek(0)
468 res = f.read()
469 self.assertEqual(res, """[2, 3]\n""")

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