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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions tests/e2e/catalog/items/test_async_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ async def test_update_item(async_mpt_vendor, async_created_item):
assert result.name == "e2e - delete me (updated)"


@pytest.mark.skip(reason="Leaves test items in the catalog")
async def test_review_and_publish_item(async_mpt_vendor, async_mpt_ops, async_created_item):
item = await async_mpt_vendor.catalog.items.review(async_created_item.id)
assert item.status == "Pending"

item = await async_mpt_ops.catalog.items.publish(async_created_item.id)
assert item.status == "Published"
result = await async_mpt_ops.catalog.items.publish(async_created_item.id)

assert result.status == "Published"


async def test_get_item(async_mpt_vendor, item_id):
Expand Down
6 changes: 3 additions & 3 deletions tests/e2e/catalog/items/test_sync_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ def test_update_item(mpt_vendor, created_item):
assert result.name == "please delete me"


@pytest.mark.skip(reason="Leaves test items in the catalog") # noqa: AAA01
def test_review_and_publish_item(mpt_vendor, mpt_ops, created_item):
item = mpt_vendor.catalog.items.review(created_item.id)
assert item.status == "Pending"

item = mpt_ops.catalog.items.publish(created_item.id)
assert item.status == "Published"
result = mpt_ops.catalog.items.publish(created_item.id)

assert result.status == "Published"


