Commit e47eea05 authored by Adam Blank's avatar Adam Blank
Browse files

Update test_9_is_valid_shot.py

parent 08f8f289
Pipeline #118953 failed with stage
in 0 seconds
Showing with 5 additions and 7 deletions
+5 -7
...@@ -2,19 +2,17 @@ import pytest ...@@ -2,19 +2,17 @@ import pytest
from src.harder_computer import is_valid_shot from src.harder_computer import is_valid_shot
from tests.helpers.naming import apply_names from tests.helpers.naming import apply_names
@pytest.mark.parametrize('input1, input2, expected', apply_names('is_valid_shot', [True, True, False], [ @pytest.mark.parametrize('input1, input2, expected', apply_names('is_valid_shot', [True, True, False], [
((0, 0), [], True), ((0, 0), [], True),
((-1, 0), [], False), ((-1, 0), [], False),
((8, 0), [], False), ((8, 0), [], False),
((0, -1), [], False), ((0, -1), [], False),
((0, 8), [], False), ((0, 8), [], False),
((0, 0), [(0,0)], False), ((0, 0), [(0, 0)], False),
((2, 5), [(0,0), (1,1), (2,5), (3,7)], False), ((2, 5), [(0, 0), (1, 1), (2, 5), (3, 7)], False),
((2, 5), [(0,0), (1,1), (3,7)], True), ((2, 5), [(0, 0), (1, 1), (3, 7)], True),
])) ]))
def test_is_valid_shot(input1, input2, expected): def test_is_valid_shot(input1, input2, expected):
result = is_valid_shot(input1, input2) result = is_valid_shot(input1, input2)
assert expected == result, (f"On an 8x8 board, the following inputs to the is_valid_shot " assert expected == result, f"shot={input1}, processed_shots={input2} should lead to {expected}"
f"function:\n{input1}, {input2}\nlead to the following output:"
f"\n{result}\nwhen we expect:\n{expected}.")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment