mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-22 15:16:33 -08:00
Python: Add Continuous Integration for Python
There are a lot of exceptions, but it's a start. This will ensure that no more issues get added / that issues get fixed before the code is added
This commit is contained in:
27
02_Amazing/python/test_amazing.py
Normal file
27
02_Amazing/python/test_amazing.py
Normal file
@@ -0,0 +1,27 @@
|
||||
import pytest
|
||||
from amazing import build_maze, welcome_header
|
||||
|
||||
|
||||
def test_welcome_header(capsys):
|
||||
assert welcome_header() == 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)
|
||||
Reference in New Issue
Block a user