def test_get_item(mpt_vendor, item_id):
Expand Down
8 changes: 3 additions & 5 deletions tests/e2e/catalog/product/documents/test_async_document.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,21 +81,19 @@ async def test_filter_documents_async(async_document_service, created_document_f
assert documents[0].id == created_document_from_file_async.id


@pytest.mark.skip(reason="Leaves test documents in published state")
async def test_review_and_publish_document_async(
async_mpt_vendor, async_mpt_ops, created_document_from_file_async, product_id
):
vendor_service = async_mpt_vendor.catalog.products.documents(product_id)
ops_service = async_mpt_ops.catalog.products.documents(product_id)

document = await vendor_service.review(created_document_from_file_async.id)
assert document.status == "Pending"

document = await ops_service.publish(created_document_from_file_async.id)
assert document.status == "Published"

document = await ops_service.unpublish(created_document_from_file_async.id)
assert document.status == "Unpublished"
result = await ops_service.unpublish(created_document_from_file_async.id)

assert result.status == "Unpublished"


async def test_not_found_async(async_document_service):
Expand Down
8 changes: 3 additions & 5 deletions tests/e2e/catalog/product/documents/test_sync_document.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,19 +76,17 @@ def test_filter_documents(vendor_document_service, created_document_from_file):
assert result[0].id == created_document_from_file.id


@pytest.mark.skip(reason="Leaves test documents in published state") # noqa: AAA01
def test_review_and_publish_document(mpt_vendor, mpt_ops, created_document_from_file, product_id):
vendor_service = mpt_vendor.catalog.products.documents(product_id)
ops_service = mpt_ops.catalog.products.documents(product_id)

document = vendor_service.review(created_document_from_file.id)
assert document.status == "Pending"

document = ops_service.publish(created_document_from_file.id)
assert document.status == "Published"

document = ops_service.unpublish(created_document_from_file.id)
assert document.status == "Unpublished"
result = ops_service.unpublish(created_document_from_file.id)

assert result.status == "Unpublished"


def test_not_found(vendor_document_service):
Expand Down
12 changes: 4 additions & 8 deletions tests/e2e/catalog/product/test_async_product.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
from mpt_api_client import RQLQuery
from mpt_api_client.exceptions import MPTAPIError

pytestmark = [pytest.mark.flaky]


@pytest.fixture
async def async_created_product(async_mpt_vendor, product_data, logo_fd):
Expand All @@ -16,14 +18,12 @@ async def async_created_product(async_mpt_vendor, product_data, logo_fd):
print(f"TEARDOWN - Unable to delete product {product.id}: {error.title}") # noqa: WPS421


@pytest.mark.flaky
def test_create_product(async_created_product, product_data):
result = async_created_product.name == product_data["name"]

assert result is True


@pytest.mark.flaky
async def test_update_product(async_mpt_vendor, async_created_product, logo_fd):
update_data = {"name": "Updated Product"}

Expand All @@ -36,26 +36,22 @@ async def test_update_product(async_mpt_vendor, async_created_product, logo_fd):
assert result.name == update_data["name"]


@pytest.mark.skip(reason="Leaves test products in the catalog")
@pytest.mark.flaky
async def test_product_review_and_publish(async_mpt_vendor, async_mpt_ops, async_created_product):
await async_mpt_vendor.catalog.products.review(async_created_product.id)
await async_mpt_ops.catalog.products.publish(async_created_product.id)

await async_mpt_ops.catalog.products.publish(async_created_product.id) # act


@pytest.mark.flaky
async def test_get_product(async_mpt_vendor, product_id):
await async_mpt_vendor.catalog.products.get(product_id) # act


@pytest.mark.flaky
async def test_product_save_settings(async_mpt_vendor, async_created_product):
await async_mpt_vendor.catalog.products.update_settings( # act
async_created_product.id, {"itemSelection": True}
)


@pytest.mark.flaky
async def test_filter_and_select_products(async_mpt_vendor, product_id):
select_fields = ["-icon", "-revision", "-settings", "-vendor", "-statistics", "-website"]
filtered_products = (
Expand Down
12 changes: 4 additions & 8 deletions tests/e2e/catalog/product/test_sync_product.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
from mpt_api_client import RQLQuery
from mpt_api_client.exceptions import MPTAPIError

pytestmark = [pytest.mark.flaky]


@pytest.fixture
def created_product(mpt_vendor, product_data, logo_fd):
Expand All @@ -16,14 +18,12 @@ def created_product(mpt_vendor, product_data, logo_fd):
print(f"TEARDOWN - Unable to delete product {product.id}: {error.title}") # noqa: WPS421


@pytest.mark.flaky
def test_create_product(created_product, product_data):
result = created_product.name == product_data["name"]

assert result is True


@pytest.mark.flaky
def test_update_product(mpt_vendor, created_product, logo_fd):
update_data = {"name": "Updated Product"}

Expand All @@ -32,24 +32,20 @@ def test_update_product(mpt_vendor, created_product, logo_fd):
assert result.name == update_data["name"]


@pytest.mark.skip(reason="Leaves test products in the catalog") # noqa: AAA01
@pytest.mark.flaky
def test_product_review_and_publish(mpt_vendor, mpt_ops, created_product):
mpt_vendor.catalog.products.review(created_product.id)
mpt_ops.catalog.products.publish(created_product.id)

mpt_ops.catalog.products.publish(created_product.id) # act


@pytest.mark.flaky
def test_get_product(mpt_vendor, product_id):
mpt_vendor.catalog.products.get(product_id) # act


@pytest.mark.flaky
def test_product_save_settings(mpt_vendor, created_product):
mpt_vendor.catalog.products.update_settings(created_product.id, {"itemSelection": True}) # act


@pytest.mark.flaky
def test_filter_and_select_products(mpt_vendor, product_id):
select_fields = ["-icon", "-revision", "-settings", "-vendor", "-statistics", "-website"]
filtered_products = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ def async_units_of_measure_service(async_mpt_ops):
return async_mpt_ops.catalog.units_of_measure


@pytest.mark.skip(reason="Not implemented yet")
async def test_create(async_units_of_measure_service, short_uuid):
await async_units_of_measure_service.create({
"name": f"e2e-delete {short_uuid}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
pytestmark = [pytest.mark.flaky]


@pytest.mark.skip(reason="Not implemented yet")
def test_create(units_of_measure_service, short_uuid):
units_of_measure_service.create({
"name": f"e2e-delete {short_uuid}",
Expand Down