From 1168727915fa565c7b4cd63e2cd7c0b499437280 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20S=C3=A1nchez=20de=20Le=C3=B3n=20Peque?= Date: Thu, 22 Mar 2018 00:16:47 +0100 Subject: [PATCH] fixup! Add some tests and Travis integration --- test_mazes.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test_mazes.py b/test_mazes.py index 3829ed0..81420dc 100644 --- a/test_mazes.py +++ b/test_mazes.py @@ -1,6 +1,7 @@ """ Basic tests to ensure maze files are properly formatted. """ +from collections import Counter from pathlib import Path import re @@ -114,6 +115,15 @@ def test_boundaries(maze_file): assert all(h == '---' for h in north_boundary + south_boundary) +@all_mazes +def test_starting_cell_unique(maze_file): + """ + The starting cell, if marked, must be unique. + """ + rows = read_maze(maze_file) + assert Counter(''.join(rows))['S'] in (0, 1) + + @competition_mazes def test_starting_cell(maze_file): """