(self)
| 428 | |
| 429 | |
| 430 | def testComparisonChain(self): |
| 431 | splootFile = splootFromPython(''' |
| 432 | print(5 > 4 > 2) |
| 433 | print(5 > 4 < 10) |
| 434 | print(5 > 3 == 3) |
| 435 | print(3 == 3 == 0) |
| 436 | print(3 == 3 == True) |
| 437 | print(1 + 3 == 4 == 2 + 2 == 8 / 2) |
| 438 | print(3 == 3 == 3 and True) |
| 439 | print(False or 3 == 3 == True) |
| 440 | ''') |
| 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 |
| 450 | True |
| 451 | True |
| 452 | False |
| 453 | False |
| 454 | True |
| 455 | True |
| 456 | False |
| 457 | """) |
| 458 | |
| 459 | def testSlice(self): |
| 460 | splootFile = splootFromPython('''x = [1, 2, 3, 4, 5]\nprint(x[1:3])''') |
nothing calls this directly
no test coverage detected