Skip to content

Commit

Permalink
Add tests for n_arrows Round attribute.
Browse files Browse the repository at this point in the history
  • Loading branch information
jatkinson1000 committed Dec 27, 2024
1 parent 8f65cbe commit 33b5916
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions archeryutils/tests/test_rounds.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,41 @@ def test_equality_different_object(self) -> None:

assert round_ != ("Test", [pass_, pass_])

@pytest.mark.parametrize(
"passes,result",
[
pytest.param(
[
Pass.at_target(100, "5_zone", 122, 50, False),
Pass.at_target(100, "5_zone", 122, 40, False),
Pass.at_target(100, "5_zone", 122, 30, False),
],
300,
),
pytest.param(
[
Pass.at_target(100, "5_zone", 122, 50, False),
],
100,
),
pytest.param(
[
Pass.at_target(100, "5_zone", 122, 50, False),
Pass.at_target(50, "5_zone", 122, 40, False),
Pass.at_target(25, "5_zone", 80, 30, False),
],
175,
),
],
)
def test_n_arrows(self, passes: Iterable, result: int) -> None:
"""Check that n_arrows attribute is calculated correctly for a Round."""
test_round = Round(
"MyRound",
passes,
)
assert test_round.n_arrows == result

def test_max_score(self) -> None:
"""Check that max score is calculated correctly for a Round."""
test_round = Round(
Expand Down

0 comments on commit 33b5916

Please sign in to comment.