Skip to content

Commit

Permalink
Remove (*) from affixes before comparison (#393)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisoro authored Oct 16, 2024
1 parent e3d0dd9 commit aa43b33
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

TP = concurrent.futures.ThreadPoolExecutor()

__version__ = "5.8.7"
__version__ = "5.8.8"
2 changes: 1 addition & 1 deletion src/item/descr/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@ def clean_str(s: str) -> str:
cleaned_str = remove_text_after_first_keyword(cleaned_str, Dataloader().filter_after_keyword)
for s in Dataloader().filter_words:
cleaned_str = cleaned_str.replace(s, "")
cleaned_str = cleaned_str.replace("(", "").replace(")", "")
cleaned_str = cleaned_str[: cleaned_str.rfind("(")]
return " ".join(cleaned_str.split()).strip().lower() # Remove extra spaces
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 16 additions & 1 deletion tests/item/read_descr_season6_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,21 @@
rarity=ItemRarity.Legendary,
),
),
(
(1920, 1080),
f"{BASE_PATH}/1080p_small_read_descr_2.png",
Item(
affixes=[
Affix(name="dexterity", value=8.4),
Affix(name="movement_speed", value=20),
Affix(name="to_brilliance", value=2),
],
inherent=[Affix(name="resistance_to_all_elements", value=25, type=AffixType.inherent)],
item_type=ItemType.Amulet,
power=750,
rarity=ItemRarity.Legendary,
),
),
(
(2160, 1440),
f"{BASE_PATH}/1440p_small_read_descr_1.png",
Expand Down Expand Up @@ -173,7 +188,7 @@ def _run_test_helper(img_res: tuple[int, int], input_img: str, expected_item: It
assert item == expected_item


@pytest.mark.parametrize(("img_res", "input_img", "expected_item"), items[:1])
@pytest.mark.parametrize(("img_res", "input_img", "expected_item"), items)
def test_items(img_res: tuple[int, int], input_img: str, expected_item: Item):
_run_test_helper(img_res=img_res, input_img=input_img, expected_item=expected_item)

Expand Down

0 comments on commit aa43b33

Please sign in to comment.