test_task1.py 425 Bytes
Newer Older
Adam Blank's avatar
Adam Blank committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import pytest
from helpers.test_helpers import *


@pytest.mark.parametrize('player, expected', [
    (0, 1),
    (1, 0),
])
def test_get_opponent(player, expected):
    assert task1.get_opponent(player) == expected


@pytest.mark.parametrize('invalid_player', [
    -1,
    -2,
    2,
    3,
    1000,
    3.1415,
    9
])
def test_get_opponent_invalid_does_not_crash(invalid_player):
    task1.get_opponent(invalid_player)