def test2_doctest() -> None: """Test the given doctest in the Spinner class docstring.""" spinner = Spinner(12) spinner.spin(12) assert spinner.position == 0 spinner.spin(13) assert spinner.position == 1 spinner.spin(5) assert spinner.position == 6 spinner.spin(0) assert spinner.position == 6
def test_size_2_doctest() -> None: """Test the given doctest in the Spinner class docstring.""" spinner = Spinner(2) spinner.spin(2) assert spinner.position == 0 spinner.spin(1) assert spinner.position == 1 spinner.spin(6) assert spinner.position == 1
def test3_doctest() -> None: """Test the given doctest in the Spinner class docstring.""" spinner = Spinner(1) spinner.spin(0) assert spinner.position == 0 spinner.spin(1) assert spinner.position == 0 spinner.spin(2) assert spinner.position == 0
def test_doctest() -> None: """Test the given doctest in the Spinner class docstring.""" spinner = Spinner(8) spinner.spin(4) assert spinner.position == 4 spinner.spin(2) assert spinner.position == 6 spinner.spin(2) assert spinner.position == 0
def test_new_spinner_position(slots: int) -> None: """Test that the position of a new spinner is always 0.""" spinner = Spinner(slots) assert spinner.position == 0
def test_random_doctest2() -> None: spinner = Spinner(3) spinner.spin(4) spinner.spin_randomly() assert spinner.position == 1
def test_random_doctest() -> None: spinner = Spinner(2) spinner.spin_randomly() assert spinner.position in [0, 1]