From 83765087a9fe3ee61a9078320edc18ff1ed43369 Mon Sep 17 00:00:00 2001 From: Lev Date: Sat, 4 Nov 2023 10:04:12 +0300 Subject: [PATCH] Remove `ikea_api.get_items()` (closes #199), iows items endpoint (closes #202), `ikea_api.utils.unshorten_urls_from_ingka_pagelinks()` (#203) `ikea_api.get_items()` is practically useless now that iows items endpoint is unavailable. `ikea_api.utils.unshorten_urls_from_ingka_pagelinks()` is likely to be confusing and unpopular, so removing it too. --- README.md | 13 +- src/ikea_api/__init__.py | 2 - src/ikea_api/endpoints/iows_items.py | 87 -- src/ikea_api/utils.py | 32 +- src/ikea_api/wrappers/parsers/iows_items.py | 238 ----- src/ikea_api/wrappers/wrappers.py | 104 +-- tests/conftest.py | 1 - .../item_iows/CatalogRef is not list.json | 327 ------- ...dict, RetailItemCommChild is not list.json | 321 ------- tests/data/item_iows/combination.json | 861 ------------------ tests/data/item_iows/default.json | 593 ------------ tests/data/item_iows/no CatalogRef.json | 237 ----- .../no RetailItemCommPackageMeasureList.json | 826 ----------------- .../data/item_iows/no valid design text.json | 543 ----------- tests/endpoints/test_iows_items.py | 96 -- tests/test_init.py | 2 +- tests/test_utils.py | 34 +- tests/wrappers/parsers/test_item_iows.py | 243 ----- tests/wrappers/test_wrappers.py | 211 +---- 19 files changed, 8 insertions(+), 4763 deletions(-) delete mode 100644 src/ikea_api/endpoints/iows_items.py delete mode 100644 src/ikea_api/wrappers/parsers/iows_items.py delete mode 100644 tests/data/item_iows/CatalogRef is not list.json delete mode 100644 tests/data/item_iows/ImageUrl is dict, RetailItemCommChild is not list.json delete mode 100644 tests/data/item_iows/combination.json delete mode 100644 tests/data/item_iows/default.json delete mode 100644 tests/data/item_iows/no CatalogRef.json delete mode 100644 tests/data/item_iows/no RetailItemCommPackageMeasureList.json delete mode 100644 tests/data/item_iows/no valid design text.json delete mode 100644 tests/endpoints/test_iows_items.py delete mode 100644 tests/wrappers/parsers/test_item_iows.py diff --git a/README.md b/README.md index db2a3ee6..54dc9275 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ With this library you can access following IKEA's APIs: - Cart, - Home Delivery and Collect Services (actually, Order Capture), -- Items info (3 different services), +- Items info (2 services), - 3D models, - Purchases (history and order info), - Search, @@ -254,12 +254,9 @@ purchases.order_info( ### 🪑 Item info -Get item specification by item code (product number or whatever). There are 3 endpoints to do this because you can't get all the data about all the items using only one endpoint. +Get item specification by item code (product number or whatever). There are 2 endpoints to do this because you can't get all the data about all the items using only one endpoint. ```python -iows_items = ikea_api.IowsItems(constants) -iows_items.get_items(["30457903"]) - ingka_items = ikea_api.IngkaItems(constants) ingka_items.get_items(["30457903"]) @@ -267,12 +264,6 @@ pip_item = ikea_api.PipItem(constants) pip_item.get_item("30457903") ``` -> 💡 You probably won't want to use raw APIs when there's convenient "smart" wrapper that combines them all and parses basic info: -> -> ```python -> await ikea_api.get_items(["30457903"]) -> ``` - ### 📦 Item 3D models Get 3D models by item code. diff --git a/src/ikea_api/__init__.py b/src/ikea_api/__init__.py index ca23ca15..5961a283 100644 --- a/src/ikea_api/__init__.py +++ b/src/ikea_api/__init__.py @@ -2,7 +2,6 @@ from ikea_api.endpoints.auth import Auth as Auth from ikea_api.endpoints.cart import Cart as Cart from ikea_api.endpoints.ingka_items import IngkaItems as IngkaItems -from ikea_api.endpoints.iows_items import IowsItems as IowsItems from ikea_api.endpoints.order_capture import OrderCapture as OrderCapture from ikea_api.endpoints.order_capture import ( convert_cart_to_checkout_items as convert_cart_to_checkout_items, @@ -35,6 +34,5 @@ from ikea_api.wrappers.wrappers import ( get_delivery_services as get_delivery_services, ) - from ikea_api.wrappers.wrappers import get_items as get_items from ikea_api.wrappers.wrappers import get_purchase_history as get_purchase_history from ikea_api.wrappers.wrappers import get_purchase_info as get_purchase_info diff --git a/src/ikea_api/endpoints/iows_items.py b/src/ikea_api/endpoints/iows_items.py deleted file mode 100644 index a0b83c9f..00000000 --- a/src/ikea_api/endpoints/iows_items.py +++ /dev/null @@ -1,87 +0,0 @@ -from __future__ import annotations - -from typing import Any, Dict - -from ikea_api.abc import Endpoint, RequestInfo, ResponseInfo, SessionInfo, endpoint -from ikea_api.base_ikea_api import BaseIkeaAPI -from ikea_api.exceptions import ItemFetchError, WrongItemCodeError - -ItemCodeToComboDict = Dict[str, bool] - - -def _build_url(items: ItemCodeToComboDict) -> str: - return ";".join( - f"{'SPR' if is_combintaion else 'ART'},{item_code}" - for item_code, is_combintaion in items.items() - ) - - -class IowsItems(BaseIkeaAPI): - items: ItemCodeToComboDict - - def _get_session_info(self) -> SessionInfo: - url = f"https://iows.ikea.com/retail/iows/{self._const.country}/{self._const.language}/catalog/items/" - headers = self._extend_default_headers( - { - "Accept": "application/vnd.ikea.iows+json;version=2.0", - "Referer": f"{self._const.local_base_url}/shoppinglist/", - "consumer": "MAMMUT#ShoppingCart", - "contract": "37249", - } - ) - return SessionInfo(base_url=url, headers=headers) - - def _build_request(self) -> RequestInfo: - return self._RequestInfo("GET", _build_url(self.items)) - - def _handle_response( - self, response: ResponseInfo, relapse: int - ) -> list[dict[str, Any]] | None: - if response.status_code == 404 and len(self.items) == 1: - if relapse != 0: - raise WrongItemCodeError(response) - - item_code = list(self.items.keys())[0] - self.items[item_code] = not self.items[item_code] - return - - if not response.text: - return - - if "ErrorList" not in response.json or relapse == 2: - if "RetailItemCommList" in response.json: - return response.json["RetailItemCommList"]["RetailItemComm"] - return [response.json["RetailItemComm"]] - - errors: list[dict[str, Any]] | dict[str, Any] = response.json["ErrorList"][ - "Error" - ] - if isinstance(errors, dict): - errors = [errors] - - for err in errors: - if err.get("ErrorCode", {}).get("$") != 1101: - # Not error with item type - raise ItemFetchError(response, err) - - err_list: dict[str, Any] = { - attr["Name"]["$"]: attr["Value"]["$"] - for attr in err["ErrorAttributeList"]["ErrorAttribute"] - } - item_code = str(err_list["ITEM_NO"]) - if relapse == 0: # Probably wrong item type: try to switch it - self.items[item_code] = err_list["ITEM_TYPE"] == "ART" - else: # Nope, item is invalid - del self.items[item_code] - - @endpoint() - def get_items(self, item_codes: list[str]) -> Endpoint[list[dict[str, Any]]]: - self.items = {i: False for i in item_codes} - - for relapse in range(3): - response = yield self._build_request() - data = self._handle_response(response, relapse) - if data is not None: - return data - - raise NotImplementedError diff --git a/src/ikea_api/utils.py b/src/ikea_api/utils.py index f01343e2..82b4740c 100644 --- a/src/ikea_api/utils.py +++ b/src/ikea_api/utils.py @@ -1,14 +1,10 @@ from __future__ import annotations -import asyncio import re -from typing import TYPE_CHECKING, Any, Iterable, Optional, cast +from typing import Any from ikea_api.constants import Constants -if TYPE_CHECKING: - import httpx - def parse_item_codes(item_codes: list[str] | str) -> list[str]: raw_res: list[str] = re.findall( @@ -19,32 +15,6 @@ def parse_item_codes(item_codes: list[str] | str) -> list[str]: return list(dict.fromkeys(regex.sub("", i) for i in raw_res)) -def _parse_ingka_pagelink_urls(message: str) -> Iterable[str]: - base_url = "https://ingka.page.link/" - postfixes = re.findall("ingka.page.link/([0-9A-z]+)", message) - for postfix in postfixes: - yield base_url + postfix - - -def _get_location_headers(responses: Iterable[httpx.Response]) -> list[str]: - res: list[str] = [] - for response in responses: - location = cast(Optional[str], response.headers.get("Location")) # type: ignore - if location is not None: - res.append(location) - return res - - -async def unshorten_urls_from_ingka_pagelinks(message: str) -> list[str]: - import httpx - - client = httpx.AsyncClient() - urls = _parse_ingka_pagelink_urls(message) - coros = (client.get(url, follow_redirects=False) for url in urls) # type: ignore - responses = await asyncio.gather(*coros) - return _get_location_headers(responses) - - def format_item_code(item_code: str) -> str | None: matches = parse_item_codes(item_code) if not matches: diff --git a/src/ikea_api/wrappers/parsers/iows_items.py b/src/ikea_api/wrappers/parsers/iows_items.py deleted file mode 100644 index 273221c4..00000000 --- a/src/ikea_api/wrappers/parsers/iows_items.py +++ /dev/null @@ -1,238 +0,0 @@ -import json -import re -from typing import Any, Dict, List, Optional, Union, cast - -from pydantic import BaseModel - -from ikea_api.constants import Constants -from ikea_api.wrappers import types -from ikea_api.wrappers.parsers.item_base import ( - ItemCode, - ItemType, - get_is_combination_from_item_type, -) - - -class CatalogElement(BaseModel): - CatalogElementName: Union[str, Dict[Any, Any]] - CatalogElementId: Union[int, str, Dict[Any, Any]] - - -class CatalogElementList(BaseModel): - CatalogElement: Union[CatalogElement, List[CatalogElement]] - - -class Catalog(BaseModel): - CatalogElementList: CatalogElementList - - -class CatalogRefList(BaseModel): - CatalogRef: Optional[Union[List[Catalog], Catalog]] - - -class Image(BaseModel): - ImageUrl: Union[str, Dict[Any, Any]] - ImageType: str - ImageSize: str - - -class RetailItemImageList(BaseModel): - RetailItemImage: List[Image] - - -class Measurement(BaseModel): - PackageMeasureType: str - PackageMeasureTextMetric: str - - -class RetailItemCommPackageMeasureList(BaseModel): - RetailItemCommPackageMeasure: List[Measurement] - - -class GenericItem(BaseModel): - ItemNo: ItemCode - ProductName: str - ProductTypeName: str - - -class ChildItem(GenericItem): - Quantity: int - # For `get_name` - ItemMeasureReferenceTextMetric: None = None - ValidDesignText: None = None - RetailItemCommPackageMeasureList: Optional[RetailItemCommPackageMeasureList] - - -class RetailItemCommChildList(BaseModel): - RetailItemCommChild: Union[List[ChildItem], ChildItem] - - -class Price(BaseModel): - Price: int - - -class RetailItemCommPriceList(BaseModel): - RetailItemCommPrice: Union[Price, List[Price]] - - -class ResponseIowsItem(GenericItem): - ItemType: ItemType - CatalogRefList: CatalogRefList - ItemMeasureReferenceTextMetric: Optional[str] - ValidDesignText: Optional[str] - RetailItemCommPackageMeasureList: Optional[RetailItemCommPackageMeasureList] - RetailItemImageList: RetailItemImageList - RetailItemCommChildList: Optional[RetailItemCommChildList] - RetailItemCommPriceList: RetailItemCommPriceList - - -def get_rid_of_dollars(d: Dict[str, Any]) -> Dict[str, Any]: - return json.loads( - re.sub( - pattern=r'{"\$": ([^}]+)}', - repl=lambda x: x.group(1) if x.group(1) else "", - string=json.dumps(d), - ) - ) - - -def get_name(item: Union[ChildItem, ResponseIowsItem]) -> str: - return ", ".join( - part - for part in ( - item.ProductName, - item.ProductTypeName.capitalize(), - item.ValidDesignText, - item.ItemMeasureReferenceTextMetric, - ) - if part - ) - - -def get_image_url(constants: Constants, images: List[Image]) -> Optional[str]: - # Filter images first in case no image with S5 size found - images = [ - i - for i in images - if i.ImageType != "LINE DRAWING" - and isinstance(i.ImageUrl, str) - and i.ImageUrl.endswith((".png", ".jpg", ".PNG", ".JPG")) - ] - if not images: - return - - for image in images: - if image.ImageSize == "S5": - return constants.base_url + cast(str, image.ImageUrl) - return constants.base_url + cast(str, images[0].ImageUrl) - - -def parse_weight(v: str) -> float: - matches = re.findall(r"[0-9.,]+", v) - if matches: - return float(matches[0]) - return 0.0 - - -def get_weight(measurements: List[Measurement]) -> float: - weight = 0.0 - if not measurements: - return weight - - for m in measurements: - if m.PackageMeasureType == "WEIGHT": - weight += parse_weight(m.PackageMeasureTextMetric) - return weight - - -def get_child_items( - child_items: Union[List[ChildItem], ChildItem] -) -> List[types.ChildItem]: - if not child_items: - return [] - if isinstance(child_items, ChildItem): - child_items = [child_items] - - return [ - types.ChildItem( - name=get_name(child), - item_code=child.ItemNo, - weight=get_weight( - child.RetailItemCommPackageMeasureList.RetailItemCommPackageMeasure - if child.RetailItemCommPackageMeasureList - else [] - ), - qty=child.Quantity, - ) - for child in child_items - ] - - -def get_price(prices: Union[Price, List[Price]]) -> int: - if not prices: - return 0 - if isinstance(prices, list): - return min(p.Price for p in prices) - return prices.Price - - -def get_url(constants: Constants, item_code: str, is_combination: bool) -> str: - suffix = "s" if is_combination else "" - return f"{constants.local_base_url}/p/-{suffix}{item_code}" - - -def get_category_name_and_url( - constants: Constants, catalogs: Optional[Union[List[Catalog], Catalog]] -): - if not catalogs: - return None, None - if isinstance(catalogs, Catalog): - catalogs = [catalogs] - - idx = 0 if len(catalogs) == 1 else 1 - category = catalogs[idx].CatalogElementList.CatalogElement - if not category: - return None, None - if isinstance(category, list): - category = category[0] - if isinstance(category.CatalogElementName, dict) or isinstance( - category.CatalogElementId, dict - ): - return None, None - return ( - category.CatalogElementName, - f"{constants.local_base_url}/cat/-{category.CatalogElementId}", - ) - - -def parse_iows_item(constants: Constants, response: Dict[str, Any]) -> types.ParsedItem: - response = get_rid_of_dollars(response) - item = ResponseIowsItem(**response) - - is_combination = get_is_combination_from_item_type(item.ItemType) - weight = ( - get_weight(item.RetailItemCommPackageMeasureList.RetailItemCommPackageMeasure) - if item.RetailItemCommPackageMeasureList - else 0.0 - ) - child_items = ( - item.RetailItemCommChildList.RetailItemCommChild - if item.RetailItemCommChildList - else [] - ) - category_name, category_url = get_category_name_and_url( - constants, item.CatalogRefList.CatalogRef - ) - - return types.ParsedItem( - is_combination=is_combination, - item_code=item.ItemNo, - name=get_name(item), - image_url=get_image_url(constants, item.RetailItemImageList.RetailItemImage), - weight=weight, - child_items=get_child_items(child_items), - price=get_price(item.RetailItemCommPriceList.RetailItemCommPrice), - url=get_url(constants, item.ItemNo, is_combination), - category_name=category_name, - category_url=category_url, # type: ignore - ) diff --git a/src/ikea_api/wrappers/wrappers.py b/src/ikea_api/wrappers/wrappers.py index 45f8d52f..ded90e56 100644 --- a/src/ikea_api/wrappers/wrappers.py +++ b/src/ikea_api/wrappers/wrappers.py @@ -1,29 +1,22 @@ from __future__ import annotations import asyncio -from typing import Any, Iterable, List, Optional, cast +from typing import List, Optional from pydantic import BaseModel from ikea_api.constants import Constants from ikea_api.endpoints.cart import Cart -from ikea_api.endpoints.ingka_items import IngkaItems -from ikea_api.endpoints.iows_items import IowsItems from ikea_api.endpoints.order_capture import ( OrderCapture, convert_cart_to_checkout_items, ) -from ikea_api.endpoints.pip_item import PipItem from ikea_api.endpoints.purchases import Purchases from ikea_api.exceptions import GraphQLError from ikea_api.executors.httpx import run_async as run_with_httpx from ikea_api.executors.requests import run as run_with_requests -from ikea_api.utils import parse_item_codes, unshorten_urls_from_ingka_pagelinks from ikea_api.wrappers import types -from ikea_api.wrappers.parsers.ingka_items import parse_ingka_items -from ikea_api.wrappers.parsers.iows_items import parse_iows_item from ikea_api.wrappers.parsers.order_capture import parse_delivery_services -from ikea_api.wrappers.parsers.pip_item import parse_pip_item from ikea_api.wrappers.parsers.purchases import ( parse_costs_order, parse_history, @@ -128,98 +121,3 @@ async def get_delivery_services( return types.GetDeliveryServicesResponse( delivery_options=parsed_data, cannot_add=cannot_add ) - - -def chunks(list_: list[Any], chunk_size: int) -> Iterable[list[Any]]: - return (list_[i : i + chunk_size] for i in range(0, len(list_), chunk_size)) - - -async def _get_ingka_items( - constants: Constants, item_codes: list[str] -) -> list[types.IngkaItem]: - api = IngkaItems(constants) - tasks = (run_with_httpx(api.get_items(c)) for c in chunks(item_codes, 50)) - responses = await asyncio.gather(*tasks) - res: list[types.IngkaItem] = [] - for response in responses: - res += parse_ingka_items(constants, response) - return res - - -async def _get_pip_items( - constants: Constants, item_codes: list[str] -) -> list[types.PipItem | None]: - api = PipItem(constants) - tasks = (run_with_httpx(api.get_item(i)) for i in item_codes) - responses = await asyncio.gather(*tasks) - return [parse_pip_item(r) for r in responses] - - -def _get_pip_items_map(items: list[types.PipItem | None]) -> dict[str, types.PipItem]: - res: dict[str, types.PipItem] = {} - for item in items: - if item: - res[item.item_code] = item - return res - - -async def _get_ingka_pip_items( - constants: Constants, item_codes: list[str] -) -> list[types.ParsedItem]: - ingka_resp, pip_resp = await asyncio.gather( - _get_ingka_items(constants=constants, item_codes=item_codes), - _get_pip_items(constants=constants, item_codes=item_codes), - ) - pip_items_map = _get_pip_items_map(pip_resp) - - res: list[types.ParsedItem] = [] - for ingka_item in ingka_resp: - pip_item_ = pip_items_map.get(ingka_item.item_code) - if pip_item_ is None: - continue - item = types.ParsedItem( - is_combination=ingka_item.is_combination, - item_code=ingka_item.item_code, - name=ingka_item.name, - image_url=ingka_item.image_url, - weight=ingka_item.weight, - child_items=ingka_item.child_items, - price=pip_item_.price, - url=pip_item_.url, - category_name=pip_item_.category_name, - category_url=pip_item_.category_url, - ) - res.append(item) - return res - - -async def _get_iows_items( - constants: Constants, item_codes: list[str] -) -> list[types.ParsedItem]: - api = IowsItems(constants) - tasks = (run_with_httpx(api.get_items(c)) for c in chunks(item_codes, 90)) - responses = cast("tuple[list[dict[str, Any]], ...]", await asyncio.gather(*tasks)) - - res: list[types.ParsedItem] = [] - for items in responses: - res += (parse_iows_item(constants, i) for i in items) - return res - - -async def get_items( - constants: Constants, item_codes: list[str] -) -> list[types.ParsedItem]: - item_codes_ = item_codes.copy() - item_codes_ += await unshorten_urls_from_ingka_pagelinks( - str(item_codes) - ) # TODO: Don't do this - pending = parse_item_codes(item_codes_) - ingka_pip = await _get_ingka_pip_items(constants=constants, item_codes=pending) - - fetched = {i.item_code for i in ingka_pip} - pending = [i for i in pending if i not in fetched] - if not pending: - return ingka_pip - - iows = await _get_iows_items(constants=constants, item_codes=pending) - return ingka_pip + iows diff --git a/tests/conftest.py b/tests/conftest.py index 31198494..0824fbf4 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -40,7 +40,6 @@ def get_data_file(filename: str) -> Any: class TestData: item_ingka = get_data_files_in_directory("item_ingka") - item_iows = get_data_files_in_directory("item_iows") item_pip = get_data_files_in_directory("item_pip") order_capture_home = get_data_files_in_directory("order_capture/home") order_capture_collect = get_data_files_in_directory("order_capture/collect") diff --git a/tests/data/item_iows/CatalogRef is not list.json b/tests/data/item_iows/CatalogRef is not list.json deleted file mode 100644 index c3677c77..00000000 --- a/tests/data/item_iows/CatalogRef is not list.json +++ /dev/null @@ -1,327 +0,0 @@ -{ - "ItemNo": 20453514, - "ItemNoGlobal": 60448733, - "ItemType": "ART", - "ProductName": "БОАКСЕЛЬ", - "ProductTypeName": "Консоль", - "ValidDesignText": "белый", - "OnlineSellable": true, - "BreathTakingItem": false, - "ItemUnitCode": "PIECES", - "ItemNumberOfPackages": 1, - "AssemblyCode": "N", - "DesignerNameComm": "IKEA of Sweden", - "PriceUnitTextMetric": {}, - "GlobalisationContext": { "LanguageCodeIso": "ru", "CountryCodeIso": "ru" }, - "ClassUnitKey": { - "ClassType": "GR", - "ClassUnitType": "RU", - "ClassUnitCode": "RU" - }, - "RetailItemCommPriceList": { - "RetailItemCommPrice": { - "RetailPriceType": "RegularSalesUnitPrice", - "Price": 120, - "PriceExclTax": 100, - "CurrencyCode": "RUB" - } - }, - "RetailItemImageList": { - "RetailItemImage": [ - { - "ImageUsage": "INTERNET", - "ImageSize": "S1", - "ImageUrl": "/ru/ru/images/products/boaksel-konsol-__0798107_PE767176_S1.JPG", - "ImageWidth": 40, - "ImageHeight": 40, - "SortNo": 1, - "ImageType": "PICTURE SINGLE" - }, - { - "ImageUsage": "INTERNET", - "ImageSize": "S2", - "ImageUrl": "/ru/ru/images/products/boaksel-konsol-__0798107_PE767176_S2.JPG", - "ImageWidth": 110, - "ImageHeight": 110, - "SortNo": 1, - "ImageType": "PICTURE SINGLE" - }, - { - "ImageUsage": "INTERNET", - "ImageSize": "S3", - "ImageUrl": "/ru/ru/images/products/boaksel-konsol-__0798107_PE767176_S3.JPG", - "ImageWidth": 250, - "ImageHeight": 250, - "SortNo": 1, - "ImageType": "PICTURE SINGLE" - }, - { - "ImageUsage": "INTERNET", - "ImageSize": "S4", - "ImageUrl": "/ru/ru/images/products/boaksel-konsol-belyj__0798107_PE767176_S4.JPG", - "ImageWidth": 500, - "ImageHeight": 500, - "SortNo": 1, - "ImageType": "PICTURE SINGLE" - }, - { - "ImageUsage": "INTERNET", - "ImageSize": "S5", - "ImageUrl": "/ru/ru/images/products/boaksel-konsol-belyj__0798107_PE767176_S5.JPG", - "ImageWidth": 2000, - "ImageHeight": 2000, - "SortNo": 1, - "ImageType": "PICTURE SINGLE" - }, - { - "ImageUsage": "PRICE TAG", - "ImageSize": "S5", - "ImageUrl": "/ru/ru/images/products/boaksel-konsol-__0798106_PE767175.JPG", - "ImageWidth": 2000, - "ImageHeight": 2000, - "SortNo": 1, - "ImageType": "LINE DRAWING" - } - ] - }, - "AttributeGroupList": { - "AttributeGroup": { - "GroupName": "SEO", - "AttributeList": { - "Attribute": { - "Name": "DESCRIPTION", - "Value": "IKEA - БОАКСЕЛЬ, Консоль, Консоли БОАКСЕЛЬ устанавливаются на настенную шину просто до щелчка, инструменты не требуются.Внутренние элементы БОАКСЕЛЬ легко устанавливаются на консоль до щелчка без всяких инструментов.Внутренние элементы БОАКСЕЛЬ легко" - } - } - } - }, - "RetailItemCareInstructionList": { - "RetailItemCareInstruction": { - "SortNo": 1, - "RetailItemCareInstructionTextList": { - "RetailItemCareInstructionText": [ - { - "CareInstructionText": "Протирать тканью, смоченной мягким моющим средством.", - "SortNo": 1 - }, - { - "CareInstructionText": "Вытирать чистой сухой тканью.", - "SortNo": 2 - } - ] - } - } - }, - "RetailItemCustomerBenefitList": { - "RetailItemCustomerBenefit": [ - { - "CustomerBenefitText": "Консоли БОАКСЕЛЬ устанавливаются на настенную шину просто до щелчка, инструменты не требуются.", - "SortNo": 1 - }, - { - "CustomerBenefitText": "Внутренние элементы БОАКСЕЛЬ легко устанавливаются на консоль до щелчка без всяких инструментов.", - "SortNo": 2 - }, - { - "CustomerBenefitText": "Внутренние элементы БОАКСЕЛЬ легко установить или снять, поэтому вы без труда реорганизуете пространство, измените или переместите решение при необходимости или по желанию.", - "SortNo": 3 - }, - { - "CustomerBenefitText": "Аксессуары можно крепить с обеих сторон, что позволяет экономить место и создает стильное решение для хранения ваших вещей, кроме того, вам потребуется меньше консолей.", - "SortNo": 4 - }, - { - "CustomerBenefitText": "Товары серии БОАКСЕЛЬ можно использовать в помещениях с повешенным уровнем влажности, например в прачечной.", - "SortNo": 5 - } - ] - }, - "RetailItemGoodToKnowList": { - "RetailItemGoodToKnow": [ - { - "GoodToKnowTypeNameEn": "Compl. assembly information", - "GoodToKnowText": "Для решения с 1 секцией необходимы 2 консоли. Для решения с 2 секциями, необходимо 3 консоли: две по краям и одна в центре.", - "SortNo": 1, - "GoodToKnowHeader": "Сборка и установка" - }, - { - "GoodToKnowTypeNameEn": "Compl. assembly information", - "GoodToKnowText": "Крепежную планку при необходимости можно обрезать до нужной длины. Это применимо только при использовании более одной крепежной планки или для регулируемой платяной штанги и полки.", - "SortNo": 2, - "GoodToKnowHeader": "Сборка и установка" - }, - { - "GoodToKnowTypeNameEn": "Warning", - "GoodToKnowText": "Внимание! Не допускайте, чтобы товары БОАКСЕЛЬ непосредственно контактировали с водой.", - "SortNo": 3, - "GoodToKnowHeader": "Безопасность и соответствие:" - } - ] - }, - "RetailItemCustomerMaterialList": { - "RetailItemCustomerMaterial": { - "SortNo": 1, - "RetailItemPartMaterialList": { - "RetailItemPartMaterial": { - "MaterialText": "Сталь, Эпоксидное/полиэстерное порошковое покрытие", - "SortNo": 1 - } - } - } - }, - "RetailItemCommPackageMeasureList": { - "RetailItemCommPackageMeasure": [ - { - "PackageMeasureType": "WIDTH", - "PackageMeasureTextMetric": "8 см", - "PackageMeasureTextImperial": "3 ¼ дюйм", - "SortNo": 1, - "ConsumerPackNumber": 1 - }, - { - "PackageMeasureType": "HEIGHT", - "PackageMeasureTextMetric": "1 см", - "PackageMeasureTextImperial": "¼ дюйм", - "SortNo": 1, - "ConsumerPackNumber": 1 - }, - { - "PackageMeasureType": "LENGTH", - "PackageMeasureTextMetric": "40 см", - "PackageMeasureTextImperial": "15 ¾ дюйм", - "SortNo": 1, - "ConsumerPackNumber": 1 - }, - { - "PackageMeasureType": "WEIGHT", - "PackageMeasureTextMetric": "0.24 кг", - "PackageMeasureTextImperial": "9 унц", - "SortNo": 1, - "ConsumerPackNumber": 1 - } - ] - }, - "RetailItemCommMeasureList": { - "RetailItemCommMeasure": [ - { - "ItemMeasureType": "Width", - "ItemMeasureTypeName": "Ширина", - "ItemMeasureTextMetric": "40 см", - "ItemMeasureTextImperial": "15 ¾ дюйм", - "SortNo": 1 - }, - { - "ItemMeasureType": "Depth", - "ItemMeasureTypeName": "Глубина", - "ItemMeasureTextMetric": "40 см", - "ItemMeasureTextImperial": "15 ¾ дюйм", - "SortNo": 2 - } - ] - }, - "CatalogRefList": { - "CatalogRef": { - "Catalog": { - "CatalogId": "functional", - "CatalogName": "Функциональный", - "CatalogUrl": "/retail/iows/ru/ru/catalog/functional" - }, - "CatalogElementList": { - "CatalogElement": { - "CatalogElementId": 47395, - "CatalogElementType": "CATEGORY SYSTEM CHAPTER", - "CatalogElementName": "Части БОАКСЕЛЬ", - "CatalogElementUrl": "/retail/iows/ru/ru/catalog/functional/10364/47395" - } - } - } - }, - "PriceUnitTextMetricEn": {}, - "PriceUnitTextImperialEn": {}, - "ItemMeasureReferenceTextMetric": "40 см", - "ItemMeasureReferenceTextImperial": "15 ¾ дюйм", - "CatalogElementRelationList": { - "CatalogElementRelation": [ - { - "CatalogElementRelationType": "X-SELL", - "CatalogElementRelationSemantic": "MAY_BE_COMPLETED_WITH", - "CatalogElementId": 70453516, - "CatalogElementType": "ART", - "CatalogElementName": "БОАКСЕЛЬ", - "CatalogElementUrl": "/retail/iows/ru/ru/catalog/items/art,70453516", - "SortRelevanceList": { - "SortRelevance": { "SortNo": 1, "SortType": "RELEVANCE" } - } - }, - { - "CatalogElementRelationType": "X-SELL", - "CatalogElementRelationSemantic": "MAY_BE_COMPLETED_WITH", - "CatalogElementId": 30453518, - "CatalogElementType": "ART", - "CatalogElementName": "БОАКСЕЛЬ", - "CatalogElementUrl": "/retail/iows/ru/ru/catalog/items/art,30453518", - "SortRelevanceList": { - "SortRelevance": { "SortNo": 2, "SortType": "RELEVANCE" } - } - }, - { - "CatalogElementRelationType": "X-SELL", - "CatalogElementRelationSemantic": "MAY_BE_COMPLETED_WITH", - "CatalogElementId": 50453522, - "CatalogElementType": "ART", - "CatalogElementName": "БОАКСЕЛЬ", - "CatalogElementUrl": "/retail/iows/ru/ru/catalog/items/art,50453522", - "SortRelevanceList": { - "SortRelevance": { "SortNo": 3, "SortType": "RELEVANCE" } - } - }, - { - "CatalogElementRelationType": "X-SELL", - "CatalogElementRelationSemantic": "MAY_BE_COMPLETED_WITH", - "CatalogElementId": 10453524, - "CatalogElementType": "ART", - "CatalogElementName": "БОАКСЕЛЬ", - "CatalogElementUrl": "/retail/iows/ru/ru/catalog/items/art,10453524", - "SortRelevanceList": { - "SortRelevance": { "SortNo": 4, "SortType": "RELEVANCE" } - } - }, - { - "CatalogElementRelationType": "X-SELL", - "CatalogElementRelationSemantic": "MUST_BE_COMPLETED_WITH", - "CatalogElementId": 80453568, - "CatalogElementType": "ART", - "CatalogElementName": "БОАКСЕЛЬ", - "CatalogElementUrl": "/retail/iows/ru/ru/catalog/items/art,80453568", - "SortRelevanceList": { - "SortRelevance": { "SortNo": 1, "SortType": "RELEVANCE" } - } - }, - { - "CatalogElementRelationType": "X-SELL", - "CatalogElementRelationSemantic": "MUST_BE_COMPLETED_WITH", - "CatalogElementId": 40453570, - "CatalogElementType": "ART", - "CatalogElementName": "БОАКСЕЛЬ", - "CatalogElementUrl": "/retail/iows/ru/ru/catalog/items/art,40453570", - "SortRelevanceList": { - "SortRelevance": { "SortNo": 2, "SortType": "RELEVANCE" } - } - } - ] - }, - "RetailItemCustomerBenefitSummaryText": "Эти компактные консоли способны решать большие задачи в организации хранения в вашем доме. Аксессуары можно крепить с обеих сторон, что позволяет экономить место и создает стильное решение для хранения ваших вещей.", - "RetailItemFullLengthTextList": { "RetailItemFullLengthText": {} }, - "RetailItemFilterAttributeList": { - "RetailItemFilterAttribute": { - "FilterAttributeType": "Colour", - "FilterAttributeTypeName": "Цвет", - "FilterAttributeValueList": { - "FilterAttributeValue": { - "FilterAttributeValueId": 10156, - "FilterAttributeValueName": "белый" - } - } - } - } -} diff --git a/tests/data/item_iows/ImageUrl is dict, RetailItemCommChild is not list.json b/tests/data/item_iows/ImageUrl is dict, RetailItemCommChild is not list.json deleted file mode 100644 index bd40cf73..00000000 --- a/tests/data/item_iows/ImageUrl is dict, RetailItemCommChild is not list.json +++ /dev/null @@ -1,321 +0,0 @@ -{ - "ItemNo": { "$": 29481353 }, - "ItemNoGlobal": { "$": 29481353 }, - "ItemType": { "$": "SPR" }, - "ProductName": { "$": "ЛУРОЙ" }, - "ProductTypeName": { "$": "Реечное дно кровати" }, - "OnlineSellable": { "$": true }, - "BreathTakingItem": { "$": false }, - "ItemUnitCode": { "$": "PIECES" }, - "ItemNumberOfPackages": { "$": 2 }, - "AssemblyCode": { "$": "Y" }, - "DesignerNameComm": {}, - "PriceUnitTextMetric": {}, - "GlobalisationContext": { - "LanguageCodeIso": { "$": "ru" }, - "CountryCodeIso": { "$": "ru" } - }, - "ClassUnitKey": { - "ClassType": { "$": "GR" }, - "ClassUnitType": { "$": "RU" }, - "ClassUnitCode": { "$": "RU" } - }, - "RetailItemCommPriceList": { - "RetailItemCommPrice": { - "RetailPriceType": { "$": "RegularSalesUnitPrice" }, - "Price": { "$": 1600 }, - "PriceExclTax": { "$": 1333.34 }, - "CurrencyCode": { "$": "RUB" } - } - }, - "RetailItemImageList": { - "RetailItemImage": [ - { - "ImageUsage": { "$": "INTERNET" }, - "ImageSize": { "$": "S1" }, - "ImageUrl": { - "@nil": { - "$": true, - "@xmlns": { - "$": "http://www.w3.org/2001/XMLSchema-instance" - } - } - }, - "ImageWidth": { "$": 40 }, - "ImageHeight": { "$": 40 }, - "SortNo": { "$": 1 }, - "ImageType": { "$": "PICTURE SINGLE" } - }, - { - "ImageUsage": { "$": "INTERNET" }, - "ImageSize": { "$": "S2" }, - "ImageUrl": { - "@nil": { - "$": true, - "@xmlns": { - "$": "http://www.w3.org/2001/XMLSchema-instance" - } - } - }, - "ImageWidth": { "$": 110 }, - "ImageHeight": { "$": 110 }, - "SortNo": { "$": 1 }, - "ImageType": { "$": "PICTURE SINGLE" } - }, - { - "ImageUsage": { "$": "INTERNET" }, - "ImageSize": { "$": "S3" }, - "ImageUrl": { "$": "/PIAimages/missingImage.jpg" }, - "ImageWidth": { "$": 250 }, - "ImageHeight": { "$": 250 }, - "SortNo": { "$": 1 }, - "ImageType": { "$": "PICTURE SINGLE" } - }, - { - "ImageUsage": { "$": "INTERNET" }, - "ImageSize": { "$": "S4" }, - "ImageUrl": { "$": "/PIAimages/missingImage.jpg" }, - "ImageWidth": { "$": 500 }, - "ImageHeight": { "$": 500 }, - "SortNo": { "$": 1 }, - "ImageType": { "$": "PICTURE SINGLE" } - } - ] - }, - "AttributeGroupList": { - "AttributeGroup": { - "GroupName": { "$": "SEO" }, - "AttributeList": { - "Attribute": { - "Name": { "$": "DESCRIPTION" }, - "Value": { - "$": "IKEA - ЛУРОЙ, Реечное дно кровати, 17 многослойных реек приспосабливаются к весу тела и повышают упругость матраса.Бесплатно 25 лет гарантии. Подробнее об условиях гарантии — в гарантийной брошюре." - } - } - } - } - }, - "RetailItemCareInstructionList": { - "RetailItemCareInstruction": { - "SortNo": { "$": 1 }, - "RetailItemCareInstructionTextList": { - "RetailItemCareInstructionText": [ - { - "CareInstructionText": { - "$": "Протирать тканью, смоченной мягким моющим средством." - }, - "SortNo": { "$": 1 } - }, - { - "CareInstructionText": { - "$": "Вытирать чистой сухой тканью." - }, - "SortNo": { "$": 2 } - } - ] - } - } - }, - "RetailItemCustomerBenefitList": { - "RetailItemCustomerBenefit": [ - { - "CustomerBenefitText": { - "$": "17 многослойных реек приспосабливаются к весу тела и повышают упругость матраса." - }, - "SortNo": { "$": 1 } - }, - { - "CustomerBenefitText": { - "$": "Бесплатно 25 лет гарантии. Подробнее об условиях гарантии — в гарантийной брошюре." - }, - "SortNo": { "$": 2 } - } - ] - }, - "RetailItemCustomerEnvironmentList": {}, - "RetailItemGoodToKnowList": { - "RetailItemGoodToKnow": { - "GoodToKnowTypeNameEn": { "$": "Warning" }, - "GoodToKnowText": { - "$": "Это реечное дно кровати предназначено для использования с каркасами кроватей из ассортимента ИКЕА. При использовании с другим каркасом необходимо проверить конструкцию." - }, - "SortNo": { "$": 1 }, - "GoodToKnowHeader": { "$": "Безопасность и соответствие:" } - } - }, - "RetailItemCustomerMaterialList": { - "RetailItemCustomerMaterial": { - "SortNo": { "$": 1 }, - "RetailItemPartMaterialList": { - "RetailItemPartMaterial": [ - { - "PartText": { "$": "Рейки кровати:" }, - "MaterialText": { - "$": "Многослойный клееный шпон, Березовый шпон, Прозрачный лак." - }, - "SortNo": { "$": 1 } - }, - { - "PartText": { "$": "Лента:" }, - "MaterialText": { "$": "100 % полиэстер" }, - "SortNo": { "$": 2 } - } - ] - } - } - }, - "RetailItemCommMeasureList": { - "RetailItemCommMeasure": [ - { - "ItemMeasureType": { "$": "Length" }, - "ItemMeasureTypeName": { "$": "Длина" }, - "ItemMeasureTextMetric": { "$": "200 см" }, - "ItemMeasureTextImperial": { "$": "78 3/4 дюйм" }, - "SortNo": { "$": 1 } - }, - { - "ItemMeasureType": { "$": "Width" }, - "ItemMeasureTypeName": { "$": "Ширина" }, - "ItemMeasureTextMetric": { "$": "140 см" }, - "ItemMeasureTextImperial": { "$": "55 1/8 дюйм" }, - "SortNo": { "$": 2 } - } - ] - }, - "RetailItemCommChildList": { - "RetailItemCommChild": { - "Quantity": { "$": 2 }, - "ItemNo": { "$": 30369303 }, - "ItemNoGlobal": { "$": 30369303 }, - "ItemType": { "$": "ART" }, - "ItemUrl": { "$": "/retail/iows/ru/ru/catalog/items/art,30369303" }, - "ProductName": { "$": "ЛУРОЙ" }, - "ProductTypeName": { "$": "реечное дно кровати" }, - "ItemNumberOfPackages": { "$": 1 }, - "RetailItemCommPackageMeasureList": { - "RetailItemCommPackageMeasure": [ - { - "PackageMeasureType": { "$": "WIDTH" }, - "PackageMeasureTextMetric": { "$": "20 см" }, - "PackageMeasureTextImperial": { "$": "7 ¾ дюйм" }, - "SortNo": { "$": 1 }, - "ConsumerPackNumber": { "$": 1 } - }, - { - "PackageMeasureType": { "$": "HEIGHT" }, - "PackageMeasureTextMetric": { "$": "5 см" }, - "PackageMeasureTextImperial": { "$": "2 дюйм" }, - "SortNo": { "$": 1 }, - "ConsumerPackNumber": { "$": 1 } - }, - { - "PackageMeasureType": { "$": "LENGTH" }, - "PackageMeasureTextMetric": { "$": "70 см" }, - "PackageMeasureTextImperial": { "$": "27 ½ дюйм" }, - "SortNo": { "$": 1 }, - "ConsumerPackNumber": { "$": 1 } - }, - { - "PackageMeasureType": { "$": "WEIGHT" }, - "PackageMeasureTextMetric": { "$": "4.40 кг" }, - "PackageMeasureTextImperial": { "$": "9 фнт 11 унц" }, - "SortNo": { "$": 1 }, - "ConsumerPackNumber": { "$": 1 } - } - ] - } - } - }, - "CatalogRefList": { - "CatalogRef": [ - { - "Catalog": { - "CatalogId": { "$": "departments" }, - "CatalogName": { "$": "Отделы" }, - "CatalogUrl": { - "$": "/retail/iows/ru/ru/catalog/departments" - } - }, - "CatalogElementList": { - "CatalogElement": { - "CatalogElementId": { "$": 24827 }, - "CatalogElementType": { "$": "SUB CATEGORY" }, - "CatalogElementName": { "$": "Реечное дно" }, - "CatalogElementUrl": { - "$": "/retail/iows/ru/ru/catalog/departments/bedroom/24827" - } - } - } - }, - { - "Catalog": { - "CatalogId": { "$": "functional" }, - "CatalogName": { "$": "Функциональный" }, - "CatalogUrl": { - "$": "/retail/iows/ru/ru/catalog/functional" - } - }, - "CatalogElementList": { - "CatalogElement": { - "CatalogElementId": { "$": 24827 }, - "CatalogElementType": { "$": "SUB CATEGORY" }, - "CatalogElementName": { "$": "Реечное дно" }, - "CatalogElementUrl": { - "$": "/retail/iows/ru/ru/catalog/functional/10376/24827" - } - } - } - }, - { - "Catalog": { - "CatalogId": { "$": "seasonal" }, - "CatalogName": { "$": "Сезонный" }, - "CatalogUrl": { "$": "/retail/iows/ru/ru/catalog/seasonal" } - }, - "CatalogElementList": { - "CatalogElement": { - "CatalogElementId": { "$": 24827 }, - "CatalogElementType": { "$": "SUB CATEGORY" }, - "CatalogElementName": { "$": "Реечное дно" }, - "CatalogElementUrl": { - "$": "/retail/iows/ru/ru/catalog/seasonal/back_to_college/24827" - } - } - } - } - ] - }, - "PriceUnitTextMetricEn": {}, - "PriceUnitTextImperialEn": {}, - "ItemMeasureReferenceTextMetric": { "$": "140x200 см" }, - "ItemMeasureReferenceTextImperial": { "$": "55 1/8x78 3/4 дюйм" }, - "CatalogElementRelationList": {}, - "RetailItemFullLengthTextList": { "RetailItemFullLengthText": {} }, - "RetailItemFilterAttributeList": { - "RetailItemFilterAttribute": [ - { - "FilterAttributeType": { "$": "Colour" }, - "FilterAttributeTypeName": { "$": "Цвет" }, - "FilterAttributeValueList": { - "FilterAttributeValue": { - "FilterAttributeValueId": { "$": 10003 }, - "FilterAttributeValueName": { "$": "бежевый" } - } - } - }, - { - "FilterAttributeType": { "$": "Material" }, - "FilterAttributeTypeName": { "$": "Материал" }, - "FilterAttributeValueList": { - "FilterAttributeValue": { - "FilterAttributeValueId": { "$": 47349 }, - "FilterAttributeValueName": { - "$": "Древесина (в т. ч. доска)" - } - } - } - } - ] - }, - "@xmlns": { "$": "ikea.com/cem/iows/RetailItemCommunicationService/2.0/" } -} diff --git a/tests/data/item_iows/combination.json b/tests/data/item_iows/combination.json deleted file mode 100644 index 5c4d05e7..00000000 --- a/tests/data/item_iows/combination.json +++ /dev/null @@ -1,861 +0,0 @@ -{ - "ItemNo": { "$": 69435788 }, - "ItemNoGlobal": { "$": 19421675 }, - "ItemType": { "$": "SPR" }, - "ProductName": { "$": "БЕСТО" }, - "ProductTypeName": { "$": "Комбинация для хранения с дверцами" }, - "ValidDesignText": { "$": "белый, бьёркёвикен березовый шпон" }, - "NewsType": { "$": "ICON" }, - "OnlineSellable": { "$": true }, - "BreathTakingItem": { "$": false }, - "ItemUnitCode": { "$": "PIECES" }, - "ItemNumberOfPackages": { "$": 24 }, - "AssemblyCode": { "$": "Y" }, - "DesignerNameComm": {}, - "PriceUnitTextMetric": {}, - "GlobalisationContext": { - "LanguageCodeIso": { "$": "ru" }, - "CountryCodeIso": { "$": "ru" } - }, - "ClassUnitKey": { - "ClassType": { "$": "GR" }, - "ClassUnitType": { "$": "RU" }, - "ClassUnitCode": { "$": "RU" } - }, - "RetailItemCommPriceList": { - "RetailItemCommPrice": { - "RetailPriceType": { "$": "RegularSalesUnitPrice" }, - "Price": { "$": 31800 }, - "PriceExclTax": { "$": 26500 }, - "CurrencyCode": { "$": "RUB" } - } - }, - "RetailItemImageList": { - "RetailItemImage": [ - { - "ImageUsage": { "$": "INTERNET" }, - "ImageSize": { "$": "S1" }, - "ImageUrl": { - "$": "/ru/ru/images/products/besto-kombinacia-dla-hranenia-s-dvercami__0994361_PE821029_S1.JPG" - }, - "ImageWidth": { "$": 40 }, - "ImageHeight": { "$": 40 }, - "SortNo": { "$": 1 }, - "ImageType": { "$": "PICTURE SINGLE" } - }, - { - "ImageUsage": { "$": "INTERNET" }, - "ImageSize": { "$": "S2" }, - "ImageUrl": { - "$": "/ru/ru/images/products/besto-kombinacia-dla-hranenia-s-dvercami__0994361_PE821029_S2.JPG" - }, - "ImageWidth": { "$": 110 }, - "ImageHeight": { "$": 110 }, - "SortNo": { "$": 1 }, - "ImageType": { "$": "PICTURE SINGLE" } - }, - { - "ImageUsage": { "$": "INTERNET" }, - "ImageSize": { "$": "S3" }, - "ImageUrl": { - "$": "/ru/ru/images/products/besto-kombinacia-dla-hranenia-s-dvercami__0994361_PE821029_S3.JPG" - }, - "ImageWidth": { "$": 250 }, - "ImageHeight": { "$": 250 }, - "SortNo": { "$": 1 }, - "ImageType": { "$": "PICTURE SINGLE" } - }, - { - "ImageUsage": { "$": "INTERNET" }, - "ImageSize": { "$": "S4" }, - "ImageUrl": { - "$": "/ru/ru/images/products/besto-kombinacia-dla-hranenia-s-dvercami-belyj__0994361_PE821029_S4.JPG" - }, - "ImageWidth": { "$": 500 }, - "ImageHeight": { "$": 500 }, - "SortNo": { "$": 1 }, - "ImageType": { "$": "PICTURE SINGLE" } - }, - { - "ImageUsage": { "$": "INTERNET" }, - "ImageSize": { "$": "S5" }, - "ImageUrl": { - "$": "/ru/ru/images/products/besto-kombinacia-dla-hranenia-s-dvercami-belyj__0994361_PE821029_S5.JPG" - }, - "ImageWidth": { "$": 2000 }, - "ImageHeight": { "$": 2000 }, - "SortNo": { "$": 1 }, - "ImageType": { "$": "PICTURE SINGLE" } - }, - { - "ImageUsage": { "$": "INTERNET" }, - "ImageSize": { "$": "S3" }, - "ImageUrl": { - "$": "/ru/ru/images/products/besto-kombinacia-dla-hranenia-s-dvercami__0999944_PE823959_S3.JPG" - }, - "ImageWidth": { "$": 250 }, - "ImageHeight": { "$": 250 }, - "SortNo": { "$": 2 }, - "ImageType": { "$": "PICTURE SINGLE" } - }, - { - "ImageUsage": { "$": "INTERNET" }, - "ImageSize": { "$": "S4" }, - "ImageUrl": { - "$": "/ru/ru/images/products/besto-kombinacia-dla-hranenia-s-dvercami-belyj__0999944_PE823959_S4.JPG" - }, - "ImageWidth": { "$": 500 }, - "ImageHeight": { "$": 500 }, - "SortNo": { "$": 2 }, - "ImageType": { "$": "PICTURE SINGLE" } - }, - { - "ImageUsage": { "$": "INTERNET" }, - "ImageSize": { "$": "S5" }, - "ImageUrl": { - "$": "/ru/ru/images/products/besto-kombinacia-dla-hranenia-s-dvercami-belyj__0999944_PE823959_S5.JPG" - }, - "ImageWidth": { "$": 2000 }, - "ImageHeight": { "$": 2000 }, - "SortNo": { "$": 2 }, - "ImageType": { "$": "PICTURE SINGLE" } - }, - { - "ImageUsage": { "$": "INTERNET" }, - "ImageSize": { "$": "S3" }, - "ImageUrl": { - "$": "/ru/ru/images/products/besto-kombinacia-dla-hranenia-s-dvercami__1026859_PE834586_S3.JPG" - }, - "ImageWidth": { "$": 250 }, - "ImageHeight": { "$": 250 }, - "SortNo": { "$": 3 }, - "ImageType": { "$": "PICTURE SINGLE" } - }, - { - "ImageUsage": { "$": "INTERNET" }, - "ImageSize": { "$": "S4" }, - "ImageUrl": { - "$": "/ru/ru/images/products/besto-kombinacia-dla-hranenia-s-dvercami-belyj__1026859_PE834586_S4.JPG" - }, - "ImageWidth": { "$": 500 }, - "ImageHeight": { "$": 500 }, - "SortNo": { "$": 3 }, - "ImageType": { "$": "PICTURE SINGLE" } - }, - { - "ImageUsage": { "$": "INTERNET" }, - "ImageSize": { "$": "S5" }, - "ImageUrl": { - "$": "/ru/ru/images/products/besto-kombinacia-dla-hranenia-s-dvercami-belyj__1026859_PE834586_S5.JPG" - }, - "ImageWidth": { "$": 2000 }, - "ImageHeight": { "$": 2000 }, - "SortNo": { "$": 3 }, - "ImageType": { "$": "PICTURE SINGLE" } - }, - { - "ImageUsage": { "$": "INTERNET" }, - "ImageSize": { "$": "S3" }, - "ImageUrl": { - "$": "/ru/ru/images/products/besto-kombinacia-dla-hranenia-s-dvercami__0998425_PE823028_S3.JPG" - }, - "ImageWidth": { "$": 250 }, - "ImageHeight": { "$": 250 }, - "SortNo": { "$": 4 }, - "ImageType": { "$": "PICTURE SINGLE" } - }, - { - "ImageUsage": { "$": "INTERNET" }, - "ImageSize": { "$": "S4" }, - "ImageUrl": { - "$": "/ru/ru/images/products/besto-kombinacia-dla-hranenia-s-dvercami-belyj__0998425_PE823028_S4.JPG" - }, - "ImageWidth": { "$": 500 }, - "ImageHeight": { "$": 500 }, - "SortNo": { "$": 4 }, - "ImageType": { "$": "PICTURE SINGLE" } - }, - { - "ImageUsage": { "$": "INTERNET" }, - "ImageSize": { "$": "S5" }, - "ImageUrl": { - "$": "/ru/ru/images/products/besto-kombinacia-dla-hranenia-s-dvercami-belyj__0998425_PE823028_S5.JPG" - }, - "ImageWidth": { "$": 2000 }, - "ImageHeight": { "$": 2000 }, - "SortNo": { "$": 4 }, - "ImageType": { "$": "PICTURE SINGLE" } - } - ] - }, - "GPRCommSelectionCriteriaSelectionList": { - "GPRCommSelectionCriteriaSelection": [ - { - "SelectionCriteriaCode": { "$": "COLOUR" }, - "SelectionCriteriaName": { "$": "цвет" }, - "SelectionCriteriaValue": { - "$": "белый/бьёркёвикен березовый шпон" - } - }, - { - "SelectionCriteriaCode": { "$": "SIZE" }, - "SelectionCriteriaName": { "$": "размеры" }, - "SelectionCriteriaValue": { "$": "120x42x193 см" } - }, - { - "SelectionCriteriaCode": { "$": "00159" }, - "SelectionCriteriaName": { "$": "ящик" }, - "SelectionCriteriaValue": { "$": "-" } - } - ] - }, - "AttributeGroupList": { - "AttributeGroup": { - "GroupName": { "$": "SEO" }, - "AttributeList": { - "Attribute": { - "Name": { "$": "DESCRIPTION" }, - "Value": { - "$": "IKEA - БЕСТО, Комбинация для хранения с дверцами, белый/бьёркёвикен березовый шпон, 120x42x193 см , Фасад БЬЁРКЁВИКЕН изготовлен из березового шпона, который придает каждой дверце непревзойденное качество и естественную красоту.Дверцы защищают содерж" - } - } - } - } - }, - "RetailItemCareInstructionList": { - "RetailItemCareInstruction": [ - { - "ProductTypeText": { "$": "Дверь" }, - "SortNo": { "$": 1 }, - "RetailItemCareInstructionTextList": { - "RetailItemCareInstructionText": [ - { - "CareInstructionText": { - "$": "Протирать влажной тканью." - }, - "SortNo": { "$": 1 } - }, - { - "CareInstructionText": { - "$": "Вытирать чистой сухой тканью." - }, - "SortNo": { "$": 2 } - } - ] - } - }, - { - "ProductTypeText": { "$": "Каркас/полка" }, - "SortNo": { "$": 2 }, - "RetailItemCareInstructionTextList": { - "RetailItemCareInstructionText": [ - { - "CareInstructionText": { - "$": "Протирать влажной тканью." - }, - "SortNo": { "$": 1 } - }, - { - "CareInstructionText": { - "$": "Вытирать чистой сухой тканью." - }, - "SortNo": { "$": 2 } - }, - { - "CareInstructionText": { - "$": "Регулярно проверяйте все крепления и подтягивайте их при необходимости." - }, - "SortNo": { "$": 3 } - } - ] - } - } - ] - }, - "RetailItemCustomerBenefitList": { - "RetailItemCustomerBenefit": [ - { - "CustomerBenefitText": { - "$": "Фасад БЬЁРКЁВИКЕН изготовлен из березового шпона, который придает каждой дверце непревзойденное качество и естественную красоту." - }, - "SortNo": { "$": 1 } - }, - { - "CustomerBenefitText": { - "$": "Дверцы защищают содержимое и выполняют декоративную функцию. Выберите дверцы, подходящие к интерьеру Вашего дома." - }, - "SortNo": { "$": 2 } - }, - { - "CustomerBenefitText": { - "$": "Съемные полки позволяют регулировать пространство." - }, - "SortNo": { "$": 3 } - }, - { - "CustomerBenefitText": { - "$": "Вы можете использовать нажимной механизм или устройство для плавного закрывания. В первом варианте для открывания дверцы достаточно слегка нажать на нее. А во втором – гарантировано плавное и бесшумное закрывание." - }, - "SortNo": { "$": 4 } - }, - { - "CustomerBenefitText": { - "$": "Конструкция петель позволяет отрегулировать и выровнять дверцу по вертикали и по горизонтали." - }, - "SortNo": { "$": 5 } - }, - { - "CustomerBenefitText": { - "$": "Организуйте и оптимизируйте систему для хранения БЕСТО, используя подходящие коробки и вставки." - }, - "SortNo": { "$": 6 } - } - ] - }, - "RetailItemCustomerEnvironmentList": { - "RetailItemCustomerEnvironment": [ - { - "ProductTypeText": { "$": "Каркас" }, - "SortNo": { "$": 1 }, - "RetailItemEnvironmentTextList": { - "RetailItemEnvironmentText": [ - { - "EnvironmentText": { - "$": "Используя в этом товаре щит из ДВП и ДСП с сотовидным бумажным наполнителем, мы расходуем меньше древесины, а значит, бережнее относимся к ресурсам планеты." - }, - "SortNo": { "$": 1 } - }, - { - "EnvironmentText": { - "$": "Мы хотим оказывать позитивное воздействие на экологию планеты. Вот почему мы планируем к 2030 году использовать для изготовления наших товаров только переработанные, возобновляемые и полученные из ответственных источников материалы." - }, - "SortNo": { "$": 2 } - } - ] - } - }, - { - "ProductTypeText": { "$": "Полка" }, - "SortNo": { "$": 2 }, - "RetailItemEnvironmentTextList": { - "RetailItemEnvironmentText": [ - { - "EnvironmentText": { - "$": "Мы хотим оказывать позитивное воздействие на экологию планеты. Вот почему мы планируем к 2030 году использовать для изготовления наших товаров только переработанные, возобновляемые и полученные из ответственных источников материалы." - }, - "SortNo": { "$": 1 } - }, - { - "EnvironmentText": { - "$": "Используя в ДСП этого товара отходы деревообрабатывающего производства, мы находим применение не только для ствола, а для всего дерева. Это позволяет нам бережнее расходовать ресурсы." - }, - "SortNo": { "$": 2 } - } - ] - } - }, - { - "ProductTypeText": { "$": "Дверь" }, - "SortNo": { "$": 3 }, - "RetailItemEnvironmentTextList": { - "RetailItemEnvironmentText": [ - { - "EnvironmentText": { - "$": "Мы хотим оказывать позитивное воздействие на экологию планеты. Вот почему мы планируем к 2030 году использовать для изготовления наших товаров только переработанные, возобновляемые и полученные из ответственных источников материалы." - }, - "SortNo": { "$": 1 } - }, - { - "EnvironmentText": { - "$": "Используя для изготовления этого товара ДСП с верхним слоем дерева вместо массива, мы используем меньше природного сырья, что позволяет эффективно расходовать ресурсы." - }, - "SortNo": { "$": 2 } - } - ] - } - } - ] - }, - "RetailItemGoodToKnowList": { - "RetailItemGoodToKnow": [ - { - "GoodToKnowTypeNameEn": { "$": "Warning" }, - "GoodToKnowText": { - "$": "Эту мебель необходимо крепить к стене с помощью прилагаемого стенного крепежа." - }, - "SortNo": { "$": 1 }, - "GoodToKnowHeader": { "$": "Безопасность и соответствие:" } - }, - { - "GoodToKnowTypeNameEn": { "$": "Compl. assembly information" }, - "GoodToKnowText": { - "$": "Для разных стен требуются различные крепежные приспособления. Подберите подходящие для ваших стен шурупы, дюбели, саморезы и т. п. (не прилагаются)." - }, - "SortNo": { "$": 2 }, - "GoodToKnowHeader": { "$": "Сборка и установка" } - }, - { - "GoodToKnowTypeNameEn": { "$": "Purchase-/Other information" }, - "GoodToKnowText": { - "$": "Если вы выберете функцию плавного закрывания, рекомендуем дополнить фасады ручками, чтобы открывать ящики/шкафы было удобнее." - }, - "SortNo": { "$": 3 }, - "GoodToKnowHeader": { "$": "Дополнительная информация" } - } - ] - }, - "RetailItemCustomerMaterialList": { - "RetailItemCustomerMaterial": [ - { - "ProductTypeText": { "$": "Каркас" }, - "SortNo": { "$": 1 }, - "RetailItemPartMaterialList": { - "RetailItemPartMaterial": [ - { - "PartText": { "$": "Панель:" }, - "MaterialText": { - "$": "ДСП, Сотовидный бумажный наполнитель (100 % переработанного материала), ДВП, Бумажная пленка, Пластиковая окантовка, Пластиковая окантовка, Бумажная пленка" - }, - "SortNo": { "$": 1 } - }, - { - "PartText": { "$": "Задняя панель:" }, - "MaterialText": { - "$": "ДВП, Бумажная пленка, Полимерная пленка" - }, - "SortNo": { "$": 2 } - } - ] - } - }, - { - "ProductTypeText": { "$": "Полка" }, - "SortNo": { "$": 2 }, - "RetailItemPartMaterialList": { - "RetailItemPartMaterial": { - "MaterialText": { - "$": "ДСП, Бумажная пленка, Пластиковая окантовка, Пластиковая окантовка, Бумажная пленка" - }, - "SortNo": { "$": 1 } - } - } - }, - { - "ProductTypeText": { "$": "Дверь" }, - "SortNo": { "$": 3 }, - "RetailItemPartMaterialList": { - "RetailItemPartMaterial": { - "MaterialText": { - "$": "ДВП, Березовый шпон, Прозрачный акриловый лак" - }, - "SortNo": { "$": 1 } - } - } - }, - { - "ProductTypeText": { "$": "Нажимные плавно закрывающиеся петли" }, - "SortNo": { "$": 4 }, - "RetailItemPartMaterialList": { - "RetailItemPartMaterial": [ - { - "PartText": { "$": "Металлическая часть:" }, - "MaterialText": { "$": "Сталь, Никелирование" }, - "SortNo": { "$": 1 } - }, - { - "PartText": { "$": "Пластмассовые части:" }, - "MaterialText": { "$": "Ацеталь пластик" }, - "SortNo": { "$": 2 } - } - ] - } - } - ] - }, - "RetailItemCommMeasureList": { - "RetailItemCommMeasure": [ - { - "ItemMeasureType": { "$": "Width" }, - "ItemMeasureTypeName": { "$": "Ширина" }, - "ItemMeasureTextMetric": { "$": "120 см" }, - "ItemMeasureTextImperial": { "$": "47 1/4 дюйм" }, - "SortNo": { "$": 1 } - }, - { - "ItemMeasureType": { "$": "Depth" }, - "ItemMeasureTypeName": { "$": "Глубина" }, - "ItemMeasureTextMetric": { "$": "42 см" }, - "ItemMeasureTextImperial": { "$": "16 1/2 дюйм" }, - "SortNo": { "$": 2 } - }, - { - "ItemMeasureType": { "$": "Height" }, - "ItemMeasureTypeName": { "$": "Высота" }, - "ItemMeasureTextMetric": { "$": "193 см" }, - "ItemMeasureTextImperial": { "$": "76 дюйм" }, - "SortNo": { "$": 3 } - }, - { - "ItemMeasureType": { "$": "Max. load/shelf" }, - "ItemMeasureTypeName": { "$": "Макс нагрузка на полку" }, - "ItemMeasureTextMetric": { "$": "20 кг" }, - "ItemMeasureTextImperial": { "$": "44 фнт" }, - "SortNo": { "$": 4 } - } - ] - }, - "RetailItemCommChildList": { - "RetailItemCommChild": [ - { - "Quantity": { "$": 2 }, - "ItemNo": { "$": "00299340" }, - "ItemNoGlobal": { "$": "00245842" }, - "ItemType": { "$": "ART" }, - "ItemUrl": { - "$": "/retail/iows/ru/ru/catalog/items/art,00245842" - }, - "ProductName": { "$": "БЕСТО" }, - "ProductTypeName": { "$": "каркас" }, - "ItemNumberOfPackages": { "$": 1 }, - "RetailItemCommPackageMeasureList": { - "RetailItemCommPackageMeasure": [ - { - "PackageMeasureType": { "$": "WIDTH" }, - "PackageMeasureTextMetric": { "$": "41 см" }, - "PackageMeasureTextImperial": { "$": "16 ¼ дюйм" }, - "SortNo": { "$": 1 }, - "ConsumerPackNumber": { "$": 1 } - }, - { - "PackageMeasureType": { "$": "HEIGHT" }, - "PackageMeasureTextMetric": { "$": "8 см" }, - "PackageMeasureTextImperial": { "$": "3 дюйм" }, - "SortNo": { "$": 1 }, - "ConsumerPackNumber": { "$": 1 } - }, - { - "PackageMeasureType": { "$": "LENGTH" }, - "PackageMeasureTextMetric": { "$": "195 см" }, - "PackageMeasureTextImperial": { "$": "76 ¾ дюйм" }, - "SortNo": { "$": 1 }, - "ConsumerPackNumber": { "$": 1 } - }, - { - "PackageMeasureType": { "$": "WEIGHT" }, - "PackageMeasureTextMetric": { "$": "17.95 кг" }, - "PackageMeasureTextImperial": { "$": "39 фнт 9 унц" }, - "SortNo": { "$": 1 }, - "ConsumerPackNumber": { "$": 1 } - } - ] - }, - "RetailItemCommAttachmentList": { - "RetailItemCommAttachment": [ - { - "AttachmentType": { "$": "ASSEMBLY_INSTRUCTION" }, - "AttachmentUrl": { - "$": "/ru/ru/assembly_instructions/besto-karkas__AA-1272094-7_pub.pdf" - }, - "SortNo": { "$": 1 } - }, - { - "AttachmentType": { "$": "MANUAL" }, - "AttachmentUrl": { - "$": "/ru/ru/manuals/besto-karkas__AA-2205802-3_pub.pdf" - }, - "SortNo": { "$": 2 } - } - ] - } - }, - { - "Quantity": { "$": 6 }, - "ItemNo": { "$": "00383881" }, - "ItemNoGlobal": { "$": 80261258 }, - "ItemType": { "$": "ART" }, - "ItemUrl": { - "$": "/retail/iows/ru/ru/catalog/items/art,80261258" - }, - "ProductName": { "$": "БЕСТО" }, - "ProductTypeName": { "$": "нажимные плавно закрывающиеся петли" }, - "ItemNumberOfPackages": { "$": 1 }, - "RetailItemCommPackageMeasureList": { - "RetailItemCommPackageMeasure": [ - { - "PackageMeasureType": { "$": "WIDTH" }, - "PackageMeasureTextMetric": { "$": "20 см" }, - "PackageMeasureTextImperial": { "$": "7 ¾ дюйм" }, - "SortNo": { "$": 1 }, - "ConsumerPackNumber": { "$": 1 } - }, - { - "PackageMeasureType": { "$": "HEIGHT" }, - "PackageMeasureTextMetric": { "$": "3 см" }, - "PackageMeasureTextImperial": { "$": "1 дюйм" }, - "SortNo": { "$": 1 }, - "ConsumerPackNumber": { "$": 1 } - }, - { - "PackageMeasureType": { "$": "LENGTH" }, - "PackageMeasureTextMetric": { "$": "25 см" }, - "PackageMeasureTextImperial": { "$": "9 ¾ дюйм" }, - "SortNo": { "$": 1 }, - "ConsumerPackNumber": { "$": 1 } - }, - { - "PackageMeasureType": { "$": "WEIGHT" }, - "PackageMeasureTextMetric": { "$": "0.26 кг" }, - "PackageMeasureTextImperial": { "$": "9 унц" }, - "SortNo": { "$": 1 }, - "ConsumerPackNumber": { "$": 1 } - } - ] - }, - "RetailItemCommAttachmentList": { - "RetailItemCommAttachment": { - "AttachmentType": { "$": "ASSEMBLY_INSTRUCTION" }, - "AttachmentUrl": { - "$": "/ru/ru/assembly_instructions/besto-nazimnye-plavno-zakryvausiesa-petli__AA-2235776-1_pub.pdf" - }, - "SortNo": { "$": 1 } - } - } - }, - { - "Quantity": { "$": 6 }, - "ItemNo": { "$": 40490959 }, - "ItemNoGlobal": { "$": 80490957 }, - "ItemType": { "$": "ART" }, - "ItemUrl": { - "$": "/retail/iows/ru/ru/catalog/items/art,80490957" - }, - "ProductName": { "$": "БЬЁРКЁВИКЕН" }, - "ProductTypeName": { "$": "дверь" }, - "ItemNumberOfPackages": { "$": 1 }, - "RetailItemCommPackageMeasureList": { - "RetailItemCommPackageMeasure": [ - { - "PackageMeasureType": { "$": "WIDTH" }, - "PackageMeasureTextMetric": { "$": "62 см" }, - "PackageMeasureTextImperial": { "$": "24 ¼ дюйм" }, - "SortNo": { "$": 1 }, - "ConsumerPackNumber": { "$": 1 } - }, - { - "PackageMeasureType": { "$": "HEIGHT" }, - "PackageMeasureTextMetric": { "$": "2 см" }, - "PackageMeasureTextImperial": { "$": "¾ дюйм" }, - "SortNo": { "$": 1 }, - "ConsumerPackNumber": { "$": 1 } - }, - { - "PackageMeasureType": { "$": "LENGTH" }, - "PackageMeasureTextMetric": { "$": "74 см" }, - "PackageMeasureTextImperial": { "$": "29 ¼ дюйм" }, - "SortNo": { "$": 1 }, - "ConsumerPackNumber": { "$": 1 } - }, - { - "PackageMeasureType": { "$": "WEIGHT" }, - "PackageMeasureTextMetric": { "$": "5.23 кг" }, - "PackageMeasureTextImperial": { "$": "11 фнт 8 унц" }, - "SortNo": { "$": 1 }, - "ConsumerPackNumber": { "$": 1 } - } - ] - }, - "RetailItemCommAttachmentList": { - "RetailItemCommAttachment": { - "AttachmentType": { "$": "MANUAL" }, - "AttachmentUrl": { - "$": "/ru/ru/manuals/b-erkeviken-dver-__AA-2205802-3_pub.pdf" - }, - "SortNo": { "$": 1 } - } - } - }, - { - "Quantity": { "$": 10 }, - "ItemNo": { "$": 70299474 }, - "ItemNoGlobal": { "$": "00295554" }, - "ItemType": { "$": "ART" }, - "ItemUrl": { - "$": "/retail/iows/ru/ru/catalog/items/art,00295554" - }, - "ProductName": { "$": "БЕСТО" }, - "ProductTypeName": { "$": "полка" }, - "ItemNumberOfPackages": { "$": 1 }, - "RetailItemCommPackageMeasureList": { - "RetailItemCommPackageMeasure": [ - { - "PackageMeasureType": { "$": "WIDTH" }, - "PackageMeasureTextMetric": { "$": "36 см" }, - "PackageMeasureTextImperial": { "$": "14 дюйм" }, - "SortNo": { "$": 1 }, - "ConsumerPackNumber": { "$": 1 } - }, - { - "PackageMeasureType": { "$": "HEIGHT" }, - "PackageMeasureTextMetric": { "$": "2 см" }, - "PackageMeasureTextImperial": { "$": "¾ дюйм" }, - "SortNo": { "$": 1 }, - "ConsumerPackNumber": { "$": 1 } - }, - { - "PackageMeasureType": { "$": "LENGTH" }, - "PackageMeasureTextMetric": { "$": "59 см" }, - "PackageMeasureTextImperial": { "$": "23 дюйм" }, - "SortNo": { "$": 1 }, - "ConsumerPackNumber": { "$": 1 } - }, - { - "PackageMeasureType": { "$": "WEIGHT" }, - "PackageMeasureTextMetric": { "$": "1.50 кг" }, - "PackageMeasureTextImperial": { "$": "3 фнт 5 унц" }, - "SortNo": { "$": 1 }, - "ConsumerPackNumber": { "$": 1 } - } - ] - }, - "RetailItemCommAttachmentList": { - "RetailItemCommAttachment": [ - { - "AttachmentType": { "$": "ASSEMBLY_INSTRUCTION" }, - "AttachmentUrl": { - "$": "/ru/ru/assembly_instructions/besto-polka__AA-1227320-2_pub.pdf" - }, - "SortNo": { "$": 1 } - }, - { - "AttachmentType": { "$": "MANUAL" }, - "AttachmentUrl": { - "$": "/ru/ru/manuals/besto-polka__AA-2205802-3_pub.pdf" - }, - "SortNo": { "$": 2 } - } - ] - } - } - ] - }, - "CatalogRefList": { - "CatalogRef": [ - { - "Catalog": { - "CatalogId": { "$": "genericproducts" }, - "CatalogName": { "$": "Товары" }, - "CatalogUrl": { - "$": "/retail/iows/ru/ru/catalog/genericproducts" - } - }, - "CatalogElementList": { - "CatalogElement": { - "CatalogElementId": { "$": 31559 }, - "CatalogElementType": { "$": "GENERIC PRODUCT" }, - "CatalogElementName": { "$": "Бесто" }, - "CatalogElementUrl": { - "$": "/retail/iows/ru/ru/catalog/genericproducts/31559" - } - } - } - }, - { - "Catalog": { - "CatalogId": { "$": "departments" }, - "CatalogName": { "$": "Отделы" }, - "CatalogUrl": { - "$": "/retail/iows/ru/ru/catalog/departments" - } - }, - "CatalogElementList": { - "CatalogElement": [ - { - "CatalogElementId": { "$": 12150 }, - "CatalogElementType": { - "$": "CATEGORY SYSTEM CHAPTER" - }, - "CatalogElementName": { "$": "Комбинации БЕСТО" }, - "CatalogElementUrl": { - "$": "/retail/iows/ru/ru/catalog/departments/living_room/12150" - } - }, - { - "CatalogElementId": { "$": 55023 }, - "CatalogElementType": { - "$": "CATEGORY SYSTEM CHAPTER" - }, - "CatalogElementName": { - "$": "БЕСТО комбинации для хранения" - }, - "CatalogElementUrl": { - "$": "/retail/iows/ru/ru/catalog/departments/living_room/55023" - } - } - ] - } - }, - { - "Catalog": { - "CatalogId": { "$": "functional" }, - "CatalogName": { "$": "Функциональный" }, - "CatalogUrl": { - "$": "/retail/iows/ru/ru/catalog/functional" - } - }, - "CatalogElementList": { - "CatalogElement": [ - { - "CatalogElementId": { "$": 12150 }, - "CatalogElementType": { - "$": "CATEGORY SYSTEM CHAPTER" - }, - "CatalogElementName": { "$": "Комбинации БЕСТО" }, - "CatalogElementUrl": { - "$": "/retail/iows/ru/ru/catalog/functional/10364/12150" - } - }, - { - "CatalogElementId": { "$": 55023 }, - "CatalogElementType": { - "$": "CATEGORY SYSTEM CHAPTER" - }, - "CatalogElementName": { - "$": "БЕСТО комбинации для хранения" - }, - "CatalogElementUrl": { - "$": "/retail/iows/ru/ru/catalog/functional/10364/55023" - } - } - ] - } - }, - { - "Catalog": { - "CatalogId": { "$": "planner" }, - "CatalogName": { "$": "Планировщик" }, - "CatalogUrl": { "$": "/retail/iows/ru/ru/catalog/planner" } - }, - "CatalogElementList": { - "CatalogElement": { - "CatalogElementId": { "$": "BESTA_planner" }, - "CatalogElementType": { "$": "TOP CATEGORY" }, - "CatalogElementName": { "$": "BESTA_planner" }, - "CatalogElementUrl": { - "$": "/retail/iows/ru/ru/catalog/planner/BESTA_planner" - } - } - } - } - ] - }, - "PriceUnitTextMetricEn": {}, - "PriceUnitTextImperialEn": {}, - "ItemMeasureReferenceTextMetric": { "$": "120x42x193 см" }, - "ItemMeasureReferenceTextImperial": { "$": "47 1/4x16 1/2x76 дюйм" }, - "CatalogElementRelationList": {}, - "RetailItemCustomerBenefitSummaryText": { - "$": "Все, что вам нужно для хранения вещей и поддержания порядка в доме. Выберите готовую комбинацию или создайте собственную, ориентируясь на свои потребности и стиль. Эта — лишь один вариант из множества возможностей." - }, - "RetailItemFullLengthTextList": { "RetailItemFullLengthText": {} }, - "@xmlns": { "$": "ikea.com/cem/iows/RetailItemCommunicationService/2.0/" } -} diff --git a/tests/data/item_iows/default.json b/tests/data/item_iows/default.json deleted file mode 100644 index e9aea25e..00000000 --- a/tests/data/item_iows/default.json +++ /dev/null @@ -1,593 +0,0 @@ -{ - "ItemNo": { "$": 30379118 }, - "ItemNoGlobal": { "$": 40346924 }, - "ItemType": { "$": "ART" }, - "ProductName": { "$": "КАЛЛАКС" }, - "ProductTypeName": { "$": "Стеллаж" }, - "ValidDesignText": { "$": "серый, под дерево" }, - "OnlineSellable": { "$": true }, - "BreathTakingItem": { "$": false }, - "ItemUnitCode": { "$": "PIECES" }, - "ItemNumberOfPackages": { "$": 1 }, - "AssemblyCode": { "$": "Y" }, - "DesignerNameComm": { "$": "Tord Björklund" }, - "PriceUnitTextMetric": {}, - "GlobalisationContext": { - "LanguageCodeIso": { "$": "ru" }, - "CountryCodeIso": { "$": "ru" } - }, - "ClassUnitKey": { - "ClassType": { "$": "GR" }, - "ClassUnitType": { "$": "RU" }, - "ClassUnitCode": { "$": "RU" } - }, - "RetailItemCommPriceList": { - "RetailItemCommPrice": { - "RetailPriceType": { "$": "RegularSalesUnitPrice" }, - "Price": { "$": 7999 }, - "PriceExclTax": { "$": 6665.83 }, - "CurrencyCode": { "$": "RUB" } - } - }, - "RetailItemImageList": { - "RetailItemImage": [ - { - "ImageUsage": { "$": "INTERNET" }, - "ImageSize": { "$": "S1" }, - "ImageUrl": { - "$": "/ru/ru/images/products/kallaks-stellaz__0494558_PE627165_S1.JPG" - }, - "ImageWidth": { "$": 40 }, - "ImageHeight": { "$": 40 }, - "SortNo": { "$": 1 }, - "ImageType": { "$": "PICTURE SINGLE" } - }, - { - "ImageUsage": { "$": "INTERNET" }, - "ImageSize": { "$": "S2" }, - "ImageUrl": { - "$": "/ru/ru/images/products/kallaks-stellaz__0494558_PE627165_S2.JPG" - }, - "ImageWidth": { "$": 110 }, - "ImageHeight": { "$": 110 }, - "SortNo": { "$": 1 }, - "ImageType": { "$": "PICTURE SINGLE" } - }, - { - "ImageUsage": { "$": "INTERNET" }, - "ImageSize": { "$": "S3" }, - "ImageUrl": { - "$": "/ru/ru/images/products/kallaks-stellaz__0494558_PE627165_S3.JPG" - }, - "ImageWidth": { "$": 250 }, - "ImageHeight": { "$": 250 }, - "SortNo": { "$": 1 }, - "ImageType": { "$": "PICTURE SINGLE" } - }, - { - "ImageUsage": { "$": "INTERNET" }, - "ImageSize": { "$": "S4" }, - "ImageUrl": { - "$": "/ru/ru/images/products/kallaks-stellaz-seryj__0494558_PE627165_S4.JPG" - }, - "ImageWidth": { "$": 500 }, - "ImageHeight": { "$": 500 }, - "SortNo": { "$": 1 }, - "ImageType": { "$": "PICTURE SINGLE" } - }, - { - "ImageUsage": { "$": "INTERNET" }, - "ImageSize": { "$": "S5" }, - "ImageUrl": { - "$": "/ru/ru/images/products/kallaks-stellaz-seryj__0494558_PE627165_S5.JPG" - }, - "ImageWidth": { "$": 2000 }, - "ImageHeight": { "$": 2000 }, - "SortNo": { "$": 1 }, - "ImageType": { "$": "PICTURE SINGLE" } - }, - { - "ImageUsage": { "$": "PRICE TAG" }, - "ImageSize": { "$": "S5" }, - "ImageUrl": { - "$": "/ru/ru/images/products/kallaks-stellaz__13077.jpg" - }, - "ImageWidth": { "$": 2000 }, - "ImageHeight": { "$": 2000 }, - "SortNo": { "$": 1 }, - "ImageType": { "$": "LINE DRAWING" } - }, - { - "ImageUsage": { "$": "INTERNET" }, - "ImageSize": { "$": "S3" }, - "ImageUrl": { - "$": "/ru/ru/images/products/kallaks-stellaz__0494559_PE627164_S3.JPG" - }, - "ImageWidth": { "$": 250 }, - "ImageHeight": { "$": 250 }, - "SortNo": { "$": 2 }, - "ImageType": { "$": "PICTURE SINGLE" } - }, - { - "ImageUsage": { "$": "INTERNET" }, - "ImageSize": { "$": "S4" }, - "ImageUrl": { - "$": "/ru/ru/images/products/kallaks-stellaz-seryj__0494559_PE627164_S4.JPG" - }, - "ImageWidth": { "$": 500 }, - "ImageHeight": { "$": 500 }, - "SortNo": { "$": 2 }, - "ImageType": { "$": "PICTURE SINGLE" } - }, - { - "ImageUsage": { "$": "INTERNET" }, - "ImageSize": { "$": "S5" }, - "ImageUrl": { - "$": "/ru/ru/images/products/kallaks-stellaz-seryj__0494559_PE627164_S5.JPG" - }, - "ImageWidth": { "$": 2000 }, - "ImageHeight": { "$": 2000 }, - "SortNo": { "$": 2 }, - "ImageType": { "$": "PICTURE SINGLE" } - }, - { - "ImageUsage": { "$": "INTERNET" }, - "ImageSize": { "$": "S3" }, - "ImageUrl": { - "$": "/ru/ru/images/products/kallaks-stellaz__0545555_PE655490_S3.JPG" - }, - "ImageWidth": { "$": 250 }, - "ImageHeight": { "$": 250 }, - "SortNo": { "$": 3 }, - "ImageType": { "$": "PICTURE SINGLE" } - }, - { - "ImageUsage": { "$": "INTERNET" }, - "ImageSize": { "$": "S4" }, - "ImageUrl": { - "$": "/ru/ru/images/products/kallaks-stellaz-seryj__0545555_PE655490_S4.JPG" - }, - "ImageWidth": { "$": 500 }, - "ImageHeight": { "$": 500 }, - "SortNo": { "$": 3 }, - "ImageType": { "$": "PICTURE SINGLE" } - }, - { - "ImageUsage": { "$": "INTERNET" }, - "ImageSize": { "$": "S5" }, - "ImageUrl": { - "$": "/ru/ru/images/products/kallaks-stellaz-seryj__0545555_PE655490_S5.JPG" - }, - "ImageWidth": { "$": 2000 }, - "ImageHeight": { "$": 2000 }, - "SortNo": { "$": 3 }, - "ImageType": { "$": "PICTURE SINGLE" } - } - ] - }, - "GPRCommSelectionCriteriaSelectionList": { - "GPRCommSelectionCriteriaSelection": [ - { - "SelectionCriteriaCode": { "$": "COLOUR" }, - "SelectionCriteriaName": { "$": "цвет" }, - "SelectionCriteriaValue": { "$": "серый/под дерево" } - }, - { - "SelectionCriteriaCode": { "$": "SIZE" }, - "SelectionCriteriaName": { "$": "размеры" }, - "SelectionCriteriaValue": { "$": "77x147 см" } - } - ] - }, - "AttributeGroupList": { - "AttributeGroup": { - "GroupName": { "$": "SEO" }, - "AttributeList": { - "Attribute": { - "Name": { "$": "DESCRIPTION" }, - "Value": { - "$": "IKEA - КАЛЛАКС, Стеллаж, серый/под дерево , Можно использовать для разделения комнаты.Можно установить вертикально или горизонтально и использовать как стеллаж или сервант." - } - } - } - } - }, - "RetailItemCareInstructionList": { - "RetailItemCareInstruction": { - "SortNo": { "$": 1 }, - "RetailItemCareInstructionTextList": { - "RetailItemCareInstructionText": [ - { - "CareInstructionText": { - "$": "Протирать мягкой влажной тканью, при необходимости можно использовать слабый мыльный раствор." - }, - "SortNo": { "$": 1 } - }, - { - "CareInstructionText": { - "$": "Вытирать чистой сухой тканью." - }, - "SortNo": { "$": 2 } - } - ] - } - } - }, - "RetailItemCustomerBenefitList": { - "RetailItemCustomerBenefit": [ - { - "CustomerBenefitText": { - "$": "Можно использовать для разделения комнаты." - }, - "SortNo": { "$": 1 } - }, - { - "CustomerBenefitText": { - "$": "Можно установить вертикально или горизонтально и использовать как стеллаж или сервант." - }, - "SortNo": { "$": 2 } - } - ] - }, - "RetailItemCustomerEnvironmentList": { - "RetailItemCustomerEnvironment": { - "SortNo": { "$": 1 }, - "RetailItemEnvironmentTextList": { - "RetailItemEnvironmentText": [ - { - "EnvironmentText": { - "$": "Используя в этом товаре щит из ДВП и ДСП с сотовидным бумажным наполнителем, мы расходуем меньше древесины, а значит, бережнее относимся к ресурсам планеты." - }, - "SortNo": { "$": 1 } - }, - { - "EnvironmentText": { - "$": "Мы хотим оказывать позитивное воздействие на экологию планеты. Вот почему мы планируем к 2030 году использовать для изготовления наших товаров только переработанные, возобновляемые и полученные из ответственных источников материалы." - }, - "SortNo": { "$": 2 } - } - ] - } - } - }, - "RetailItemGoodToKnowList": { - "RetailItemGoodToKnow": [ - { - "GoodToKnowTypeNameEn": { "$": "Warning" }, - "GoodToKnowText": { - "$": "Эту мебель необходимо крепить к стене с помощью прилагаемого стенного крепежа." - }, - "SortNo": { "$": 1 }, - "GoodToKnowHeader": { "$": "Безопасность и соответствие:" } - }, - { - "GoodToKnowTypeNameEn": { "$": "Compl. assembly information" }, - "GoodToKnowText": { - "$": "Для разных стен требуются различные крепежные приспособления. Подберите подходящие для ваших стен шурупы, дюбели, саморезы и т. п. (не прилагаются)." - }, - "SortNo": { "$": 2 }, - "GoodToKnowHeader": { "$": "Сборка и установка" } - }, - { - "GoodToKnowTypeNameEn": { "$": "Compl. assembly information" }, - "GoodToKnowText": { - "$": "Для сборки этой мебели требуются два человека." - }, - "SortNo": { "$": 3 }, - "GoodToKnowHeader": { "$": "Сборка и установка" } - }, - { - "GoodToKnowTypeNameEn": { "$": "May be completed" }, - "GoodToKnowText": { - "$": "Можно дополнить вставкой КАЛЛАКС, продается отдельно." - }, - "SortNo": { "$": 4 }, - "GoodToKnowHeader": { "$": "Для готового решения" } - } - ] - }, - "RetailItemCustomerMaterialList": { - "RetailItemCustomerMaterial": { - "SortNo": { "$": 1 }, - "RetailItemPartMaterialList": { - "RetailItemPartMaterial": { - "MaterialText": { - "$": "ДСП, ДВП, Бумажная пленка, Акриловая краска с тиснением и печатным рисунком, Сотовидный бумажный наполнитель (мин. 70 % переработанного материала), Пластиковая окантовка, Пластмасса АБС" - }, - "SortNo": { "$": 1 } - } - } - } - }, - "RetailItemCommPackageMeasureList": { - "RetailItemCommPackageMeasure": [ - { - "PackageMeasureType": { "$": "WIDTH" }, - "PackageMeasureTextMetric": { "$": "41 см" }, - "PackageMeasureTextImperial": { "$": "16 дюйм" }, - "SortNo": { "$": 1 }, - "ConsumerPackNumber": { "$": 1 } - }, - { - "PackageMeasureType": { "$": "HEIGHT" }, - "PackageMeasureTextMetric": { "$": "16 см" }, - "PackageMeasureTextImperial": { "$": "6 ¼ дюйм" }, - "SortNo": { "$": 1 }, - "ConsumerPackNumber": { "$": 1 } - }, - { - "PackageMeasureType": { "$": "LENGTH" }, - "PackageMeasureTextMetric": { "$": "149 см" }, - "PackageMeasureTextImperial": { "$": "58 ¾ дюйм" }, - "SortNo": { "$": 1 }, - "ConsumerPackNumber": { "$": 1 } - }, - { - "PackageMeasureType": { "$": "WEIGHT" }, - "PackageMeasureTextMetric": { "$": "21.28 кг" }, - "PackageMeasureTextImperial": { "$": "46 фнт 15 унц" }, - "SortNo": { "$": 1 }, - "ConsumerPackNumber": { "$": 1 } - } - ] - }, - "RetailItemCommMeasureList": { - "RetailItemCommMeasure": [ - { - "ItemMeasureType": { "$": "Width" }, - "ItemMeasureTypeName": { "$": "Ширина" }, - "ItemMeasureTextMetric": { "$": "77 см" }, - "ItemMeasureTextImperial": { "$": "30 3/8 дюйм" }, - "SortNo": { "$": 1 } - }, - { - "ItemMeasureType": { "$": "Depth" }, - "ItemMeasureTypeName": { "$": "Глубина" }, - "ItemMeasureTextMetric": { "$": "39 см" }, - "ItemMeasureTextImperial": { "$": "15 3/8 дюйм" }, - "SortNo": { "$": 2 } - }, - { - "ItemMeasureType": { "$": "Height" }, - "ItemMeasureTypeName": { "$": "Высота" }, - "ItemMeasureTextMetric": { "$": "147 см" }, - "ItemMeasureTextImperial": { "$": "57 7/8 дюйм" }, - "SortNo": { "$": 3 } - }, - { - "ItemMeasureType": { "$": "Max. load/shelf" }, - "ItemMeasureTypeName": { "$": "Макс нагрузка на полку" }, - "ItemMeasureTextMetric": { "$": "13 кг" }, - "ItemMeasureTextImperial": { "$": "29 фнт" }, - "SortNo": { "$": 4 } - } - ] - }, - "CatalogRefList": { - "CatalogRef": [ - { - "Catalog": { - "CatalogId": { "$": "genericproducts" }, - "CatalogName": { "$": "Товары" }, - "CatalogUrl": { - "$": "/retail/iows/ru/ru/catalog/genericproducts" - } - }, - "CatalogElementList": { - "CatalogElement": { - "CatalogElementId": { "$": 27285 }, - "CatalogElementType": { "$": "GENERIC PRODUCT" }, - "CatalogElementName": { "$": "Каллакс" }, - "CatalogElementUrl": { - "$": "/retail/iows/ru/ru/catalog/genericproducts/27285" - } - } - } - }, - { - "Catalog": { - "CatalogId": { "$": "series" }, - "CatalogName": { "$": "Серии" }, - "CatalogUrl": { "$": "/retail/iows/ru/ru/catalog/series" } - }, - "CatalogElementList": { - "CatalogElement": { - "CatalogElementId": { "$": 27534 }, - "CatalogElementType": { "$": "TOP CATEGORY" }, - "CatalogElementName": { "$": "КАЛЛАКС серия" }, - "CatalogElementUrl": { - "$": "/retail/iows/ru/ru/catalog/series/27534" - } - } - } - }, - { - "Catalog": { - "CatalogId": { "$": "departments" }, - "CatalogName": { "$": "Отделы" }, - "CatalogUrl": { - "$": "/retail/iows/ru/ru/catalog/departments" - } - }, - "CatalogElementList": { - "CatalogElement": [ - { - "CatalogElementId": { "$": 10382 }, - "CatalogElementType": { "$": "SUB CATEGORY" }, - "CatalogElementName": { "$": "Книжные шкафы" }, - "CatalogElementUrl": { - "$": "/retail/iows/ru/ru/catalog/departments/living_room/10382" - } - }, - { - "CatalogElementId": { "$": 10412 }, - "CatalogElementType": { "$": "CHAPTER" }, - "CatalogElementName": { "$": "Серванты и буфеты" }, - "CatalogElementUrl": { - "$": "/retail/iows/ru/ru/catalog/departments/dining/10412" - } - }, - { - "CatalogElementId": { "$": 11465 }, - "CatalogElementType": { "$": "SUB CATEGORY" }, - "CatalogElementName": { "$": "Стеллажи" }, - "CatalogElementUrl": { - "$": "/retail/iows/ru/ru/catalog/departments/living_room/11465" - } - } - ] - } - }, - { - "Catalog": { - "CatalogId": { "$": "functional" }, - "CatalogName": { "$": "Функциональный" }, - "CatalogUrl": { - "$": "/retail/iows/ru/ru/catalog/functional" - } - }, - "CatalogElementList": { - "CatalogElement": [ - { - "CatalogElementId": { "$": 10382 }, - "CatalogElementType": { "$": "SUB CATEGORY" }, - "CatalogElementName": { "$": "Книжные шкафы" }, - "CatalogElementUrl": { - "$": "/retail/iows/ru/ru/catalog/functional/10364/10382" - } - }, - { - "CatalogElementId": { "$": 11465 }, - "CatalogElementType": { "$": "SUB CATEGORY" }, - "CatalogElementName": { "$": "Стеллажи" }, - "CatalogElementUrl": { - "$": "/retail/iows/ru/ru/catalog/functional/10364/11465" - } - }, - { - "CatalogElementId": { "$": 10412 }, - "CatalogElementType": { "$": "CHAPTER" }, - "CatalogElementName": { "$": "Серванты и буфеты" }, - "CatalogElementUrl": { - "$": "/retail/iows/ru/ru/catalog/functional/10364/10412" - } - } - ] - } - }, - { - "Catalog": { - "CatalogId": { "$": "seasonal" }, - "CatalogName": { "$": "Сезонный" }, - "CatalogUrl": { "$": "/retail/iows/ru/ru/catalog/seasonal" } - }, - "CatalogElementList": { - "CatalogElement": { - "CatalogElementId": { "$": 11465 }, - "CatalogElementType": { "$": "SUB CATEGORY" }, - "CatalogElementName": { "$": "Стеллажи" }, - "CatalogElementUrl": { - "$": "/retail/iows/ru/ru/catalog/seasonal/back_to_college/11465" - } - } - } - }, - { - "Catalog": { - "CatalogId": { "$": "planner" }, - "CatalogName": { "$": "Планировщик" }, - "CatalogUrl": { "$": "/retail/iows/ru/ru/catalog/planner" } - }, - "CatalogElementList": { - "CatalogElement": { - "CatalogElementId": {}, - "CatalogElementType": { "$": "TOP CATEGORY" }, - "CatalogElementName": {}, - "CatalogElementUrl": { - "$": "/retail/iows/ru/ru/catalog/planner/" - } - } - } - } - ] - }, - "PriceUnitTextMetricEn": {}, - "PriceUnitTextImperialEn": {}, - "RetailItemCommAttachmentList": { - "RetailItemCommAttachment": { - "AttachmentType": { "$": "ASSEMBLY_INSTRUCTION" }, - "AttachmentUrl": { - "$": "/ru/ru/assembly_instructions/kallaks-stellaz__AA-1055145-8_pub.pdf" - }, - "SortNo": { "$": 1 } - } - }, - "ItemMeasureReferenceTextMetric": { "$": "77x147 см" }, - "ItemMeasureReferenceTextImperial": { "$": "30 3/8x57 7/8 дюйм" }, - "CatalogElementRelationList": { - "CatalogElementRelation": { - "CatalogElementRelationType": { "$": "X-SELL" }, - "CatalogElementRelationSemantic": { "$": "MAY_BE_COMPLETED_WITH" }, - "CatalogElementId": { "$": 60376420 }, - "CatalogElementType": { "$": "ART" }, - "CatalogElementName": { "$": "ДРЁНА" }, - "CatalogElementUrl": { - "$": "/retail/iows/ru/ru/catalog/items/art,60376420" - }, - "SortRelevanceList": { - "SortRelevance": { - "SortNo": { "$": 6 }, - "SortType": { "$": "RELEVANCE" } - } - } - } - }, - "RetailItemFullLengthTextList": { "RetailItemFullLengthText": {} }, - "RetailItemFilterAttributeList": { - "RetailItemFilterAttribute": [ - { - "FilterAttributeType": { "$": "Colour" }, - "FilterAttributeTypeName": { "$": "Цвет" }, - "FilterAttributeValueList": { - "FilterAttributeValue": { - "FilterAttributeValueId": { "$": 10028 }, - "FilterAttributeValueName": { "$": "серый" } - } - } - }, - { - "FilterAttributeType": { "$": "Material" }, - "FilterAttributeTypeName": { "$": "Материал" }, - "FilterAttributeValueList": { - "FilterAttributeValue": { - "FilterAttributeValueId": { "$": 47349 }, - "FilterAttributeValueName": { - "$": "Древесина (в т. ч. доска)" - } - } - } - }, - { - "FilterAttributeType": { "$": "Number of seats" }, - "FilterAttributeTypeName": { "$": "Свойства" }, - "FilterAttributeValueList": { - "FilterAttributeValue": { - "FilterAttributeValueId": { "$": 53039 }, - "FilterAttributeValueName": { "$": "С полками" } - } - } - }, - { - "FilterAttributeType": { "$": "Number of seats" }, - "FilterAttributeTypeName": { "$": "Дверцы" }, - "FilterAttributeValueList": { - "FilterAttributeValue": { - "FilterAttributeValueId": { "$": 47687 }, - "FilterAttributeValueName": { "$": "Без дверей" } - } - } - } - ] - }, - "@xmlns": { "$": "ikea.com/cem/iows/RetailItemCommunicationService/2.0/" } -} diff --git a/tests/data/item_iows/no CatalogRef.json b/tests/data/item_iows/no CatalogRef.json deleted file mode 100644 index 77917ac5..00000000 --- a/tests/data/item_iows/no CatalogRef.json +++ /dev/null @@ -1,237 +0,0 @@ -{ - "ItemNo": 30365871, - "ItemNoGlobal": 80279946, - "ItemType": "ART", - "ProductName": "АНТИЛОП", - "ProductTypeName": "Ножка высокого стула", - "OnlineSellable": true, - "BreathTakingItem": true, - "ItemUnitCode": "PIECES", - "ItemNumberOfPackages": 1, - "AssemblyCode": "N", - "DesignerNameComm": "IKEA of Sweden", - "PriceUnitTextMetric": "шт", - "ItemPriceUnitFactorMetric": 4, - "ItemPriceUnitFactorImperial": 4, - "GlobalisationContext": { "LanguageCodeIso": "ru", "CountryCodeIso": "ru" }, - "ClassUnitKey": { - "ClassType": "GR", - "ClassUnitType": "RU", - "ClassUnitCode": "RU" - }, - "RetailItemCommPriceList": { - "RetailItemCommPrice": { - "RetailPriceType": "RegularSalesUnitPrice", - "Price": 400, - "PriceExclTax": 333.33, - "ComparableUnitPrice": { - "UnitPriceMetric": 100.0, - "UnitPriceMetricExclTax": 83.33, - "UnitPriceImperial": 100.0, - "UnitPriceImperialExclTax": 83.33 - }, - "CurrencyCode": "RUB" - } - }, - "RetailItemImageList": { - "RetailItemImage": [ - { - "ImageUsage": "INTERNET", - "ImageSize": "S1", - "ImageUrl": "/ru/ru/images/products/antilop-nozka-vysokogo-stula__0276964_PE415685_S1.jpg", - "ImageWidth": 40, - "ImageHeight": 40, - "SortNo": 1, - "ImageType": "PICTURE SINGLE" - }, - { - "ImageUsage": "INTERNET", - "ImageSize": "S2", - "ImageUrl": "/ru/ru/images/products/antilop-nozka-vysokogo-stula__0276964_PE415685_S2.jpg", - "ImageWidth": 110, - "ImageHeight": 110, - "SortNo": 1, - "ImageType": "PICTURE SINGLE" - }, - { - "ImageUsage": "INTERNET", - "ImageSize": "S3", - "ImageUrl": "/ru/ru/images/products/antilop-nozka-vysokogo-stula__0276964_PE415685_S3.jpg", - "ImageWidth": 250, - "ImageHeight": 250, - "SortNo": 1, - "ImageType": "PICTURE SINGLE" - }, - { - "ImageUsage": "INTERNET", - "ImageSize": "S4", - "ImageUrl": "/ru/ru/images/products/antilop-nozka-vysokogo-stula__0276964_PE415685_S4.jpg", - "ImageWidth": 500, - "ImageHeight": 500, - "SortNo": 1, - "ImageType": "PICTURE SINGLE" - }, - { - "ImageUsage": "INTERNET", - "ImageSize": "S5", - "ImageUrl": "/ru/ru/images/products/antilop-nozka-vysokogo-stula__0276964_PE415685_S5.jpg", - "ImageWidth": 2000, - "ImageHeight": 2000, - "SortNo": 1, - "ImageType": "PICTURE SINGLE" - }, - { - "ImageUsage": "PRICE TAG", - "ImageSize": "S5", - "ImageUrl": "/ru/ru/images/products/antilop-nozka-vysokogo-stula__0745202_PE743624.JPG", - "ImageWidth": 2000, - "ImageHeight": 2000, - "SortNo": 1, - "ImageType": "LINE DRAWING" - } - ] - }, - "AttributeGroupList": { - "AttributeGroup": { - "GroupName": "SEO", - "AttributeList": { - "Attribute": { - "Name": "DESCRIPTION", - "Value": "IKEA - АНТИЛОП, Ножка высокого стула" - } - } - } - }, - "RetailItemCareInstructionList": { - "RetailItemCareInstruction": { - "SortNo": 1, - "RetailItemCareInstructionTextList": { - "RetailItemCareInstructionText": [ - { - "CareInstructionText": "Протирать мягким мыльным раствором.", - "SortNo": 1 - }, - { - "CareInstructionText": "Вытирать чистой сухой тканью.", - "SortNo": 2 - } - ] - } - } - }, - "RetailItemGoodToKnowList": { - "RetailItemGoodToKnow": { - "GoodToKnowTypeNameEn": "Sold separately", - "GoodToKnowText": "Необходимо дополнить сиденьем для высокого стульчика АНТИЛОП, продается отдельно.", - "SortNo": 1, - "GoodToKnowHeader": "Продается отдельно" - } - }, - "RetailItemCustomerMaterialList": { - "RetailItemCustomerMaterial": { - "SortNo": 1, - "RetailItemPartMaterialList": { - "RetailItemPartMaterial": [ - { - "PartText": "Ножка:", - "MaterialText": "Сталь, Эпоксидное/полиэстерное порошковое покрытие", - "SortNo": 1 - }, - { - "PartText": "Ножка:", - "MaterialText": "Полипропилен, Полиэтилен", - "SortNo": 2 - } - ] - } - } - }, - "RetailItemCommPackageMeasureList": { - "RetailItemCommPackageMeasure": [ - { - "PackageMeasureType": "WIDTH", - "PackageMeasureTextMetric": "13 см", - "PackageMeasureTextImperial": "5 дюйм", - "SortNo": 1, - "ConsumerPackNumber": 1 - }, - { - "PackageMeasureType": "HEIGHT", - "PackageMeasureTextMetric": "3 см", - "PackageMeasureTextImperial": "1 ¼ дюйм", - "SortNo": 1, - "ConsumerPackNumber": 1 - }, - { - "PackageMeasureType": "LENGTH", - "PackageMeasureTextMetric": "78 см", - "PackageMeasureTextImperial": "30 ½ дюйм", - "SortNo": 1, - "ConsumerPackNumber": 1 - }, - { - "PackageMeasureType": "WEIGHT", - "PackageMeasureTextMetric": "1.65 кг", - "PackageMeasureTextImperial": "3 фнт 10 унц", - "SortNo": 1, - "ConsumerPackNumber": 1 - } - ] - }, - "RetailItemCommMeasureList": { - "RetailItemCommMeasure": [ - { - "ItemMeasureType": "Height", - "ItemMeasureTypeName": "Высота", - "ItemMeasureTextMetric": "73 см", - "ItemMeasureTextImperial": "28 3/4 дюйм", - "SortNo": 1 - }, - { - "ItemMeasureType": "Diameter", - "ItemMeasureTypeName": "Диаметр", - "ItemMeasureTextMetric": "2.5 см", - "ItemMeasureTextImperial": "1 дюйм", - "SortNo": 2 - }, - { - "ItemMeasureType": "Package quantity", - "ItemMeasureTypeName": "Количество в упаковке", - "ItemMeasureTextMetric": "4 шт", - "ItemMeasureTextImperial": "4 шт", - "SortNo": 3 - } - ] - }, - "CatalogRefList": {}, - "PriceUnitTextMetricEn": "pack", - "PriceUnitTextImperialEn": "pack", - "UnitPriceGroupCode": "MULTIPACK", - "CatalogElementRelationList": { - "CatalogElementRelation": { - "CatalogElementRelationType": "X-SELL", - "CatalogElementRelationSemantic": "MUST_BE_COMPLETED_WITH", - "CatalogElementId": 90365873, - "CatalogElementType": "ART", - "CatalogElementName": "АНТИЛОП", - "CatalogElementUrl": "/retail/iows/ru/ru/catalog/items/art,90365873", - "SortRelevanceList": { - "SortRelevance": { "SortNo": 1, "SortType": "RELEVANCE" } - } - } - }, - "RetailItemFullLengthTextList": { "RetailItemFullLengthText": {} }, - "RetailItemFilterAttributeList": { - "RetailItemFilterAttribute": { - "FilterAttributeType": "Colour", - "FilterAttributeTypeName": "Цвет", - "FilterAttributeValueList": { - "FilterAttributeValue": { - "FilterAttributeValueId": 10028, - "FilterAttributeValueName": "серый" - } - } - } - }, - "@xmlns": "ikea.com/cem/iows/RetailItemCommunicationService/2.0/" -} diff --git a/tests/data/item_iows/no RetailItemCommPackageMeasureList.json b/tests/data/item_iows/no RetailItemCommPackageMeasureList.json deleted file mode 100644 index 1b7f6e4f..00000000 --- a/tests/data/item_iows/no RetailItemCommPackageMeasureList.json +++ /dev/null @@ -1,826 +0,0 @@ -{ - "ItemNo": { "$": 19416023 }, - "ItemNoGlobal": { "$": 99416019 }, - "ItemType": { "$": "SPR" }, - "ProductName": { "$": "ОРФЬЕЛЛЬ" }, - "ProductTypeName": { "$": "Рабочий стул" }, - "ValidDesignText": { "$": "черный, Висле синий" }, - "OnlineSellable": { "$": true }, - "BreathTakingItem": { "$": false }, - "ItemUnitCode": { "$": "PIECES" }, - "ItemNumberOfPackages": { "$": 1 }, - "AssemblyCode": { "$": "Y" }, - "DesignerNameComm": {}, - "PriceUnitTextMetric": {}, - "GlobalisationContext": { - "LanguageCodeIso": { "$": "ru" }, - "CountryCodeIso": { "$": "ru" } - }, - "ClassUnitKey": { - "ClassType": { "$": "GR" }, - "ClassUnitType": { "$": "RU" }, - "ClassUnitCode": { "$": "RU" } - }, - "RetailItemCommPriceList": { - "RetailItemCommPrice": { - "RetailPriceType": { "$": "RegularSalesUnitPrice" }, - "Price": { "$": 4299 }, - "PriceExclTax": { "$": 3582.5 }, - "CurrencyCode": { "$": "RUB" } - } - }, - "RetailItemImageList": { - "RetailItemImage": [ - { - "ImageUsage": { "$": "INTERNET" }, - "ImageSize": { "$": "S1" }, - "ImageUrl": { - "$": "/ru/ru/images/products/orf-ell-rabocij-stul__0977996_PE813975_S1.JPG" - }, - "ImageWidth": { "$": 40 }, - "ImageHeight": { "$": 40 }, - "SortNo": { "$": 1 }, - "ImageType": { "$": "PICTURE SINGLE" } - }, - { - "ImageUsage": { "$": "INTERNET" }, - "ImageSize": { "$": "S2" }, - "ImageUrl": { - "$": "/ru/ru/images/products/orf-ell-rabocij-stul__0977996_PE813975_S2.JPG" - }, - "ImageWidth": { "$": 110 }, - "ImageHeight": { "$": 110 }, - "SortNo": { "$": 1 }, - "ImageType": { "$": "PICTURE SINGLE" } - }, - { - "ImageUsage": { "$": "INTERNET" }, - "ImageSize": { "$": "S3" }, - "ImageUrl": { - "$": "/ru/ru/images/products/orf-ell-rabocij-stul__0977996_PE813975_S3.JPG" - }, - "ImageWidth": { "$": 250 }, - "ImageHeight": { "$": 250 }, - "SortNo": { "$": 1 }, - "ImageType": { "$": "PICTURE SINGLE" } - }, - { - "ImageUsage": { "$": "INTERNET" }, - "ImageSize": { "$": "S4" }, - "ImageUrl": { - "$": "/ru/ru/images/products/orf-ell-rabocij-stul-sinij__0977996_PE813975_S4.JPG" - }, - "ImageWidth": { "$": 500 }, - "ImageHeight": { "$": 500 }, - "SortNo": { "$": 1 }, - "ImageType": { "$": "PICTURE SINGLE" } - }, - { - "ImageUsage": { "$": "INTERNET" }, - "ImageSize": { "$": "S5" }, - "ImageUrl": { - "$": "/ru/ru/images/products/orf-ell-rabocij-stul-sinij__0977996_PE813975_S5.JPG" - }, - "ImageWidth": { "$": 2000 }, - "ImageHeight": { "$": 2000 }, - "SortNo": { "$": 1 }, - "ImageType": { "$": "PICTURE SINGLE" } - }, - { - "ImageUsage": { "$": "INTERNET" }, - "ImageSize": { "$": "S3" }, - "ImageUrl": { - "$": "/ru/ru/images/products/orf-ell-rabocij-stul__0977999_PE813976_S3.JPG" - }, - "ImageWidth": { "$": 250 }, - "ImageHeight": { "$": 250 }, - "SortNo": { "$": 3 }, - "ImageType": { "$": "PICTURE SINGLE" } - }, - { - "ImageUsage": { "$": "INTERNET" }, - "ImageSize": { "$": "S4" }, - "ImageUrl": { - "$": "/ru/ru/images/products/orf-ell-rabocij-stul-sinij__0977999_PE813976_S4.JPG" - }, - "ImageWidth": { "$": 500 }, - "ImageHeight": { "$": 500 }, - "SortNo": { "$": 3 }, - "ImageType": { "$": "PICTURE SINGLE" } - }, - { - "ImageUsage": { "$": "INTERNET" }, - "ImageSize": { "$": "S5" }, - "ImageUrl": { - "$": "/ru/ru/images/products/orf-ell-rabocij-stul-sinij__0977999_PE813976_S5.JPG" - }, - "ImageWidth": { "$": 2000 }, - "ImageHeight": { "$": 2000 }, - "SortNo": { "$": 3 }, - "ImageType": { "$": "PICTURE SINGLE" } - }, - { - "ImageUsage": { "$": "INTERNET" }, - "ImageSize": { "$": "S3" }, - "ImageUrl": { - "$": "/ru/ru/images/products/orf-ell-rabocij-stul__0978002_PE813977_S3.JPG" - }, - "ImageWidth": { "$": 250 }, - "ImageHeight": { "$": 250 }, - "SortNo": { "$": 4 }, - "ImageType": { "$": "PICTURE SINGLE" } - }, - { - "ImageUsage": { "$": "INTERNET" }, - "ImageSize": { "$": "S4" }, - "ImageUrl": { - "$": "/ru/ru/images/products/orf-ell-rabocij-stul-sinij__0978002_PE813977_S4.JPG" - }, - "ImageWidth": { "$": 500 }, - "ImageHeight": { "$": 500 }, - "SortNo": { "$": 4 }, - "ImageType": { "$": "PICTURE SINGLE" } - }, - { - "ImageUsage": { "$": "INTERNET" }, - "ImageSize": { "$": "S5" }, - "ImageUrl": { - "$": "/ru/ru/images/products/orf-ell-rabocij-stul-sinij__0978002_PE813977_S5.JPG" - }, - "ImageWidth": { "$": 2000 }, - "ImageHeight": { "$": 2000 }, - "SortNo": { "$": 4 }, - "ImageType": { "$": "PICTURE SINGLE" } - }, - { - "ImageUsage": { "$": "INTERNET" }, - "ImageSize": { "$": "S3" }, - "ImageUrl": { - "$": "/ru/ru/images/products/orf-ell-rabocij-stul__0978003_PE813978_S3.JPG" - }, - "ImageWidth": { "$": 250 }, - "ImageHeight": { "$": 250 }, - "SortNo": { "$": 5 }, - "ImageType": { "$": "PICTURE SINGLE" } - }, - { - "ImageUsage": { "$": "INTERNET" }, - "ImageSize": { "$": "S4" }, - "ImageUrl": { - "$": "/ru/ru/images/products/orf-ell-rabocij-stul-sinij__0978003_PE813978_S4.JPG" - }, - "ImageWidth": { "$": 500 }, - "ImageHeight": { "$": 500 }, - "SortNo": { "$": 5 }, - "ImageType": { "$": "PICTURE SINGLE" } - }, - { - "ImageUsage": { "$": "INTERNET" }, - "ImageSize": { "$": "S5" }, - "ImageUrl": { - "$": "/ru/ru/images/products/orf-ell-rabocij-stul-sinij__0978003_PE813978_S5.JPG" - }, - "ImageWidth": { "$": 2000 }, - "ImageHeight": { "$": 2000 }, - "SortNo": { "$": 5 }, - "ImageType": { "$": "PICTURE SINGLE" } - }, - { - "ImageUsage": { "$": "INTERNET" }, - "ImageSize": { "$": "S3" }, - "ImageUrl": { - "$": "/ru/ru/images/products/orf-ell-rabocij-stul__0978005_PE813979_S3.JPG" - }, - "ImageWidth": { "$": 250 }, - "ImageHeight": { "$": 250 }, - "SortNo": { "$": 6 }, - "ImageType": { "$": "PICTURE SINGLE" } - }, - { - "ImageUsage": { "$": "INTERNET" }, - "ImageSize": { "$": "S4" }, - "ImageUrl": { - "$": "/ru/ru/images/products/orf-ell-rabocij-stul-sinij__0978005_PE813979_S4.JPG" - }, - "ImageWidth": { "$": 500 }, - "ImageHeight": { "$": 500 }, - "SortNo": { "$": 6 }, - "ImageType": { "$": "PICTURE SINGLE" } - }, - { - "ImageUsage": { "$": "INTERNET" }, - "ImageSize": { "$": "S5" }, - "ImageUrl": { - "$": "/ru/ru/images/products/orf-ell-rabocij-stul-sinij__0978005_PE813979_S5.JPG" - }, - "ImageWidth": { "$": 2000 }, - "ImageHeight": { "$": 2000 }, - "SortNo": { "$": 6 }, - "ImageType": { "$": "PICTURE SINGLE" } - }, - { - "ImageUsage": { "$": "INTERNET" }, - "ImageSize": { "$": "S3" }, - "ImageUrl": { - "$": "/ru/ru/images/products/orf-ell-rabocij-stul__0978006_PE813980_S3.JPG" - }, - "ImageWidth": { "$": 250 }, - "ImageHeight": { "$": 250 }, - "SortNo": { "$": 7 }, - "ImageType": { "$": "PICTURE SINGLE" } - }, - { - "ImageUsage": { "$": "INTERNET" }, - "ImageSize": { "$": "S4" }, - "ImageUrl": { - "$": "/ru/ru/images/products/orf-ell-rabocij-stul-sinij__0978006_PE813980_S4.JPG" - }, - "ImageWidth": { "$": 500 }, - "ImageHeight": { "$": 500 }, - "SortNo": { "$": 7 }, - "ImageType": { "$": "PICTURE SINGLE" } - }, - { - "ImageUsage": { "$": "INTERNET" }, - "ImageSize": { "$": "S5" }, - "ImageUrl": { - "$": "/ru/ru/images/products/orf-ell-rabocij-stul-sinij__0978006_PE813980_S5.JPG" - }, - "ImageWidth": { "$": 2000 }, - "ImageHeight": { "$": 2000 }, - "SortNo": { "$": 7 }, - "ImageType": { "$": "PICTURE SINGLE" } - }, - { - "ImageUsage": { "$": "INTERNET" }, - "ImageSize": { "$": "S3" }, - "ImageUrl": { - "$": "/ru/ru/images/products/orf-ell-rabocij-stul__0718740_PE731640_S3.JPG" - }, - "ImageWidth": { "$": 250 }, - "ImageHeight": { "$": 250 }, - "SortNo": { "$": 8 }, - "ImageType": { "$": "PICTURE SINGLE" } - }, - { - "ImageUsage": { "$": "INTERNET" }, - "ImageSize": { "$": "S4" }, - "ImageUrl": { - "$": "/ru/ru/images/products/orf-ell-rabocij-stul-sinij__0718740_PE731640_S4.JPG" - }, - "ImageWidth": { "$": 500 }, - "ImageHeight": { "$": 500 }, - "SortNo": { "$": 8 }, - "ImageType": { "$": "PICTURE SINGLE" } - }, - { - "ImageUsage": { "$": "INTERNET" }, - "ImageSize": { "$": "S5" }, - "ImageUrl": { - "$": "/ru/ru/images/products/orf-ell-rabocij-stul-sinij__0718740_PE731640_S5.JPG" - }, - "ImageWidth": { "$": 2000 }, - "ImageHeight": { "$": 2000 }, - "SortNo": { "$": 8 }, - "ImageType": { "$": "PICTURE SINGLE" } - } - ] - }, - "GPRCommSelectionCriteriaSelectionList": { - "GPRCommSelectionCriteriaSelection": [ - { - "SelectionCriteriaCode": { "$": "COLOUR" }, - "SelectionCriteriaName": { "$": "цвет" }, - "SelectionCriteriaValue": { "$": "черный/Висле синий" } - }, - { - "SelectionCriteriaCode": { "$": "SIZE" }, - "SelectionCriteriaName": { "$": "размеры" }, - "SelectionCriteriaValue": { "$": "-" } - } - ] - }, - "AttributeGroupList": { - "AttributeGroup": { - "GroupName": { "$": "SEO" }, - "AttributeList": { - "Attribute": { - "Name": { "$": "DESCRIPTION" }, - "Value": { - "$": "IKEA - ОРФЬЕЛЛЬ, Рабочий стул, черный/Висле синий , Наполнитель их плотного пенополиуретана высокого качества обеспечит комфорт на долгие годыВысота сиденья регулируется, обеспечивая максимальный комфорт.Колесики оснащены тормозом безопасности, реаги" - } - } - } - } - }, - "RetailItemCareInstructionList": { - "RetailItemCareInstruction": { - "CareInstructionHeader": { "$": "Несъемный чехол" }, - "ProductTypeText": { "$": "Рабочий стул" }, - "SortNo": { "$": 1 }, - "RetailItemCareInstructionTextList": { - "RetailItemCareInstructionText": [ - { - "CareInstructionText": { - "$": "Простые пятна можно удалить с помощью очистителя для ткани или губкой, смоченной водой или слабым мыльным раствором." - }, - "SortNo": { "$": 1 } - }, - { - "CareInstructionText": { - "$": "Протирать мягким мыльным раствором." - }, - "SortNo": { "$": 2 } - }, - { - "CareInstructionText": { "$": "Вытирать чистой сухой тканью." }, - "SortNo": { "$": 3 } - } - ] - } - } - }, - "RetailItemCustomerBenefitList": { - "RetailItemCustomerBenefit": [ - { - "CustomerBenefitText": { - "$": "Наполнитель их плотного пенополиуретана высокого качества обеспечит комфорт на долгие годы" - }, - "SortNo": { "$": 1 } - }, - { - "CustomerBenefitText": { - "$": "Высота сиденья регулируется, обеспечивая максимальный комфорт." - }, - "SortNo": { "$": 2 } - }, - { - "CustomerBenefitText": { - "$": "Колесики оснащены тормозом безопасности, реагирующим на изменение давления: они разблокируются только под воздействием веса сидящего человека." - }, - "SortNo": { "$": 3 } - } - ] - }, - "RetailItemCustomerEnvironmentList": { - "RetailItemCustomerEnvironment": { - "ProductTypeText": { "$": "Каркас стула, вращающийся" }, - "SortNo": { "$": 1 }, - "RetailItemEnvironmentTextList": { - "RetailItemEnvironmentText": { - "EnvironmentText": { - "$": "Можно разобрать на компоненты для переработки или энергетической утилизации, если это предусмотрено в вашем регионе." - }, - "SortNo": { "$": 1 } - } - } - } - }, - "RetailItemGoodToKnowList": { - "RetailItemGoodToKnow": [ - { - "GoodToKnowTypeNameEn": { "$": "Test results and compliance" }, - "GoodToKnowText": { - "$": "Этот товар протестирован и одобрен для бытового использования." - }, - "SortNo": { "$": 1 }, - "GoodToKnowHeader": { "$": "Безопасность и соответствие:" } - }, - { - "GoodToKnowTypeNameEn": { "$": "May be completed" }, - "GoodToKnowText": { - "$": "Можно дополнить защитным напольным покрытием КУЛУН." - }, - "SortNo": { "$": 2 }, - "GoodToKnowHeader": { "$": "Для готового решения" } - }, - { - "GoodToKnowTypeNameEn": { "$": "Purchase-/Other information" }, - "GoodToKnowText": { "$": "Колеса предназначены для мягкого пола." }, - "SortNo": { "$": 3 }, - "GoodToKnowHeader": { "$": "Дополнительная информация" } - }, - { - "GoodToKnowTypeNameEn": { "$": "Purchase-/Other information" }, - "GoodToKnowText": { - "$": "Можно разобрать на компоненты для переработки или энергетической утилизации, если это предусмотрено в вашем регионе." - }, - "SortNo": { "$": 4 }, - "GoodToKnowHeader": { "$": "Дополнительная информация" } - } - ] - }, - "RetailItemCustomerMaterialList": { - "RetailItemCustomerMaterial": [ - { - "ProductTypeText": { "$": "Каркас стула, вращающийся" }, - "SortNo": { "$": 1 }, - "RetailItemPartMaterialList": { - "RetailItemPartMaterial": [ - { - "PartText": { "$": "Колеса/ Чехол на основание:" }, - "MaterialText": { "$": "Полипропилен" }, - "SortNo": { "$": 1 } - }, - { - "PartText": { "$": "Основание/ Регулировочный рычаг:" }, - "MaterialText": { "$": "Сталь, Эпоксидное порошковое покрытие" }, - "SortNo": { "$": 2 } - }, - { - "PartText": { - "$": "Отверстие крестообразной опоры/ Ножка крестообразной опоры:" - }, - "MaterialText": { - "$": "Сталь, Эпоксидное/полиэстерное порошковое покрытие" - }, - "SortNo": { "$": 3 } - }, - { - "PartText": { "$": "Заглушки трубок:" }, - "MaterialText": { "$": "Армированный полипропилен" }, - "SortNo": { "$": 4 } - } - ] - } - }, - { - "ProductTypeText": { "$": "Сиденье со спинкой" }, - "SortNo": { "$": 2 }, - "RetailItemPartMaterialList": { - "RetailItemPartMaterial": [ - { - "PartText": { "$": "Ткань:" }, - "MaterialText": { "$": "100 % полиэстер" }, - "SortNo": { "$": 1 } - }, - { - "PartText": { "$": "Наполнитель спинки/ Наполнитель сиденья:" }, - "MaterialText": { "$": "Пенополиуретан 35кг/куб.м" }, - "SortNo": { "$": 2 } - }, - { - "PartText": { "$": "Каркас сиденья и спинки:" }, - "MaterialText": { "$": "Сталь, Эпоксидное порошковое покрытие" }, - "SortNo": { "$": 3 } - }, - { - "PartText": { "$": "Сиденье и спинка:" }, - "MaterialText": { "$": "Формованная фанера из эвкалипта" }, - "SortNo": { "$": 4 } - } - ] - } - } - ] - }, - "RetailItemLongBenefitList": { - "RetailItemLongBenefit": { - "LongBenefitSubject": { "$": "Designer thoughts" }, - "LongBenefitHeader": { - "$": "Дизайнеры Себастьян Хольмбэк и Ульрик Нордентофт" - }, - "LongBenefitName": { "$": "ОРФЬЕЛЛЬ рабочий стул" }, - "LongBenefitText": { - "$": "«Создавая стул ОРФЬЕЛЛЬ, мы хотели объединить комфорт, функциональность и привлекательный внешний вид. Многие люди организуют рабочее место в гостиной или холле, и поэтому мы хотели сделать стул более «домашним», чтобы он сочетался с остальной мебелью в комнате. Мы выбрали легкую воздушную форму и добавили все качества, которыми должен обладать хороший стул. За ручку, которая является частью спинки, стул легко передвигать. И он везде будет к месту!»" - } - } - }, - "RetailItemCommMeasureList": { - "RetailItemCommMeasure": [ - { - "ItemMeasureType": { "$": "Tested for" }, - "ItemMeasureTypeName": { "$": "Протестировано для" }, - "ItemMeasureTextMetric": { "$": "110 кг" }, - "ItemMeasureTextImperial": { "$": "243 фнт" }, - "SortNo": { "$": 1 } - }, - { - "ItemMeasureType": { "$": "Width" }, - "ItemMeasureTypeName": { "$": "Ширина" }, - "ItemMeasureTextMetric": { "$": "68 см" }, - "ItemMeasureTextImperial": { "$": "26 3/4 дюйм" }, - "SortNo": { "$": 2 } - }, - { - "ItemMeasureType": { "$": "Depth" }, - "ItemMeasureTypeName": { "$": "Глубина" }, - "ItemMeasureTextMetric": { "$": "68 см" }, - "ItemMeasureTextImperial": { "$": "26 3/4 дюйм" }, - "SortNo": { "$": 3 } - }, - { - "ItemMeasureType": { "$": "Max. height" }, - "ItemMeasureTypeName": { "$": "Макс высота" }, - "ItemMeasureTextMetric": { "$": "94 см" }, - "ItemMeasureTextImperial": { "$": "37 дюйм" }, - "SortNo": { "$": 4 } - }, - { - "ItemMeasureType": { "$": "Seat width" }, - "ItemMeasureTypeName": { "$": "Ширина сиденья" }, - "ItemMeasureTextMetric": { "$": "49 см" }, - "ItemMeasureTextImperial": { "$": "19 1/4 дюйм" }, - "SortNo": { "$": 5 } - }, - { - "ItemMeasureType": { "$": "Seat depth" }, - "ItemMeasureTypeName": { "$": "Глубина сиденья" }, - "ItemMeasureTextMetric": { "$": "43 см" }, - "ItemMeasureTextImperial": { "$": "16 7/8 дюйм" }, - "SortNo": { "$": 6 } - }, - { - "ItemMeasureType": { "$": "Min. seat height" }, - "ItemMeasureTypeName": { "$": "Мин высота сиденья" }, - "ItemMeasureTextMetric": { "$": "46 см" }, - "ItemMeasureTextImperial": { "$": "18 1/8 дюйм" }, - "SortNo": { "$": 7 } - }, - { - "ItemMeasureType": { "$": "Max. seat height" }, - "ItemMeasureTypeName": { "$": "Макс высота сиденья" }, - "ItemMeasureTextMetric": { "$": "58 см" }, - "ItemMeasureTextImperial": { "$": "22 7/8 дюйм" }, - "SortNo": { "$": 8 } - } - ] - }, - "RetailItemCommChildList": { - "RetailItemCommChild": [ - { - "Quantity": { "$": 1 }, - "ItemNo": { "$": 50450910 }, - "ItemNoGlobal": { "$": 70450909 }, - "ItemType": { "$": "ART" }, - "ItemUrl": { "$": "/retail/iows/ru/ru/catalog/items/art,70450909" }, - "ProductName": { "$": "ОРФЬЕЛЛЬ" }, - "ProductTypeName": { "$": "каркас стула, вращающийся" }, - "ItemNumberOfPackages": { "$": 1 }, - "RetailItemCommPackageMeasureList": { - "RetailItemCommPackageMeasure": [ - { - "PackageMeasureType": { "$": "WIDTH" }, - "PackageMeasureTextMetric": { "$": "32 см" }, - "PackageMeasureTextImperial": { "$": "12 ½ дюйм" }, - "SortNo": { "$": 1 }, - "ConsumerPackNumber": { "$": 1 } - }, - { - "PackageMeasureType": { "$": "HEIGHT" }, - "PackageMeasureTextMetric": { "$": "8 см" }, - "PackageMeasureTextImperial": { "$": "3 ¼ дюйм" }, - "SortNo": { "$": 1 }, - "ConsumerPackNumber": { "$": 1 } - }, - { - "PackageMeasureType": { "$": "LENGTH" }, - "PackageMeasureTextMetric": { "$": "37 см" }, - "PackageMeasureTextImperial": { "$": "14 ½ дюйм" }, - "SortNo": { "$": 1 }, - "ConsumerPackNumber": { "$": 1 } - }, - { - "PackageMeasureType": { "$": "WEIGHT" }, - "PackageMeasureTextMetric": { "$": "5.23 кг" }, - "PackageMeasureTextImperial": { "$": "11 фнт 8 унц" }, - "SortNo": { "$": 1 }, - "ConsumerPackNumber": { "$": 1 } - } - ] - }, - "RetailItemCommAttachmentList": { - "RetailItemCommAttachment": [ - { - "AttachmentType": { "$": "ASSEMBLY_INSTRUCTION" }, - "AttachmentUrl": { - "$": "/ru/ru/assembly_instructions/orf-ell-karkas-stula-vrasausijsa__AA-2108720-5_pub.pdf" - }, - "SortNo": { "$": 1 } - }, - { - "AttachmentType": { "$": "MANUAL" }, - "AttachmentUrl": { - "$": "/ru/ru/manuals/orf-ell-karkas-stula-vrasausijsa__AA-2085138-4_pub.pdf" - }, - "SortNo": { "$": 2 } - }, - { - "AttachmentType": { "$": "MANUAL" }, - "AttachmentUrl": { - "$": "/ru/ru/manuals/orf-ell-karkas-stula-vrasausijsa__AA-2097252-5_pub.pdf" - }, - "SortNo": { "$": 2 } - } - ] - } - }, - { - "Quantity": { "$": 1 }, - "ItemNo": { "$": 50500972 }, - "ItemNoGlobal": { "$": 20500959 }, - "ItemType": { "$": "ART" }, - "ItemUrl": { "$": "/retail/iows/ru/ru/catalog/items/art,20500959" }, - "ProductName": { "$": "ОРФЬЕЛЛЬ" }, - "ProductTypeName": { "$": "сиденье со спинкой" } - } - ] - }, - "CatalogRefList": { - "CatalogRef": [ - { - "Catalog": { - "CatalogId": { "$": "genericproducts" }, - "CatalogName": { "$": "Товары" }, - "CatalogUrl": { "$": "/retail/iows/ru/ru/catalog/genericproducts" } - }, - "CatalogElementList": { - "CatalogElement": { - "CatalogElementId": { "$": 52696 }, - "CatalogElementType": { "$": "GENERIC PRODUCT" }, - "CatalogElementName": { "$": "Орфьелль" }, - "CatalogElementUrl": { - "$": "/retail/iows/ru/ru/catalog/genericproducts/52696" - } - } - } - }, - { - "Catalog": { - "CatalogId": { "$": "departments" }, - "CatalogName": { "$": "Отделы" }, - "CatalogUrl": { "$": "/retail/iows/ru/ru/catalog/departments" } - }, - "CatalogElementList": { - "CatalogElement": { - "CatalogElementId": { "$": 20653 }, - "CatalogElementType": { "$": "CHAPTER" }, - "CatalogElementName": { "$": "Стулья для письменного стола" }, - "CatalogElementUrl": { - "$": "/retail/iows/ru/ru/catalog/departments/workspaces/20653" - } - } - } - }, - { - "Catalog": { - "CatalogId": { "$": "functional" }, - "CatalogName": { "$": "Функциональный" }, - "CatalogUrl": { "$": "/retail/iows/ru/ru/catalog/functional" } - }, - "CatalogElementList": { - "CatalogElement": { - "CatalogElementId": { "$": 20653 }, - "CatalogElementType": { "$": "CHAPTER" }, - "CatalogElementName": { "$": "Стулья для письменного стола" }, - "CatalogElementUrl": { - "$": "/retail/iows/ru/ru/catalog/functional/10369/20653" - } - } - } - } - ] - }, - "PriceUnitTextMetricEn": {}, - "PriceUnitTextImperialEn": {}, - "CatalogElementRelationList": { - "CatalogElementRelation": [ - { - "CatalogElementRelationType": { "$": "X-SELL" }, - "CatalogElementRelationSemantic": { "$": "MAY_BE_COMPLETED_WITH" }, - "CatalogElementId": { "$": 60373921 }, - "CatalogElementType": { "$": "ART" }, - "CatalogElementName": { "$": "МИККЕ" }, - "CatalogElementUrl": { - "$": "/retail/iows/ru/ru/catalog/items/art,60373921" - }, - "SortRelevanceList": { - "SortRelevance": { - "SortNo": { "$": 1 }, - "SortType": { "$": "RELEVANCE" } - } - } - }, - { - "CatalogElementRelationType": { "$": "X-SELL" }, - "CatalogElementRelationSemantic": { "$": "MAY_BE_COMPLETED_WITH" }, - "CatalogElementId": { "$": 10359927 }, - "CatalogElementType": { "$": "ART" }, - "CatalogElementName": { "$": "ХЕЛЬМЕР" }, - "CatalogElementUrl": { - "$": "/retail/iows/ru/ru/catalog/items/art,10359927" - }, - "SortRelevanceList": { - "SortRelevance": { - "SortNo": { "$": 2 }, - "SortType": { "$": "RELEVANCE" } - } - } - }, - { - "CatalogElementRelationType": { "$": "X-SELL" }, - "CatalogElementRelationSemantic": { "$": "MAY_BE_COMPLETED_WITH" }, - "CatalogElementId": { "$": 50384944 }, - "CatalogElementType": { "$": "ART" }, - "CatalogElementName": { "$": "ХЕЛЬМЕР" }, - "CatalogElementUrl": { - "$": "/retail/iows/ru/ru/catalog/items/art,50384944" - }, - "SortRelevanceList": { - "SortRelevance": { - "SortNo": { "$": 4 }, - "SortType": { "$": "RELEVANCE" } - } - } - }, - { - "CatalogElementRelationType": { "$": "X-SELL" }, - "CatalogElementRelationSemantic": { "$": "MAY_BE_COMPLETED_WITH" }, - "CatalogElementId": { "$": 30384493 }, - "CatalogElementType": { "$": "ART" }, - "CatalogElementName": { "$": "КУЛУН" }, - "CatalogElementUrl": { - "$": "/retail/iows/ru/ru/catalog/items/art,30384493" - }, - "SortRelevanceList": { - "SortRelevance": { - "SortNo": { "$": 5 }, - "SortType": { "$": "RELEVANCE" } - } - } - } - ] - }, - "RetailItemFullLengthTextList": { "RetailItemFullLengthText": {} }, - "RetailItemFilterAttributeList": { - "RetailItemFilterAttribute": [ - { - "FilterAttributeType": { "$": "Colour" }, - "FilterAttributeTypeName": { "$": "Цвет" }, - "FilterAttributeValueList": { - "FilterAttributeValue": [ - { - "FilterAttributeValueId": { "$": 10007 }, - "FilterAttributeValueName": { "$": "синий" } - }, - { - "FilterAttributeValueId": { "$": 10139 }, - "FilterAttributeValueName": { "$": "черный" } - } - ] - } - }, - { - "FilterAttributeType": { "$": "Material" }, - "FilterAttributeTypeName": { "$": "Материал" }, - "FilterAttributeValueList": { - "FilterAttributeValue": { - "FilterAttributeValueId": { "$": 38828 }, - "FilterAttributeValueName": { "$": "тканевые" } - } - } - }, - { - "FilterAttributeType": { "$": "Material" }, - "FilterAttributeTypeName": { "$": "Материал" }, - "FilterAttributeValueList": { - "FilterAttributeValue": { - "FilterAttributeValueId": { "$": 47350 }, - "FilterAttributeValueName": { "$": "Металл" } - } - } - }, - { - "FilterAttributeType": { "$": "Number of seats" }, - "FilterAttributeTypeName": { "$": "Свойства" }, - "FilterAttributeValueList": { - "FilterAttributeValue": { - "FilterAttributeValueId": { "$": 47490 }, - "FilterAttributeValueName": { "$": "С обивкой" } - } - } - }, - { - "FilterAttributeType": { "$": "Number of seats" }, - "FilterAttributeTypeName": { "$": "Свойства" }, - "FilterAttributeValueList": { - "FilterAttributeValue": { - "FilterAttributeValueId": { "$": 53032 }, - "FilterAttributeValueName": { "$": "С колесиками" } - } - } - }, - { - "FilterAttributeType": { "$": "Number of seats" }, - "FilterAttributeTypeName": { "$": "Свойства" }, - "FilterAttributeValueList": { - "FilterAttributeValue": { - "FilterAttributeValueId": { "$": 53961 }, - "FilterAttributeValueName": { "$": "Функция вращения" } - } - } - } - ] - }, - "@xmlns": { "$": "ikea.com/cem/iows/RetailItemCommunicationService/2.0/" } -} diff --git a/tests/data/item_iows/no valid design text.json b/tests/data/item_iows/no valid design text.json deleted file mode 100644 index e4c093e9..00000000 --- a/tests/data/item_iows/no valid design text.json +++ /dev/null @@ -1,543 +0,0 @@ -{ - "ItemNo": { "$": 10359343 }, - "ItemNoGlobal": { "$": "00340047" }, - "ItemType": { "$": "ART" }, - "ProductName": { "$": "ЭКЕТ" }, - "ProductTypeName": { "$": "Накладная шина" }, - "OnlineSellable": { "$": true }, - "BreathTakingItem": { "$": false }, - "ItemUnitCode": { "$": "PIECES" }, - "ItemNumberOfPackages": { "$": 1 }, - "AssemblyCode": { "$": "Y" }, - "DesignerNameComm": { "$": "IKEA of Sweden" }, - "PriceUnitTextMetric": {}, - "GlobalisationContext": { - "LanguageCodeIso": { "$": "ru" }, - "CountryCodeIso": { "$": "ru" } - }, - "ClassUnitKey": { - "ClassType": { "$": "GR" }, - "ClassUnitType": { "$": "RU" }, - "ClassUnitCode": { "$": "RU" } - }, - "RetailItemCommPriceList": { - "RetailItemCommPrice": { - "RetailPriceType": { "$": "RegularSalesUnitPrice" }, - "Price": { "$": 200 }, - "PriceExclTax": { "$": 166.67 }, - "CurrencyCode": { "$": "RUB" } - } - }, - "RetailItemImageList": { - "RetailItemImage": [ - { - "ImageUsage": { "$": "INTERNET" }, - "ImageSize": { "$": "S1" }, - "ImageUrl": { - "$": "/ru/ru/images/products/eket-nakladnaa-sina__0473519_PE614593_S1.JPG" - }, - "ImageWidth": { "$": 40 }, - "ImageHeight": { "$": 40 }, - "SortNo": { "$": 1 }, - "ImageType": { "$": "PICTURE SINGLE" } - }, - { - "ImageUsage": { "$": "INTERNET" }, - "ImageSize": { "$": "S2" }, - "ImageUrl": { - "$": "/ru/ru/images/products/eket-nakladnaa-sina__0473519_PE614593_S2.JPG" - }, - "ImageWidth": { "$": 110 }, - "ImageHeight": { "$": 110 }, - "SortNo": { "$": 1 }, - "ImageType": { "$": "PICTURE SINGLE" } - }, - { - "ImageUsage": { "$": "INTERNET" }, - "ImageSize": { "$": "S3" }, - "ImageUrl": { - "$": "/ru/ru/images/products/eket-nakladnaa-sina__0473519_PE614593_S3.JPG" - }, - "ImageWidth": { "$": 250 }, - "ImageHeight": { "$": 250 }, - "SortNo": { "$": 1 }, - "ImageType": { "$": "PICTURE SINGLE" } - }, - { - "ImageUsage": { "$": "INTERNET" }, - "ImageSize": { "$": "S4" }, - "ImageUrl": { - "$": "/ru/ru/images/products/eket-nakladnaa-sina__0473519_PE614593_S4.JPG" - }, - "ImageWidth": { "$": 500 }, - "ImageHeight": { "$": 500 }, - "SortNo": { "$": 1 }, - "ImageType": { "$": "PICTURE SINGLE" } - }, - { - "ImageUsage": { "$": "INTERNET" }, - "ImageSize": { "$": "S5" }, - "ImageUrl": { - "$": "/ru/ru/images/products/eket-nakladnaa-sina__0473519_PE614593_S5.JPG" - }, - "ImageWidth": { "$": 2000 }, - "ImageHeight": { "$": 2000 }, - "SortNo": { "$": 1 }, - "ImageType": { "$": "PICTURE SINGLE" } - }, - { - "ImageUsage": { "$": "PRICE TAG" }, - "ImageSize": { "$": "S5" }, - "ImageUrl": { - "$": "/ru/ru/images/products/eket-nakladnaa-sina__0473518_PE614592.JPG" - }, - "ImageWidth": { "$": 2000 }, - "ImageHeight": { "$": 2000 }, - "SortNo": { "$": 1 }, - "ImageType": { "$": "LINE DRAWING" } - }, - { - "ImageUsage": { "$": "INTERNET" }, - "ImageSize": { "$": "S3" }, - "ImageUrl": { - "$": "/ru/ru/images/products/eket-nakladnaa-sina__0843151_PE616267_S3.JPG" - }, - "ImageWidth": { "$": 250 }, - "ImageHeight": { "$": 250 }, - "SortNo": { "$": 2 }, - "ImageType": { "$": "PICTURE SINGLE" } - }, - { - "ImageUsage": { "$": "INTERNET" }, - "ImageSize": { "$": "S4" }, - "ImageUrl": { - "$": "/ru/ru/images/products/eket-nakladnaa-sina__0843151_PE616267_S4.JPG" - }, - "ImageWidth": { "$": 500 }, - "ImageHeight": { "$": 500 }, - "SortNo": { "$": 2 }, - "ImageType": { "$": "PICTURE SINGLE" } - }, - { - "ImageUsage": { "$": "INTERNET" }, - "ImageSize": { "$": "S5" }, - "ImageUrl": { - "$": "/ru/ru/images/products/eket-nakladnaa-sina__0843151_PE616267_S5.JPG" - }, - "ImageWidth": { "$": 2000 }, - "ImageHeight": { "$": 2000 }, - "SortNo": { "$": 2 }, - "ImageType": { "$": "PICTURE SINGLE" } - } - ] - }, - "GPRCommSelectionCriteriaSelectionList": { - "GPRCommSelectionCriteriaSelection": { - "SelectionCriteriaCode": { "$": "COLOUR" }, - "SelectionCriteriaName": { "$": "цвет" }, - "SelectionCriteriaValue": { "$": "-" } - } - }, - "AttributeGroupList": { - "AttributeGroup": { - "GroupName": { "$": "SEO" }, - "AttributeList": { - "Attribute": { - "Name": { "$": "DESCRIPTION" }, - "Value": { - "$": "IKEA - ЭКЕТ, Накладная шина , Накладная шина обеспечивает прочную, простую и безопасную фиксацию шкафов ЭКЕТ к стене." - } - } - } - } - }, - "RetailItemCareInstructionList": { - "RetailItemCareInstruction": { - "SortNo": { "$": 1 }, - "RetailItemCareInstructionTextList": { - "RetailItemCareInstructionText": [ - { - "CareInstructionText": { - "$": "Протирать влажной тканью." - }, - "SortNo": { "$": 1 } - }, - { - "CareInstructionText": { - "$": "Вытирать чистой сухой тканью." - }, - "SortNo": { "$": 2 } - }, - { - "CareInstructionText": { - "$": "Регулярно проверяйте все крепления и подтягивайте их при необходимости." - }, - "SortNo": { "$": 3 } - } - ] - } - } - }, - "RetailItemCustomerBenefitList": { - "RetailItemCustomerBenefit": { - "CustomerBenefitText": { - "$": "Накладная шина обеспечивает прочную, простую и безопасную фиксацию шкафов ЭКЕТ к стене." - }, - "SortNo": { "$": 1 } - } - }, - "RetailItemGoodToKnowList": { - "RetailItemGoodToKnow": { - "GoodToKnowTypeNameEn": { "$": "Purchase-/Other information" }, - "GoodToKnowText": { - "$": "Накладная шина потребуется для фиксации шкафов ЭКЕТ к стене." - }, - "SortNo": { "$": 1 }, - "GoodToKnowHeader": { "$": "Дополнительная информация" } - } - }, - "RetailItemCustomerMaterialList": { - "RetailItemCustomerMaterial": { - "SortNo": { "$": 1 }, - "RetailItemPartMaterialList": { - "RetailItemPartMaterial": { - "MaterialText": { "$": "Оцинкованная сталь" }, - "SortNo": { "$": 1 } - } - } - } - }, - "RetailItemCommPackageMeasureList": { - "RetailItemCommPackageMeasure": [ - { - "PackageMeasureType": { "$": "WIDTH" }, - "PackageMeasureTextMetric": { "$": "9 см" }, - "PackageMeasureTextImperial": { "$": "3 ¾ дюйм" }, - "SortNo": { "$": 1 }, - "ConsumerPackNumber": { "$": 1 } - }, - { - "PackageMeasureType": { "$": "HEIGHT" }, - "PackageMeasureTextMetric": { "$": "3 см" }, - "PackageMeasureTextImperial": { "$": "1 ¼ дюйм" }, - "SortNo": { "$": 1 }, - "ConsumerPackNumber": { "$": 1 } - }, - { - "PackageMeasureType": { "$": "LENGTH" }, - "PackageMeasureTextMetric": { "$": "33 см" }, - "PackageMeasureTextImperial": { "$": "13 дюйм" }, - "SortNo": { "$": 1 }, - "ConsumerPackNumber": { "$": 1 } - }, - { - "PackageMeasureType": { "$": "WEIGHT" }, - "PackageMeasureTextMetric": { "$": "0.33 кг" }, - "PackageMeasureTextImperial": { "$": "12 унц" }, - "SortNo": { "$": 1 }, - "ConsumerPackNumber": { "$": 1 } - } - ] - }, - "RetailItemCommMeasureList": { - "RetailItemCommMeasure": [ - { - "ItemMeasureType": { "$": "Width" }, - "ItemMeasureTypeName": { "$": "Ширина" }, - "ItemMeasureTextMetric": { "$": "29.5 см" }, - "ItemMeasureTextImperial": { "$": "11 ½ дюйм" }, - "SortNo": { "$": 1 } - }, - { - "ItemMeasureType": { "$": "Depth" }, - "ItemMeasureTypeName": { "$": "Глубина" }, - "ItemMeasureTextMetric": { "$": "1.5 см" }, - "ItemMeasureTextImperial": { "$": "5/8 дюйм" }, - "SortNo": { "$": 2 } - }, - { - "ItemMeasureType": { "$": "Height" }, - "ItemMeasureTypeName": { "$": "Высота" }, - "ItemMeasureTextMetric": { "$": "4 см" }, - "ItemMeasureTextImperial": { "$": "1 5/8 дюйм" }, - "SortNo": { "$": 3 } - }, - { - "ItemMeasureType": { "$": "Frame width" }, - "ItemMeasureTypeName": { "$": "Ширина рамы" }, - "ItemMeasureTextMetric": { "$": "35 см" }, - "ItemMeasureTextImperial": { "$": "13 3/4 дюйм" }, - "SortNo": { "$": 4 } - } - ] - }, - "CatalogRefList": { - "CatalogRef": [ - { - "Catalog": { - "CatalogId": { "$": "genericproducts" }, - "CatalogName": { "$": "Товары" }, - "CatalogUrl": { - "$": "/retail/iows/ru/ru/catalog/genericproducts" - } - }, - "CatalogElementList": { - "CatalogElement": { - "CatalogElementId": { "$": 37745 }, - "CatalogElementType": { "$": "GENERIC PRODUCT" }, - "CatalogElementName": { "$": "Экет" }, - "CatalogElementUrl": { - "$": "/retail/iows/ru/ru/catalog/genericproducts/37745" - } - } - } - }, - { - "Catalog": { - "CatalogId": { "$": "series" }, - "CatalogName": { "$": "Серии" }, - "CatalogUrl": { "$": "/retail/iows/ru/ru/catalog/series" } - }, - "CatalogElementList": { - "CatalogElement": { - "CatalogElementId": { "$": 37556 }, - "CatalogElementType": { "$": "TOP CATEGORY" }, - "CatalogElementName": { "$": "ЭКЕТ серия" }, - "CatalogElementUrl": { - "$": "/retail/iows/ru/ru/catalog/series/37556" - } - } - } - }, - { - "Catalog": { - "CatalogId": { "$": "departments" }, - "CatalogName": { "$": "Отделы" }, - "CatalogUrl": { - "$": "/retail/iows/ru/ru/catalog/departments" - } - }, - "CatalogElementList": { - "CatalogElement": { - "CatalogElementId": { "$": 11465 }, - "CatalogElementType": { "$": "SUB CATEGORY" }, - "CatalogElementName": { "$": "Стеллажи" }, - "CatalogElementUrl": { - "$": "/retail/iows/ru/ru/catalog/departments/living_room/11465" - } - } - } - }, - { - "Catalog": { - "CatalogId": { "$": "functional" }, - "CatalogName": { "$": "Функциональный" }, - "CatalogUrl": { - "$": "/retail/iows/ru/ru/catalog/functional" - } - }, - "CatalogElementList": { - "CatalogElement": { - "CatalogElementId": { "$": 11465 }, - "CatalogElementType": { "$": "SUB CATEGORY" }, - "CatalogElementName": { "$": "Стеллажи" }, - "CatalogElementUrl": { - "$": "/retail/iows/ru/ru/catalog/functional/10364/11465" - } - } - } - }, - { - "Catalog": { - "CatalogId": { "$": "seasonal" }, - "CatalogName": { "$": "Сезонный" }, - "CatalogUrl": { "$": "/retail/iows/ru/ru/catalog/seasonal" } - }, - "CatalogElementList": { - "CatalogElement": { - "CatalogElementId": { "$": 11465 }, - "CatalogElementType": { "$": "SUB CATEGORY" }, - "CatalogElementName": { "$": "Стеллажи" }, - "CatalogElementUrl": { - "$": "/retail/iows/ru/ru/catalog/seasonal/back_to_college/11465" - } - } - } - }, - { - "Catalog": { - "CatalogId": { "$": "planner" }, - "CatalogName": { "$": "Планировщик" }, - "CatalogUrl": { "$": "/retail/iows/ru/ru/catalog/planner" } - }, - "CatalogElementList": { - "CatalogElement": { - "CatalogElementId": { "$": "EKET_planner" }, - "CatalogElementType": { "$": "TOP CATEGORY" }, - "CatalogElementName": { "$": "EKET_planner" }, - "CatalogElementUrl": { - "$": "/retail/iows/ru/ru/catalog/planner/EKET_planner" - } - } - } - } - ] - }, - "PriceUnitTextMetricEn": {}, - "PriceUnitTextImperialEn": {}, - "RetailItemCommAttachmentList": { - "RetailItemCommAttachment": [ - { - "AttachmentType": { "$": "ASSEMBLY_INSTRUCTION" }, - "AttachmentUrl": { - "$": "/ru/ru/assembly_instructions/eket-nakladnaa-sina__AA-1912543-6_pub.pdf" - }, - "SortNo": { "$": 1 } - }, - { - "AttachmentType": { "$": "MANUAL" }, - "AttachmentUrl": { - "$": "/ru/ru/manuals/eket-nakladnaa-sina__AA-2205802-3_pub.pdf" - }, - "SortNo": { "$": 2 } - } - ] - }, - "ItemMeasureReferenceTextMetric": { "$": "35 см" }, - "ItemMeasureReferenceTextImperial": { "$": "13 3/4 дюйм" }, - "CatalogElementRelationList": { - "CatalogElementRelation": [ - { - "CatalogElementRelationType": { "$": "X-SELL" }, - "CatalogElementRelationSemantic": { - "$": "MAY_BE_COMPLETED_WITH" - }, - "CatalogElementId": { "$": 10379751 }, - "CatalogElementType": { "$": "ART" }, - "CatalogElementName": { "$": "ФИКСА" }, - "CatalogElementUrl": { - "$": "/retail/iows/ru/ru/catalog/items/art,10379751" - }, - "SortRelevanceList": { - "SortRelevance": { - "SortNo": { "$": 1 }, - "SortType": { "$": "RELEVANCE" } - } - } - }, - { - "CatalogElementRelationType": { "$": "X-SELL" }, - "CatalogElementRelationSemantic": { - "$": "MAY_BE_COMPLETED_WITH" - }, - "CatalogElementId": { "$": 60378725 }, - "CatalogElementType": { "$": "ART" }, - "CatalogElementName": { "$": "ФИКСА" }, - "CatalogElementUrl": { - "$": "/retail/iows/ru/ru/catalog/items/art,60378725" - }, - "SortRelevanceList": { - "SortRelevance": { - "SortNo": { "$": 2 }, - "SortType": { "$": "RELEVANCE" } - } - } - } - ] - }, - "RetailItemFullLengthTextList": { - "RetailItemFullLengthText": { - "FullLengthTextSubjectID": { "$": "000000000000008" }, - "RetailItemFullLengthTextDetailsList": { - "RetailItemFullLengthTextDetail": [ - { - "FullLengthTextIdentifier": { "$": "SUBJECT" }, - "FullLengthTextValue": { "$": "000000000000008" }, - "SortNo": { "$": 1 } - }, - { - "FullLengthTextIdentifier": { "$": "MAIN_HEADLINE" }, - "FullLengthTextValue": { - "$": "От дедушкиных ящиков к современным решениям для хранения" - }, - "SortNo": { "$": 3 } - }, - { - "FullLengthTextIdentifier": { "$": "INTRODUCTION" }, - "FullLengthTextValue": { - "$": "В студенческие годы Петра Каммари Энарссон, разработчик ассортимента ИКЕА, часто переезжала, а для хранения вещей использовала старые рыболовные ящики, которые ей дал дедушка, живший на восточном побережье Швеции. Много лет спустя, разрабатывая новую серию ЭКЕТ, она вспомнила эти ящики, чтобы создать мобильное решение для хранения." - }, - "SortNo": { "$": 5 } - }, - { - "FullLengthTextIdentifier": { "$": "TEXT" }, - "FullLengthTextValue": { - "$": "Новые технологии, новые увлечения и даже новый член семьи… большие и маленькие перемены влияют на нашу жизнь, наши потребности и наш дом, который должен вместить так много самых необходимых вещей. Как разработчик товаров ИКЕА Петра часто посещала дома наших покупателей, чтобы изучить их повседневную жизнь и понять, как решения для хранения могут изменить ее к лучшему. Оно запомнила одну семью из Копенгагена, к которой раз в две недели приезжала погостить дочь одного их супругов от предыдущего брака. «В доме не было отдельной комнаты для девочки, но родители поставили для нее кровать-чердак в гостиной, а для вещей можно было использовать стоящий под этой кроватью комод». Это отличный пример того, как можно разумно и комфортно организовать жизнь даже в небольшом доме. Ведь большая часть дневных событий и занятий проходит в гостиной, потому так важно, чтобы интерьер этой комнаты был и стильным, и практичным одновременно." - }, - "SortNo": { "$": 6 } - }, - { - "FullLengthTextIdentifier": { "$": "SUB_HEADING" }, - "FullLengthTextValue": { - "$": "Мебель подстраивается под вас" - }, - "SortNo": { "$": 7 } - }, - { - "FullLengthTextIdentifier": { "$": "BODY_TEXT" }, - "FullLengthTextValue": { - "$": "Частые переезды — новый тренд современного мира, люди с легкостью меняют место жительства, совсем как Петра в студенческие годы. «Проблема в том, что большая часть мебели не соответствует мобильному образу жизни, а значит, вам будет трудно поддерживать порядок в хранении вещей». Этот вывод вдохновил Петру и ее коллег на разработку более гибких и индивидуальных решений для хранения, которые можно легко адаптировать в соответствии с изменившимися потребностями, и вам не придется покупать новую мебель. Петра подумала о ящиках, которые в юности заменяли ей шкаф и комод. Их было легко передвигать и можно было ставить одни на другой. Что если сделать предмет мебели, состоящий из разные модулей, которые можно добавлять и убирать." - }, - "SortNo": { "$": 8 } - }, - { - "FullLengthTextIdentifier": { - "$": "ADDITIONAL_SUB-HEADING_1" - }, - "FullLengthTextValue": { "$": "Мебельный конструктор" }, - "SortNo": { "$": 9 } - }, - { - "FullLengthTextIdentifier": { - "$": "ADDITIONAL_BODY_TEXT_1" - }, - "FullLengthTextValue": { - "$": "Для начала сотрудники команды Петры заказали картонные коробки разных размеров. Они помещали коробки в разные помещения и комбинировали их по-разному, как строительные блоки. Также они изучали различную статистику по хранению, например, сколько журналов мы храним дома или модуль какой высоты будет идеален для того, чтобы положить мобильный телефон. «Многие люди, возвращаясь домой, кладут ключи, телефон или сумку на определенное место. Мы часто делаем это автоматически, не задумываясь», — говорит Петра. Высота, которая подходит для большинства людей — 80 см, поэтому полка на этой высоте обязательно должна быть среди шкафов, полок и ящиков, которые вошли в серию ЭКЕТ. «Я рада, что нашим приоритетом стала мобильность и свобода выбора, мы создали модули ЭКЕТ разных цветов и размеров, — говорит Петра, с нетерпением ожидая возможность увидеть разработанные ей товары в домах наших покупателей. — Думаю, нас ждут самые неожиданные решения, о которых мы даже не предполагали»." - }, - "SortNo": { "$": 10 } - }, - { - "FullLengthTextIdentifier": { "$": "ACTIVE" }, - "FullLengthTextValue": { "$": 1 }, - "SortNo": { "$": 49 } - } - ] - } - } - }, - "RetailItemFilterAttributeList": { - "RetailItemFilterAttribute": [ - { - "FilterAttributeType": { "$": "Colour" }, - "FilterAttributeTypeName": { "$": "Цвет" }, - "FilterAttributeValueList": { - "FilterAttributeValue": { - "FilterAttributeValueId": { "$": 10028 }, - "FilterAttributeValueName": { "$": "серый" } - } - } - }, - { - "FilterAttributeType": { "$": "Number of seats" }, - "FilterAttributeTypeName": { "$": "Тип" }, - "FilterAttributeValueList": { - "FilterAttributeValue": { - "FilterAttributeValueId": { "$": 51519 }, - "FilterAttributeValueName": { "$": "Накладная шина" } - } - } - } - ] - }, - "@xmlns": { "$": "ikea.com/cem/iows/RetailItemCommunicationService/2.0/" } -} diff --git a/tests/endpoints/test_iows_items.py b/tests/endpoints/test_iows_items.py deleted file mode 100644 index 5a4e4f96..00000000 --- a/tests/endpoints/test_iows_items.py +++ /dev/null @@ -1,96 +0,0 @@ -from typing import Any - -import pytest - -from ikea_api.constants import Constants -from ikea_api.endpoints.iows_items import IowsItems -from ikea_api.exceptions import ItemFetchError, WrongItemCodeError -from tests.conftest import EndpointTester, MockResponseInfo - - -@pytest.fixture -def iows_items(constants: Constants): - return IowsItems(constants) - - -@pytest.fixture -def iows_tester(iows_items: IowsItems): - return EndpointTester(iows_items.get_items(["11111111"])) - - -def test_one_first_time(iows_tester: EndpointTester): - req = iows_tester.prepare() - assert "SPR" not in req.url - data = "foo" - assert iows_tester.parse(MockResponseInfo(json_={"RetailItemComm": data})) == [data] - - -def test_one_second_time(iows_tester: EndpointTester): - req = iows_tester.prepare() - assert "SPR" not in req.url - - iows_tester.parse(MockResponseInfo(status_code=404)) - req = iows_tester.prepare() - assert "SPR" in req.url - - result = "foo" - resp = {"RetailItemComm": result} - assert iows_tester.parse(MockResponseInfo(json_=resp)) == [result] - - -def test_one_fails(iows_tester: EndpointTester): - resp = MockResponseInfo(status_code=404) - iows_tester.parse(resp) - - with pytest.raises(WrongItemCodeError): - iows_tester.parse(resp) - - -def build_error_container(errors: Any): - return {"ErrorList": {"Error": errors}} - - -@pytest.mark.parametrize( - "response", - ( - [{"ErrorCode": {"$": 1100}}], - {"ErrorCode": {"$": 1100}}, - {"ErrorCode": {}}, - {}, - ), -) -def test_multiple_fail(iows_tester: EndpointTester, response: Any): - with pytest.raises(ItemFetchError): - iows_tester.parse(MockResponseInfo(json_=build_error_container(response))) - - -def build_item_error(**args: Any): - prep_args = [{"Name": {"$": k}, "Value": {"$": v}} for k, v in args.items()] - return { - "ErrorCode": {"$": 1101}, - "ErrorAttributeList": {"ErrorAttribute": prep_args}, - } - - -@pytest.mark.parametrize("exit_on", (1, 2, 3)) -def test_multiple_second_time(iows_tester: EndpointTester, exit_on: int): - if exit_on == 3: - payload = [ - build_item_error(ITEM_NO=11111111, ITEM_TYPE="ART"), - build_item_error(ITEM_NO=33333333, ITEM_TYPE="ART"), - ] - iows_tester.parse(MockResponseInfo(json_=build_error_container(payload))) - - if exit_on > 1: - payload = [build_item_error(ITEM_NO=11111111, ITEM_TYPE="SPR")] - iows_tester.parse(MockResponseInfo(json_=build_error_container(payload))) - - data = ["foo", "bar", "op"] - res = iows_tester.parse( - MockResponseInfo(json_={"RetailItemCommList": {"RetailItemComm": data}}) - ) - assert res == data - - -def test_no_response_text(iows_tester: EndpointTester): - iows_tester.parse(MockResponseInfo(text_="")) diff --git a/tests/test_init.py b/tests/test_init.py index f1a94847..d8569e08 100644 --- a/tests/test_init.py +++ b/tests/test_init.py @@ -9,6 +9,6 @@ def test_no_pydantic(): import ikea_api with pytest.raises(AttributeError): - ikea_api.get_items + ikea_api.add_items_to_cart del sys.modules["pydantic"] diff --git a/tests/test_utils.py b/tests/test_utils.py index b8c6b785..25a9a7cb 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -1,17 +1,11 @@ from __future__ import annotations -from types import SimpleNamespace from typing import Any import pytest import ikea_api.utils -from ikea_api.utils import ( - _get_location_headers, - _parse_ingka_pagelink_urls, - format_item_code, - parse_item_codes, -) +from ikea_api.utils import format_item_code, parse_item_codes def test_parse_item_codes_unique(): @@ -40,32 +34,6 @@ def test_parse_item_codes_empty(): assert parse_item_codes([]) == [] -page_link = "https://ingka.page.link/Re4Cos2tqLvuf6Mz7" - - -@pytest.mark.parametrize( - ("v", "expected"), - ( - (page_link, [page_link]), - ( - f"text here {page_link} text there {page_link} text there", - [page_link, page_link], - ), - ), -) -def test_parse_ingka_pagelink_urls(v: Any, expected: Any): - assert list(_parse_ingka_pagelink_urls(v)) == expected - - -def test_get_location_headers(): - responses: tuple[Any, ...] = ( - SimpleNamespace(headers={"Location": "1"}), - SimpleNamespace(headers={"Location": "2"}), - SimpleNamespace(headers={}), - ) - assert _get_location_headers(responses) == ["1", "2"] - - @pytest.mark.parametrize( ("input", "output"), ( diff --git a/tests/wrappers/parsers/test_item_iows.py b/tests/wrappers/parsers/test_item_iows.py deleted file mode 100644 index 5477346d..00000000 --- a/tests/wrappers/parsers/test_item_iows.py +++ /dev/null @@ -1,243 +0,0 @@ -from __future__ import annotations - -from types import SimpleNamespace -from typing import Any, Callable - -import pytest - -from ikea_api.constants import Constants -from ikea_api.wrappers import types -from ikea_api.wrappers.parsers.iows_items import ( - Catalog, - CatalogElement, - CatalogElementList, - get_category_name_and_url, - get_child_items, - get_image_url, - get_price, - get_rid_of_dollars, - get_url, - get_weight, - parse_iows_item, - parse_weight, -) -from tests.conftest import TestData - - -def test_get_rid_of_dollars(): - assert get_rid_of_dollars({"name": {"$": "The Name"}}) == {"name": "The Name"} - - -def test_get_image_url_filtered(constants: Constants): - images: list[Any] = [ - SimpleNamespace(ImageType="LINE DRAWING"), - SimpleNamespace(ImageType="not LINE DRAWING", ImageUrl="somename.notpngorjpg"), - ] - assert get_image_url(constants, images) is None - - -def test_get_image_url_no_images(constants: Constants): - assert get_image_url(constants, []) is None - - -@pytest.mark.parametrize("ext", (".png", ".jpg", ".PNG", ".JPG")) -def test_get_image_url_matches(constants: Constants, ext: str): - image: Callable[[str], Any] = lambda ext: SimpleNamespace( - ImageType="not line drawing", ImageSize="S5", ImageUrl="somename" + ext - ) - res = get_image_url(constants, [image(ext), image(".notpngjpg")]) - assert res == f"{constants.base_url}somename{ext}" - - -def test_get_image_url_first(constants: Constants): - url = "somename.jpg" - images: list[Any] = [ - SimpleNamespace(ImageType="not line drawing", ImageSize="S4", ImageUrl=url) - ] - assert get_image_url(constants, images) == constants.base_url + url - - -@pytest.mark.parametrize( - ("input", "output"), - ( - ("10.3 кг", 10.3), - ("10.45 кг", 10.45), - ("10 кг", 10.0), - ("9.415 кг", 9.415), - ("some string", 0.0), - ), -) -def test_parse_weight(input: str, output: float): - assert parse_weight(input) == output - - -def test_get_weight_no_measurements(): - assert get_weight([]) == 0.0 - - -def test_get_weight_no_weight(): - measurement: Any = SimpleNamespace( - PackageMeasureType="not WEIGHT", PackageMeasureTextMetric="10.45 м" - ) - assert get_weight([measurement]) == 0.0 - - -def test_get_weight_with_input(): - measurements: list[Any] = [ - SimpleNamespace( - PackageMeasureType="not WEIGHT", PackageMeasureTextMetric="10.45 м" - ), - SimpleNamespace( - PackageMeasureType="WEIGHT", PackageMeasureTextMetric="9.67 кг" - ), - SimpleNamespace( - PackageMeasureType="WEIGHT", PackageMeasureTextMetric="0.33 кг" - ), - ] - assert get_weight(measurements) == 10.0 - - -def test_get_child_items_no_input(): - assert get_child_items([]) == [] - - -def test_get_child_items_with_input(): - child_items: list[Any] = [ - SimpleNamespace( - Quantity=10, - ItemNo="70299474", - ProductName="БЕСТО", - ProductTypeName="каркас", - ItemMeasureReferenceTextMetric=None, - ValidDesignText=None, - RetailItemCommPackageMeasureList=SimpleNamespace( - RetailItemCommPackageMeasure=[ - SimpleNamespace( - PackageMeasureType="WEIGHT", PackageMeasureTextMetric="17.95 кг" - ) - ] - ), - ), - SimpleNamespace( - Quantity=4, - ItemNo="70299443", - ProductName="БЕСТО", - ProductTypeName="нажимные плавно закрывающиеся петли", - ItemMeasureReferenceTextMetric=None, - ValidDesignText=None, - RetailItemCommPackageMeasureList=SimpleNamespace( - RetailItemCommPackageMeasure=[ - SimpleNamespace( - PackageMeasureType="WEIGHT", PackageMeasureTextMetric="13.19 кг" - ) - ] - ), - ), - ] - exp_result = [ - types.ChildItem( - item_code="70299474", name="БЕСТО, Каркас", weight=17.95, qty=10 - ), - types.ChildItem( - item_code="70299443", - name="БЕСТО, Нажимные плавно закрывающиеся петли", - weight=13.19, - qty=4, - ), - ] - assert get_child_items(child_items) == exp_result - - -def test_get_price_no_input(): - assert get_price([]) == 0 - - -def test_get_price_not_list_zero(): - price: Any = SimpleNamespace(Price=0) - assert get_price(price) == 0 - - -def test_get_price_not_list_not_zero(): - price: Any = SimpleNamespace(Price=10) - assert get_price(price) == 10 - - -def test_get_price_list(): - prices: list[Any] = [SimpleNamespace(Price=5), SimpleNamespace(Price=20)] - assert get_price(prices) == 5 - - -@pytest.mark.parametrize( - ("item_code", "is_combination", "exp_res"), - ( - ("11111111", False, f"/p/-11111111"), - ("11111111", True, f"/p/-s11111111"), - ), -) -def test_get_url( - constants: Constants, item_code: str, is_combination: bool, exp_res: str -): - assert ( - get_url(constants, item_code, is_combination) - == f"{constants.local_base_url}{exp_res}" - ) - - -def test_get_category_name_and_url_no_category(constants: Constants): - catalog: Any = SimpleNamespace( - CatalogElementList=SimpleNamespace(CatalogElement=[]) - ) - assert get_category_name_and_url(constants, [catalog]) == (None, None) - - -def test_get_category_name_and_url_no_categories(constants: Constants): - assert get_category_name_and_url(constants, []) == (None, None) - - -def test_get_category_name_and_url_not_list(constants: Constants): - assert get_category_name_and_url( - constants, - Catalog( - CatalogElementList=CatalogElementList( - CatalogElement=CatalogElement( - CatalogElementName="name", CatalogElementId="id" - ) - ) - ), - ) == ("name", "https://www.ikea.com/ru/ru/cat/-id") - - -@pytest.mark.parametrize(("name", "id"), (("value", {}), ({}, "value"), ({}, {}))) -def test_get_category_name_and_url_name_or_id_is_dict( - constants: Constants, name: str | dict[Any, Any], id: str | dict[Any, Any] -): - catalog: Any = SimpleNamespace( - CatalogElementList=SimpleNamespace( - CatalogElement=SimpleNamespace(CatalogElementName=name, CatalogElementId=id) - ) - ) - assert get_category_name_and_url(constants, [catalog]) == (None, None) - - -def test_get_category_name_and_url_passes(constants: Constants): - catalogs_first_el: Any = [ - SimpleNamespace( - CatalogElementList=SimpleNamespace( - CatalogElement=SimpleNamespace( - CatalogElementName="name", CatalogElementId="id" - ) - ) - ) - ] - exp_res = ( - "name", - f"{constants.local_base_url}/cat/-id", - ) - assert get_category_name_and_url(constants, catalogs_first_el) == exp_res - catalogs_second_el = [SimpleNamespace()] + catalogs_first_el - assert get_category_name_and_url(constants, catalogs_second_el) == exp_res - - -@pytest.mark.parametrize("test_data_response", TestData.item_iows) -def test_main(constants: Constants, test_data_response: dict[str, Any]): - parse_iows_item(constants, test_data_response) diff --git a/tests/wrappers/test_wrappers.py b/tests/wrappers/test_wrappers.py index b5e4ff9e..674c5471 100644 --- a/tests/wrappers/test_wrappers.py +++ b/tests/wrappers/test_wrappers.py @@ -1,32 +1,23 @@ from __future__ import annotations -from types import SimpleNamespace -from typing import Any, Callable +from typing import Callable import pytest import ikea_api.executors.httpx import ikea_api.executors.requests import ikea_api.wrappers.wrappers -from ikea_api.abc import EndpointInfo, RequestInfo, ResponseInfo +from ikea_api.abc import RequestInfo, ResponseInfo from ikea_api.constants import Constants from ikea_api.endpoints.cart import Cart, convert_items from ikea_api.endpoints.order_capture import convert_cart_to_checkout_items from ikea_api.endpoints.purchases import Purchases from ikea_api.executors.httpx import HttpxExecutor from ikea_api.executors.requests import RequestsExecutor -from ikea_api.utils import parse_item_codes from ikea_api.wrappers import types from ikea_api.wrappers.wrappers import ( - _get_ingka_items, - _get_ingka_pip_items, - _get_iows_items, - _get_pip_items, - _get_pip_items_map, add_items_to_cart, - chunks, get_delivery_services, - get_items, get_purchase_history, get_purchase_info, ) @@ -219,201 +210,3 @@ def func(request: RequestInfo): constants, "mytoken", items={"11111111": 2}, zip_code="101000" # nosec ) assert isinstance(res, types.GetDeliveryServicesResponse) - - -@pytest.mark.parametrize( - ("list_", "chunk_size", "expected"), - ( - (["11111111"] * 50, 26, [["11111111"] * 26, ["11111111"] * 24]), - (["11111111"] * 75, 80, [["11111111"] * 75]), - (["11111111"] * 10, 5, [["11111111"] * 5, ["11111111"] * 5]), - ( - ["11111111", "11111111", "22222222", "33333333"], - 2, - [["11111111", "11111111"], ["22222222", "33333333"]], - ), - ), -) -def test_split_to_chunks(list_: list[str], chunk_size: int, expected: list[list[str]]): - result = list(chunks(list_, chunk_size)) - for res, exp in zip(result, expected): - assert len(res) == len(exp) - - -async def test_get_ingka_items(monkeypatch: pytest.MonkeyPatch, constants: Constants): - async def func(e: Any): - return TestData.item_ingka[0] - - monkeypatch.setattr(ikea_api.wrappers.wrappers, "run_with_httpx", func) - res = await _get_ingka_items(constants, ["11111111"] * 51) - assert len(res) == 2 - assert isinstance(res[0], types.IngkaItem) - - -async def test_get_pip_items(monkeypatch: pytest.MonkeyPatch, constants: Constants): - async def func(e: Any): - return TestData.item_pip[0] - - monkeypatch.setattr(ikea_api.wrappers.wrappers, "run_with_httpx", func) - res = await _get_pip_items(constants, ["11111111"] * 10) - assert len(res) == 10 - assert isinstance(res[0], types.PipItem) - - -def test_get_pip_items_map(): - items: list[Any] = [ - SimpleNamespace(item_code="11111111"), - SimpleNamespace(item_code="11111111", name="test"), - SimpleNamespace(item_code="22222222"), - None, - ] - res = _get_pip_items_map(items) - assert res["11111111"] == SimpleNamespace(item_code="11111111", name="test") - assert res["22222222"] == SimpleNamespace(item_code="22222222") - - -async def test_get_ingka_pip_items( - constants: Constants, monkeypatch: pytest.MonkeyPatch -): - exp_item_codes = ["11111111", "22222222", "33333333", "44444444"] - - async def mock_get_ingka_items(constants: Constants, item_codes: list[str]): - assert item_codes == exp_item_codes - return [ - types.IngkaItem( - is_combination=False, - item_code="11111111", - name="first item", - image_url="https://ikea.com/image1.jpg", - weight=10.0, - child_items=[], - ), - types.IngkaItem( - is_combination=True, - item_code="22222222", - name="second item", - image_url="https://ikea.com/image2.jpg", - weight=21.0, - child_items=[ - types.ChildItem( - name="child item", item_code="12121212", weight=10.5, qty=2 - ) - ], - ), - types.IngkaItem( - is_combination=False, - item_code="44444444", - name="fourth item", - image_url="https://ikea.com/image4.jpg", - weight=0.55, - child_items=[], - ), - ] - - async def mock_get_pip_items(constants: Constants, item_codes: list[str]): - assert item_codes == exp_item_codes - return [ - types.PipItem( - item_code="11111111", - price=1000, - url="https://ikea.com/11111111", - category_name="test category name", - category_url="https://ikea.com/category/1", # type: ignore - ), - types.PipItem( - item_code="22222222", - price=20000, - url="https://ikea.com/22222222", - category_name=None, - category_url=None, - ), - types.PipItem( - item_code="33333333", - price=20000, - url="https://ikea.com/33333333", - category_name=None, - category_url=None, - ), - ] - - monkeypatch.setattr( - ikea_api.wrappers.wrappers, "_get_ingka_items", mock_get_ingka_items - ) - monkeypatch.setattr( - ikea_api.wrappers.wrappers, "_get_pip_items", mock_get_pip_items - ) - - assert await _get_ingka_pip_items(constants, exp_item_codes) == [ - types.ParsedItem( - is_combination=False, - item_code="11111111", - name="first item", - image_url="https://ikea.com/image1.jpg", - weight=10.0, - child_items=[], - price=1000, - url="https://ikea.com/11111111", - category_name="test category name", - category_url="https://ikea.com/category/1", # type: ignore - ), - types.ParsedItem( - is_combination=True, - item_code="22222222", - name="second item", - image_url="https://ikea.com/image2.jpg", - weight=21.0, - child_items=[ - types.ChildItem( - name="child item", item_code="12121212", weight=10.5, qty=2 - ) - ], - price=20000, - url="https://ikea.com/22222222", - category_name=None, - category_url=None, - ), - ] - - -async def test_get_iows_items(monkeypatch: pytest.MonkeyPatch, constants: Constants): - async def func(e: EndpointInfo[Any]): - return [TestData.item_iows[0]] * len(e.func.args[1]) - - monkeypatch.setattr(ikea_api.wrappers.wrappers, "run_with_httpx", func) - res = await _get_iows_items(constants, ["11111111"] * 99) - assert len(res) == 99 - assert isinstance(res[0], types.ParsedItem) - - -@pytest.mark.parametrize("early_exit", (True, False)) -async def test_get_items_main( - monkeypatch: pytest.MonkeyPatch, constants: Constants, early_exit: bool -): - raw_item_codes = ["111.111.11", "22222222"] - exp_item_codes = parse_item_codes(raw_item_codes) - exp_items = [ - SimpleNamespace(item_code="11111111"), - SimpleNamespace(item_code="22222222"), - ] - - async def mock_get_ingka_pip_items(constants: Constants, item_codes: list[str]): - assert item_codes == exp_item_codes - if early_exit: - return exp_items - else: - return [exp_items[0]] - - async def mock_get_iows_items(constants: Constants, item_codes: list[str]): - if early_exit: - raise NotImplementedError - assert item_codes == [exp_item_codes[1]] - return [exp_items[1]] - - monkeypatch.setattr( - ikea_api.wrappers.wrappers, "_get_ingka_pip_items", mock_get_ingka_pip_items - ) - monkeypatch.setattr( - ikea_api.wrappers.wrappers, "_get_iows_items", mock_get_iows_items - ) - - assert await get_items(constants, raw_item_codes) == exp_items