Files
basic-computer-games/02_Amazing/python/test_amazing.py
Martin Thoma 0ba0307767 Python: Fix linting issues
The following Flake8 issues were fixed:

* W291
* W504

* F821
* F401
* F541

* E402
* E711
2022-03-14 13:13:20 +01:00

28 lines
605 B
Python

import pytest
from amazing import build_maze, welcome_header
def test_welcome_header(capsys):
assert welcome_header() is None
out, err = capsys.readouterr()
assert out == (
" AMAZING PROGRAM\n"
" CREATIVE COMPUTING MORRISTOWN, NEW JERSEY\n\n\n\n"
)
assert err == ""
@pytest.mark.parametrize(
("width", "length"),
[
(1, 1),
(1, 0),
(1, -1),
(1, 2),
(2, 1),
],
)
def test_build_maze(width, length):
with pytest.raises(AssertionError):
build_maze(width, length)