-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test character configuration on the user interface
Signed-off-by: Shounak Dey <[email protected]>
- Loading branch information
1 parent
55900ac
commit 410cff9
Showing
2 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |