(self)
| 313 | self.assertEqual(f.read(), "() ('hi',) ('a', 'b')\n") |
| 314 | |
| 315 | def testSets(self): |
| 316 | splootFile = splootFromPython('''x = {1, 2, 1, 1} |
| 317 | y = set() |
| 318 | z = {"a", 'b'} |
| 319 | print(x, y, z) |
| 320 | ''') |
| 321 | |
| 322 | f = io.StringIO() |
| 323 | f.write = wrapStdout(f.write) |
| 324 | with contextlib.redirect_stdout(f): |
| 325 | executePythonFile(splootFile) |
| 326 | |
| 327 | f.seek(0) |
| 328 | # Order is not guaranteed for a set |
| 329 | self.assertIn(f.read(), [ |
| 330 | "{1, 2} set() {'a', 'b'}\n", |
| 331 | "{1, 2} set() {'b', 'a'}\n", |
| 332 | "{2, 1} set() {'a', 'b'}\n", |
| 333 | "{2, 1} set() {'b', 'a'}\n", |
| 334 | ]) |
| 335 | |
| 336 | def testDictionaryAssignment(self): |
| 337 | splootFile = splootFromPython('''x = {} |
nothing calls this directly
no test coverage detected