Skip to content

Commit 7e5eeb2

Browse files
committed
WIP
1 parent 3c15f02 commit 7e5eeb2

8 files changed

Lines changed: 508 additions & 211 deletions

File tree

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ per-file-ignores = [
121121
"mpt_api_client/resources/catalog/mixins.py: WPS110 WPS202 WPS214 WPS215 WPS235",
122122
"mpt_api_client/resources/catalog/products.py: WPS204 WPS214 WPS215 WPS235",
123123
"mpt_api_client/rql/query_builder.py: WPS110 WPS115 WPS210 WPS214",
124+
"seed/catalog/product.py: WPS202 WPS217 WPS201 WPS213",
124125
"tests/unit/http/test_async_service.py: WPS204 WPS202",
125126
"tests/unit/http/test_service.py: WPS204 WPS202",
126127
"tests/unit/http/test_mixins.py: WPS204 WPS202 WPS210",
@@ -131,6 +132,7 @@ per-file-ignores = [
131132
"tests/e2e/accounts/*.py: WPS430 WPS202",
132133
"tests/e2e/catalog/*.py: WPS202 WPS421",
133134
"tests/e2e/catalog/items/*.py: WPS110 WPS202",
135+
"tests/seed/catalog/test_product.py: WPS202 WPS219",
134136
"tests/*: WPS432 WPS202",
135137
"seed/accounts/*.py: WPS453",
136138
]

seed/catalog/catalog.py

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,16 @@
1-
import asyncio
21
import logging
3-
from typing import Any
42

5-
from seed.catalog.item import seed_items
6-
from seed.catalog.item_group import seed_item_group
73
from seed.catalog.product import seed_product
8-
from seed.catalog.product_parameters import seed_parameters
9-
from seed.catalog.product_parameters_group import seed_parameter_group
104

115
logger = logging.getLogger(__name__)
126

137

14-
async def seed_groups_and_group_params() -> None:
15-
"""Seed parallel tasks for item groups and parameter groups."""
16-
tasks: list[asyncio.Task[Any]] = [
17-
asyncio.create_task(seed_item_group()),
18-
asyncio.create_task(seed_parameter_group()),
19-
]
20-
await asyncio.gather(*tasks)
21-
22-
23-
async def seed_items_and_params() -> None:
24-
"""Seed final tasks for items and parameters."""
25-
tasks: list[asyncio.Task[Any]] = [
26-
asyncio.create_task(seed_items()),
27-
asyncio.create_task(seed_parameters()),
28-
]
29-
await asyncio.gather(*tasks)
30-
31-
328
async def seed_catalog() -> None:
339
"""Seed catalog data including products, item groups, and parameters."""
3410
logger.debug("Seeding catalog ...")
11+
# "catalog.authorization.id": "AUT-9288-6146",
12+
# "catalog.listing.id": "LST-5489-0806",
13+
# "catalog.price_list.id": "PRC-7255-3950-0245",
3514
await seed_product()
36-
await seed_groups_and_group_params()
37-
await seed_items_and_params()
3815

3916
logger.debug("Seeded catalog completed.")

0 commit comments

Comments
 (0)