Skip to content

Commit

Permalink
Test character configuration on the user interface
Browse files Browse the repository at this point in the history
Signed-off-by: Shounak Dey <[email protected]>
  • Loading branch information
sdglitched committed Sep 19, 2024
1 parent 55900ac commit 410cff9
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
Empty file added test/face/wind/char/__init__.py
Empty file.
40 changes: 40 additions & 0 deletions test/face/wind/char/test_char.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import pytest

from gi_loadouts.data.char import __charmaps__
from gi_loadouts.type.levl import Level


@pytest.mark.parametrize(
"name, vision, levl, cons_name, weapon, attack, defense, health_points, seco",
[
pytest.param(
char.name,
char.vision.value.name.title(),
char.levl.value.name,
char.cons_name,
char.weapon.value,
round(char.attack.stat_data),
round(char.defense.stat_data),
round(char.health_points.stat_data),
char.seco.stat_data,
id= f"face.wind.rule: Configuring character - {char.name}"
)for char in __charmaps__.values()
if setattr(char, 'levl', Level.Level_80_90_Rank_6) is None
]
)
def test_char(runner, name, levl, vision, cons_name, weapon, attack, defense, health_points, seco):
"""
Test the configuration of characters on the user interface
:return:
"""
runner.head_char_elem.setCurrentText(vision)
runner.head_char_name.setCurrentText(name)
runner.head_char_levl.setCurrentText(levl)
assert runner.head_area_line_prim.text() == name
assert runner.head_area_line_seco.text() == cons_name
assert runner.head_area_line_tert.text() == weapon
assert int(runner.head_char_data_attk.text()) == attack
assert int(runner.head_char_data_dfns.text()) == defense
assert int(runner.head_char_data_hlpt.text()) == health_points
assert float(runner.head_char_data_subs.text()) == seco

0 comments on commit 410cff9

Please sign in to comment.