(capsys)
| 68 | |
| 69 | |
| 70 | def test_displayDisk(capsys): |
| 71 | # Test displaying an empty pole: |
| 72 | towerofhanoi.displayDisk(0) |
| 73 | captured = capsys.readouterr() |
| 74 | assert captured.out == ' || ' |
| 75 | |
| 76 | # Test displaying a disk: |
| 77 | towerofhanoi.displayDisk(1) |
| 78 | captured = capsys.readouterr() |
| 79 | assert captured.out == ' @_1@ ' |
| 80 | |
| 81 | towerofhanoi.displayDisk(2) |
| 82 | captured = capsys.readouterr() |
| 83 | assert captured.out == ' @@_2@@ ' |
| 84 | |
| 85 | towerofhanoi.displayDisk(3) |
| 86 | captured = capsys.readouterr() |
| 87 | assert captured.out == ' @@@_3@@@ ' |
| 88 | |
| 89 | towerofhanoi.displayDisk(4) |
| 90 | captured = capsys.readouterr() |
| 91 | assert captured.out == ' @@@@_4@@@@ ' |
| 92 | |
| 93 | towerofhanoi.displayDisk(5) |
| 94 | captured = capsys.readouterr() |
| 95 | assert captured.out == '@@@@@_5@@@@@' |
| 96 | |
| 97 | |
| 98 | def test_displayTowers(capsys): |
nothing calls this directly
no outgoing calls
no test coverage detected