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
2 changes: 0 additions & 2 deletions e2e_config.test.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@
"commerce.product.listing.id": "LST-5489-0806",
"commerce.product.template.id": "TPL-1767-7355-0002",
"commerce.user.id": "USR-4303-2348",
"helpdesk.chat.id": "CHT-5064-0262-3671",
"helpdesk.channel.id": "CHL-5064-0262-3671",
"commerce.subscription.agreement.id": "AGR-2473-3299-1721",
"commerce.subscription.id": "SUB-3678-1831-2188",
"commerce.subscription.product.item.id": "ITM-1767-7355-0001",
Expand Down
6 changes: 3 additions & 3 deletions tests/e2e/helpdesk/cases/test_async_cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
async def test_get_case(async_mpt_ops, async_created_case):
result = await async_mpt_ops.helpdesk.cases.get(async_created_case.id)

assert result.id == async_created_case.id
assert isinstance(result, Case)


async def test_list_cases(async_mpt_ops):
Expand All @@ -26,7 +26,7 @@ async def test_list_cases(async_mpt_ops):
def test_create_case(async_created_case):
result = async_created_case

assert result is not None
assert isinstance(result, Case)


async def test_update_case(async_mpt_ops, async_created_case, short_uuid):
Expand All @@ -35,7 +35,7 @@ async def test_update_case(async_mpt_ops, async_created_case, short_uuid):

result = await async_mpt_ops.helpdesk.cases.update(async_created_case.id, update_data)

assert result.id == async_created_case.id
assert isinstance(result, Case)
assert result.to_dict().get("awaiting") is True


Expand Down
6 changes: 3 additions & 3 deletions tests/e2e/helpdesk/cases/test_sync_cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
def test_get_case(mpt_ops, created_case):
result = mpt_ops.helpdesk.cases.get(created_case.id)

assert result.id == created_case.id
assert isinstance(result, Case)


def test_list_cases(mpt_ops):
Expand All @@ -26,7 +26,7 @@ def test_list_cases(mpt_ops):
def test_create_case(created_case):
result = created_case

assert result is not None
assert isinstance(result, Case)


def test_update_case(mpt_ops, created_case, short_uuid):
Expand All @@ -35,7 +35,7 @@ def test_update_case(mpt_ops, created_case, short_uuid):

result = mpt_ops.helpdesk.cases.update(created_case.id, update_data)

assert result.id == created_case.id
assert isinstance(result, Case)
assert result.to_dict().get("awaiting") is True


Expand Down
5 changes: 0 additions & 5 deletions tests/e2e/helpdesk/channels/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@
)


@pytest.fixture(scope="session")
def channel_id(e2e_config):
return e2e_config["helpdesk.channel.id"] # FIXME: seed data


@pytest.fixture(scope="session")
def invalid_channel_id():
return "CHN-0000-0000-0000"
Expand Down
6 changes: 3 additions & 3 deletions tests/e2e/helpdesk/channels/test_async_channels.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ async def test_get_channel(async_mpt_ops, channel_id):

result = await service.get(channel_id)

assert result.id == channel_id
assert isinstance(result, Channel)


async def test_list_channels(async_mpt_ops):
Expand All @@ -28,7 +28,7 @@ async def test_list_channels(async_mpt_ops):
def test_create_channel(async_created_channel):
result = async_created_channel

assert result.id is not None
assert isinstance(result, Channel)


async def test_update_channel(async_mpt_ops, async_created_channel, short_uuid):
Expand All @@ -37,7 +37,7 @@ async def test_update_channel(async_mpt_ops, async_created_channel, short_uuid):

result = await service.update(async_created_channel.id, {"name": new_name})

assert result.id == async_created_channel.id
assert isinstance(result, Channel)
assert result.to_dict().get("name") == new_name


Expand Down
6 changes: 3 additions & 3 deletions tests/e2e/helpdesk/channels/test_sync_channels.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def test_get_channel(mpt_ops, channel_id):

result = service.get(channel_id)

assert result.id == channel_id
assert isinstance(result, Channel)


def test_list_channels(mpt_ops):
Expand All @@ -28,7 +28,7 @@ def test_list_channels(mpt_ops):
def test_create_channel(created_channel):
result = created_channel

assert result.id is not None
assert isinstance(result, Channel)


def test_update_channel(mpt_ops, created_channel, short_uuid):
Expand All @@ -37,7 +37,7 @@ def test_update_channel(mpt_ops, created_channel, short_uuid):

result = service.update(created_channel.id, {"name": new_name})

