MCPcopy Create free account
hub / github.com/asweigart/PythonStdioGames / test_main

Function test_main

tests/test_towerofhanoi.py:61–67  ·  view source on GitHub ↗
(capsys)

Source from the content-addressed store, hash-verified

59
60
61def test_main(capsys):
62 # Test winning a game:
63 sys.stdin = io.StringIO('ab\nac\nbc\nab\nca\ncb\nab\nac\nbc\nba\nca\nbc\nab\nac\nbc\nab\nca\ncb\nab\nca\nbc\nba\nca\ncb\nab\nac\nbc\nab\nca\ncb\nab\n')
64 with pytest.raises(SystemExit):
65 towerofhanoi.main()
66 captured = capsys.readouterr()
67 assert 'You have solved the puzzle! Well done!' in captured.out
68
69
70def test_displayDisk(capsys):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected