File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11"""Test the single coin flip functionality from flip_coins"""
22
3+ import pytest
4+
35import src .flip_coins
46
57
@@ -13,3 +15,21 @@ def test_single_coin_flip() -> None:
1315 assert 0 <= result ["heads_count" ][0 ] <= 1
1416 assert 0 <= result ["tails_count" ][0 ] <= 1
1517 assert result ["heads_count" ][0 ] != result ["tails_count" ][0 ]
18+
19+
20+ def test_single_coin_flip_invalid_input_type () -> None :
21+ """Test the exception raising logic when given an invalid input type"""
22+ with pytest .raises (TypeError ):
23+ src .flip_coins .flip_coin (5 )
24+
25+
26+ def test_single_coin_flip_empty_string_value () -> None :
27+ """Test the exception raising logic when given an empty string value"""
28+ with pytest .raises (ValueError ):
29+ src .flip_coins .flip_coin ("" )
30+
31+
32+ def test_single_coin_flip_invalid_string_value () -> None :
33+ """Test the exception raising logic when given an invalid string value"""
34+ with pytest .raises (ValueError ):
35+ src .flip_coins .flip_coin ("this_is_invalid" )
You can’t perform that action at this time.
0 commit comments