Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def get_item_data(file_name: str) -> dict:
SPELLED_ITEM = get_item_data("spelled_item")
PAINTED_HAT = get_item_data("painted_hat")
ELLIS_CAP = get_item_data("ellis_cap")
STRANGE_PART = get_item_data("strange_part")


@pytest.fixture
Expand Down Expand Up @@ -84,6 +85,11 @@ def ellis_cap() -> dict:
return ELLIS_CAP


@pytest.fixture
def strange_part() -> dict:
return STRANGE_PART


@pytest.fixture
async def aiohttp_session():
async with ClientSession() as session:
Expand Down
2 changes: 1 addition & 1 deletion src/tf2_utils/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# flake8: noqa: F401, F403
__title__ = "tf2-utils"
__author__ = "offish"
__version__ = "2.4.1"
__version__ = "2.4.2"
__license__ = "MIT"

from .currency import CurrencyExchange
Expand Down
2 changes: 1 addition & 1 deletion src/tf2_utils/item.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def has_quality(self, quality: str) -> bool:
return self.get_quality() == quality

def has_strange_in_name(self) -> bool:
return "Strange" in self.name
return "Strange " in self.name and "Strange Part: " not in self.name

def has_vintage_in_name(self) -> bool:
return "Vintage" in self.name
Expand Down
16 changes: 16 additions & 0 deletions tests/test_sku.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,25 @@ def test_ellis_cap_sku_properties(ellis_cap: dict) -> None:
}


def test_strange_part_sku_properties(strange_part: dict) -> None:
assert get_sku_properties(strange_part) == {
"defindex": 6012,
"quality": 6,
"australium": False,
"craftable": True,
"wear": -1,
"killstreak_tier": -1,
"festivized": False,
"strange": False,
}


def test_get_sku_items(
ellis_cap: dict,
crusaders_crossbow: dict,
hong_kong_cone: dict,
uncraftable_hat: dict,
strange_part: dict,
) -> None:
# https://marketplace.tf/items/tf2/263;6
assert get_sku(ellis_cap) == "263;6"
Expand All @@ -41,6 +55,8 @@ def test_get_sku_items(
assert get_sku(hong_kong_cone) == "30177;5;u107;strange"
# https://marketplace.tf/items/tf2/734;6;uncraftable
assert get_sku(uncraftable_hat) == "734;6;uncraftable"
# https://marketplace.tf/items/tf2/6012;6
assert get_sku(strange_part) == "6012;6"


def test_properties() -> None:
Expand Down