assert result.id == created_channel.id
assert isinstance(result, Channel)
assert result.to_dict().get("name") == new_name


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ async def test_iterate_chat_answer_parameters(async_chat_answer_parameters_servi
iterator = async_chat_answer_parameters_service.iterate(limit=20)
result = await anext(iterator, None)

assert result is None or result.id is not None
assert isinstance(result, ChatAnswerParameter)


async def test_not_found(async_mpt_ops, chat_id):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def test_iterate_chat_answer_parameters(chat_answer_parameters_service):

result = next(iterator, None)

assert result is None or result.id is not None
assert isinstance(result, ChatAnswerParameter)


def test_not_found(mpt_ops, chat_id):
Expand Down
14 changes: 7 additions & 7 deletions tests/e2e/helpdesk/chats/answers/test_async_answers.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
async def test_get_chat_answer(async_chat_answers_service, async_created_chat_answer):
result = await async_chat_answers_service.get(async_created_chat_answer.id)

assert result.id == async_created_chat_answer.id
assert isinstance(result, ChatAnswer)


async def test_list_chat_answers(async_chat_answers_service):
Expand All @@ -27,7 +27,7 @@ async def test_list_chat_answers(async_chat_answers_service):
def test_create_chat_answer(async_created_chat_answer):
result = async_created_chat_answer

assert result is not None
assert isinstance(result, ChatAnswer)


async def test_update_chat_answer(
Expand All @@ -37,22 +37,22 @@ async def test_update_chat_answer(

result = await async_chat_answers_service.update(async_created_chat_answer.id, update_data)

assert result.id == async_created_chat_answer.id
assert isinstance(result, ChatAnswer)
assert result.to_dict().get("name") == update_data["name"]


async def test_submit_chat_answer(async_chat_answers_service, async_created_chat_answer):
result = await async_chat_answers_service.submit(async_created_chat_answer.id)

assert result is not None
assert isinstance(result, ChatAnswer)


async def test_query_chat_answer(async_chat_answers_service, async_created_chat_answer):
submitted_chat_answer = await async_chat_answers_service.submit(async_created_chat_answer.id)

result = await async_chat_answers_service.query(submitted_chat_answer.id)

assert result is not None
assert isinstance(result, ChatAnswer)


async def test_validate_chat_answer(async_chat_answers_service, async_created_chat_answer):
Expand All @@ -61,13 +61,13 @@ async def test_validate_chat_answer(async_chat_answers_service, async_created_ch
{"parameters": []},
)

assert result is not None
assert isinstance(result, ChatAnswer)


async def test_accept_chat_answer(async_chat_answers_service, async_created_chat_answer):
result = await async_chat_answers_service.accept(async_created_chat_answer.id)

assert result is not None
assert isinstance(result, ChatAnswer)


async def test_delete_chat_answer(async_chat_answers_service, async_created_chat_answer):
Expand Down
12 changes: 6 additions & 6 deletions tests/e2e/helpdesk/chats/answers/test_sync_answers.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,42 +27,42 @@ def test_list_chat_answers(chat_answers_service):
def test_create_chat_answer(created_chat_answer):
result = created_chat_answer

assert result is not None
assert isinstance(result, ChatAnswer)


def test_update_chat_answer(chat_answers_service, created_chat_answer, short_uuid):
update_data = {"name": f"e2e updated answer {short_uuid}"}

result = chat_answers_service.update(created_chat_answer.id, update_data)

assert result.id == created_chat_answer.id
assert isinstance(result, ChatAnswer)
assert result.to_dict().get("name") == update_data["name"]


def test_submit_chat_answer(chat_answers_service, created_chat_answer):
result = chat_answers_service.submit(created_chat_answer.id)

assert result is not None
assert isinstance(result, ChatAnswer)


def test_query_chat_answer(chat_answers_service, created_chat_answer):
submitted_chat_answer = chat_answers_service.submit(created_chat_answer.id)

result = chat_answers_service.query(submitted_chat_answer.id)

assert result is not None
assert isinstance(result, ChatAnswer)


def test_validate_chat_answer(chat_answers_service, created_chat_answer):
result = chat_answers_service.validate(created_chat_answer.id, {"parameters": []})

assert result is not None
assert isinstance(result, ChatAnswer)


def test_accept_chat_answer(chat_answers_service, created_chat_answer):
result = chat_answers_service.accept(created_chat_answer.id)

assert result is not None
assert isinstance(result, ChatAnswer)


def test_delete_chat_answer(chat_answers_service, created_chat_answer):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ async def test_list_chat_attachments(async_chat_attachments_service, async_creat


def test_create_chat_attachment(async_created_chat_attachment, chat_attachment_data): # noqa: AAA01
assert async_created_chat_attachment.id is not None
assert isinstance(async_created_chat_attachment, ChatAttachment)
assert async_created_chat_attachment.to_dict().get("name") == chat_attachment_data["name"]


async def test_get_chat_attachment(async_chat_attachments_service, async_created_chat_attachment):
result = await async_chat_attachments_service.get(async_created_chat_attachment.id)

assert result.id == async_created_chat_attachment.id
assert isinstance(result, ChatAttachment)


async def test_update_chat_attachment(
Expand All @@ -36,7 +36,7 @@ async def test_update_chat_attachment(
{"name": updated_name, "description": updated_name},
)

assert result.id == async_created_chat_attachment.id
assert isinstance(result, ChatAttachment)
assert result.to_dict().get("name") == updated_name


Expand Down
6 changes: 3 additions & 3 deletions tests/e2e/helpdesk/chats/attachment/test_sync_attachment.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ def test_list_chat_attachments(chat_attachments_service, created_chat_attachment


def test_create_chat_attachment(created_chat_attachment, chat_attachment_data): # noqa: AAA01
assert created_chat_attachment.id is not None
assert isinstance(created_chat_attachment, ChatAttachment)
assert created_chat_attachment.to_dict().get("name") == chat_attachment_data["name"]


def test_get_chat_attachment(chat_attachments_service, created_chat_attachment):
result = chat_attachments_service.get(created_chat_attachment.id)

assert result.id == created_chat_attachment.id
assert isinstance(result, ChatAttachment)


def test_update_chat_attachment(chat_attachments_service, created_chat_attachment, short_uuid):
Expand All @@ -34,7 +34,7 @@ def test_update_chat_attachment(chat_attachments_service, created_chat_attachmen
{"name": updated_name, "description": updated_name},
)

assert result.id == created_chat_attachment.id
assert isinstance(result, ChatAttachment)
assert result.to_dict().get("name") == updated_name


Expand Down
5 changes: 0 additions & 5 deletions tests/e2e/helpdesk/chats/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@
)


@pytest.fixture(scope="session")
def chat_id(e2e_config):
return e2e_config["helpdesk.chat.id"]


@pytest.fixture(scope="session")
def invalid_chat_id():
return "CHT-0000-0000-0000"
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/helpdesk/chats/links/test_async_links.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ async def test_list_chat_links(async_created_chat_link_service):


def test_create_chat_link(async_created_chat_link, chat_link_data): # noqa: AAA01
assert async_created_chat_link.id is not None
assert isinstance(async_created_chat_link, ChatLink)
assert async_created_chat_link.to_dict().get("uri") == chat_link_data["uri"]


Expand All @@ -28,7 +28,7 @@ async def test_update_chat_link_name(async_chat_links_service, async_created_cha
{"name": new_name},
)

assert result.id == async_created_chat_link.id
assert isinstance(result, ChatLink)
assert result.to_dict().get("name") == new_name


Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/helpdesk/chats/links/test_sync_links.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def test_list_chat_links(created_chat_link_service):


def test_create_chat_link(created_chat_link, chat_link_data): # noqa: AAA01
assert created_chat_link.id is not None
assert isinstance(created_chat_link, ChatLink)
assert created_chat_link.to_dict().get("uri") == chat_link_data["uri"]


Expand All @@ -25,7 +25,7 @@ def test_update_chat_link_name(chat_links_service, created_chat_link, short_uuid

result = chat_links_service.update(created_chat_link.id, {"name": new_name})

assert result.id == created_chat_link.id
assert isinstance(result, ChatLink)
assert result.to_dict().get("name") == new_name


Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/helpdesk/chats/messages/test_async_messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ async def test_list_chat_messages(async_chat_messages_service):


def test_create_chat_message(async_created_chat_message, chat_message_data): # noqa: AAA01
assert async_created_chat_message.id is not None
assert isinstance(async_created_chat_message, ChatMessage)
assert async_created_chat_message.to_dict().get("content") == chat_message_data["content"]


Expand All @@ -28,7 +28,7 @@ async def test_update_chat_message_visibility(
{"visibility": "Public"},
)

assert result.id == async_created_chat_message.id
assert isinstance(result, ChatMessage)


async def test_delete_chat_message(async_chat_messages_service, async_created_chat_message):
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/helpdesk/chats/messages/test_sync_messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ def test_list_chat_messages(chat_messages_service):


def test_create_chat_message(created_chat_message, chat_message_data): # noqa: AAA01
assert created_chat_message.id is not None
assert isinstance(created_chat_message, ChatMessage)
assert created_chat_message.to_dict().get("content") == chat_message_data["content"]


def test_update_chat_message_visibility(chat_messages_service, created_chat_message):
result = chat_messages_service.update(created_chat_message.id, {"visibility": "Public"})

assert result.id == created_chat_message.id
assert isinstance(result, ChatMessage)


def test_delete_chat_message(chat_messages_service, created_chat_message):
Expand Down
Loading