Vladmodels Katya Y117 47 154 -

if brand != "vladmodels": raise ValueError(f"Brand must be 'vladmodels', got 'brand'")

def test_non_numeric(): with pytest.raises(ValueError, match="must be integer numbers"): parse_vladmodels_spec("vladmodels katya y117 forty seven 154") Run with:

@dataclass(frozen=True, slots=True) class VladModel: """A tiny data‑class representing a single VladModels product.""" brand: str # e.g. "vladmodels" name: str # e.g. "katya" code: str # e.g. "y117" width_mm: int # first numeric value (mm) height_mm: int # second numeric value (mm) vladmodels katya y117 47 154

from vladmodel_parser import parse_vladmodels_spec

def test_basic_parsing(): raw = "vladmodels katya y117 47 154" model = parse_vladmodels_spec(raw) assert model == VladModel( brand="vladmodels", name="katya", code="y117", width_mm=47, height_mm=154, ) assert model.area_mm2 == 47 * 154 if brand

vladmodels katya y117 47 154 – into a useful data object and does a small bit of domain‑specific work (calculating the “size” of the product).

def test_invalid_brand(): with pytest.raises(ValueError, match="Brand must be 'vladmodels'"): parse_vladmodels_spec("othermodels katya y117 47 154") "y117" width_mm: int # first numeric value (mm)

import pytest from vladmodel_parser import parse_vladmodels_spec, VladModel