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

Method testDictionaryAssignment

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

Source from the content-addressed store, hash-verified

334 ])
335
336 def testDictionaryAssignment(self):
337 splootFile = splootFromPython('''x = {}
338x['fred'] = 'blogs'
339x[('foo', 'bar')] = ['list', 'of', 'things']
340print(x)
341''')
342
343 f = io.StringIO()
344 f.write = wrapStdout(f.write)
345 with contextlib.redirect_stdout(f):
346 executePythonFile(splootFile)
347
348 f.seek(0)
349 self.assertEqual(f.read(), "{'fred': 'blogs', ('foo', 'bar'): ['list', 'of', 'things']}\n")
350
351 def testReturnBare(self):
352 splootFile = splootFromPython('''

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