diff --git a/e2e_config.test.json b/e2e_config.test.json index b5809658..f7661d9f 100644 --- a/e2e_config.test.json +++ b/e2e_config.test.json @@ -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", diff --git a/tests/e2e/helpdesk/cases/test_async_cases.py b/tests/e2e/helpdesk/cases/test_async_cases.py index 3d517e43..7c5b5ece 100644 --- a/tests/e2e/helpdesk/cases/test_async_cases.py +++ b/tests/e2e/helpdesk/cases/test_async_cases.py @@ -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): @@ -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): @@ -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 diff --git a/tests/e2e/helpdesk/cases/test_sync_cases.py b/tests/e2e/helpdesk/cases/test_sync_cases.py index 90e3ea6d..1cf3417a 100644 --- a/tests/e2e/helpdesk/cases/test_sync_cases.py +++ b/tests/e2e/helpdesk/cases/test_sync_cases.py @@ -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): @@ -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): @@ -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 diff --git a/tests/e2e/helpdesk/channels/conftest.py b/tests/e2e/helpdesk/channels/conftest.py index 321e0668..433511ec 100644 --- a/tests/e2e/helpdesk/channels/conftest.py +++ b/tests/e2e/helpdesk/channels/conftest.py @@ -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" diff --git a/tests/e2e/helpdesk/channels/test_async_channels.py b/tests/e2e/helpdesk/channels/test_async_channels.py index 8fd7232d..58b8910c 100644 --- a/tests/e2e/helpdesk/channels/test_async_channels.py +++ b/tests/e2e/helpdesk/channels/test_async_channels.py @@ -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): @@ -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): @@ -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 diff --git a/tests/e2e/helpdesk/channels/test_sync_channels.py b/tests/e2e/helpdesk/channels/test_sync_channels.py index fa7da449..a5509b7e 100644 --- a/tests/e2e/helpdesk/channels/test_sync_channels.py +++ b/tests/e2e/helpdesk/channels/test_sync_channels.py @@ -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): @@ -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): @@ -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 diff --git a/tests/e2e/helpdesk/chats/answers/parameters/test_async_parameters.py b/tests/e2e/helpdesk/chats/answers/parameters/test_async_parameters.py index 5aee0845..984e05be 100644 --- a/tests/e2e/helpdesk/chats/answers/parameters/test_async_parameters.py +++ b/tests/e2e/helpdesk/chats/answers/parameters/test_async_parameters.py @@ -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): diff --git a/tests/e2e/helpdesk/chats/answers/parameters/test_sync_parameters.py b/tests/e2e/helpdesk/chats/answers/parameters/test_sync_parameters.py index 52dfa576..2e26b0ee 100644 --- a/tests/e2e/helpdesk/chats/answers/parameters/test_sync_parameters.py +++ b/tests/e2e/helpdesk/chats/answers/parameters/test_sync_parameters.py @@ -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): diff --git a/tests/e2e/helpdesk/chats/answers/test_async_answers.py b/tests/e2e/helpdesk/chats/answers/test_async_answers.py index 6d568c9e..0b623352 100644 --- a/tests/e2e/helpdesk/chats/answers/test_async_answers.py +++ b/tests/e2e/helpdesk/chats/answers/test_async_answers.py @@ -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): @@ -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( @@ -37,14 +37,14 @@ 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): @@ -52,7 +52,7 @@ async def test_query_chat_answer(async_chat_answers_service, async_created_chat_ 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): @@ -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): diff --git a/tests/e2e/helpdesk/chats/answers/test_sync_answers.py b/tests/e2e/helpdesk/chats/answers/test_sync_answers.py index 9843c4a5..ae74c7a5 100644 --- a/tests/e2e/helpdesk/chats/answers/test_sync_answers.py +++ b/tests/e2e/helpdesk/chats/answers/test_sync_answers.py @@ -27,7 +27,7 @@ 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): @@ -35,14 +35,14 @@ def test_update_chat_answer(chat_answers_service, created_chat_answer, short_uui 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): @@ -50,19 +50,19 @@ def test_query_chat_answer(chat_answers_service, created_chat_answer): 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): diff --git a/tests/e2e/helpdesk/chats/attachment/test_async_attachment.py b/tests/e2e/helpdesk/chats/attachment/test_async_attachment.py index b11087b0..f9fa6169 100644 --- a/tests/e2e/helpdesk/chats/attachment/test_async_attachment.py +++ b/tests/e2e/helpdesk/chats/attachment/test_async_attachment.py @@ -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( @@ -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 diff --git a/tests/e2e/helpdesk/chats/attachment/test_sync_attachment.py b/tests/e2e/helpdesk/chats/attachment/test_sync_attachment.py index e82b1c6a..22b18dd3 100644 --- a/tests/e2e/helpdesk/chats/attachment/test_sync_attachment.py +++ b/tests/e2e/helpdesk/chats/attachment/test_sync_attachment.py @@ -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): @@ -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 diff --git a/tests/e2e/helpdesk/chats/conftest.py b/tests/e2e/helpdesk/chats/conftest.py index dc5521af..c4009c28 100644 --- a/tests/e2e/helpdesk/chats/conftest.py +++ b/tests/e2e/helpdesk/chats/conftest.py @@ -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" diff --git a/tests/e2e/helpdesk/chats/links/test_async_links.py b/tests/e2e/helpdesk/chats/links/test_async_links.py index 24a2f52a..65e94ecd 100644 --- a/tests/e2e/helpdesk/chats/links/test_async_links.py +++ b/tests/e2e/helpdesk/chats/links/test_async_links.py @@ -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"] @@ -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 diff --git a/tests/e2e/helpdesk/chats/links/test_sync_links.py b/tests/e2e/helpdesk/chats/links/test_sync_links.py index 201e30bb..9e201a95 100644 --- a/tests/e2e/helpdesk/chats/links/test_sync_links.py +++ b/tests/e2e/helpdesk/chats/links/test_sync_links.py @@ -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"] @@ -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 diff --git a/tests/e2e/helpdesk/chats/messages/test_async_messages.py b/tests/e2e/helpdesk/chats/messages/test_async_messages.py index c113b453..cc9dd452 100644 --- a/tests/e2e/helpdesk/chats/messages/test_async_messages.py +++ b/tests/e2e/helpdesk/chats/messages/test_async_messages.py @@ -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"] @@ -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): diff --git a/tests/e2e/helpdesk/chats/messages/test_sync_messages.py b/tests/e2e/helpdesk/chats/messages/test_sync_messages.py index fd878201..813147c1 100644 --- a/tests/e2e/helpdesk/chats/messages/test_sync_messages.py +++ b/tests/e2e/helpdesk/chats/messages/test_sync_messages.py @@ -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): diff --git a/tests/e2e/helpdesk/chats/participants/conftest.py b/tests/e2e/helpdesk/chats/participants/conftest.py index 21f1deaa..12986081 100644 --- a/tests/e2e/helpdesk/chats/participants/conftest.py +++ b/tests/e2e/helpdesk/chats/participants/conftest.py @@ -7,13 +7,13 @@ @pytest.fixture -def chat_participants_service(mpt_ops, chat_id): - return mpt_ops.helpdesk.chats.participants(chat_id) +def chat_participants_service(mpt_ops, created_chat): + return mpt_ops.helpdesk.chats.participants(created_chat.id) @pytest.fixture -def async_chat_participants_service(async_mpt_ops, chat_id): - return async_mpt_ops.helpdesk.chats.participants(chat_id) +def async_chat_participants_service(async_mpt_ops, created_chat): + return async_mpt_ops.helpdesk.chats.participants(created_chat.id) @pytest.fixture diff --git a/tests/e2e/helpdesk/chats/participants/test_async_participants.py b/tests/e2e/helpdesk/chats/participants/test_async_participants.py index 795cd5a9..c3b43fd0 100644 --- a/tests/e2e/helpdesk/chats/participants/test_async_participants.py +++ b/tests/e2e/helpdesk/chats/participants/test_async_participants.py @@ -17,7 +17,7 @@ async def test_list_chat_participants(async_chat_participants_service): @pytest.mark.skip(reason="Unskip after MPT-19124 completed") # noqa: AAA01 def test_create_chat_participant(async_created_chat_participant): - assert async_created_chat_participant.id is not None + assert isinstance(async_created_chat_participant, ChatParticipant) @pytest.mark.skip(reason="Unskip after MPT-19124 completed") @@ -29,7 +29,7 @@ async def test_update_chat_participant( {"status": "Active"}, ) - assert result.id == async_created_chat_participant.id + assert isinstance(result, ChatParticipant) @pytest.mark.skip(reason="Unskip after MPT-19124 completed") diff --git a/tests/e2e/helpdesk/chats/participants/test_sync_participants.py b/tests/e2e/helpdesk/chats/participants/test_sync_participants.py index 8894dbd3..6faf1e0e 100644 --- a/tests/e2e/helpdesk/chats/participants/test_sync_participants.py +++ b/tests/e2e/helpdesk/chats/participants/test_sync_participants.py @@ -17,14 +17,14 @@ def test_list_chat_participants(chat_participants_service): @pytest.mark.skip(reason="Unskip after MPT-19124 completed") # noqa: AAA01 def test_create_chat_participant(created_chat_participant): - assert created_chat_participant.id is not None + assert isinstance(created_chat_participant, ChatParticipant) @pytest.mark.skip(reason="Unskip after MPT-19124 completed") def test_update_chat_participant(chat_participants_service, created_chat_participant): result = chat_participants_service.update(created_chat_participant.id, {"status": "Active"}) - assert result.id == created_chat_participant.id + assert isinstance(result, ChatParticipant) @pytest.mark.skip(reason="Unskip after MPT-19124 completed") diff --git a/tests/e2e/helpdesk/chats/test_async_chats.py b/tests/e2e/helpdesk/chats/test_async_chats.py index b29d4457..e911437a 100644 --- a/tests/e2e/helpdesk/chats/test_async_chats.py +++ b/tests/e2e/helpdesk/chats/test_async_chats.py @@ -8,12 +8,12 @@ pytestmark = [pytest.mark.flaky] -async def test_get_chat(async_mpt_ops, chat_id): +async def test_get_chat(async_mpt_ops, created_chat): service = async_mpt_ops.helpdesk.chats - result = await service.get(chat_id) + result = await service.get(created_chat.id) - assert result.id == chat_id + assert isinstance(result, Chat) async def test_list_chats(async_mpt_ops): @@ -25,13 +25,13 @@ async def test_list_chats(async_mpt_ops): assert all(isinstance(chat, Chat) for chat in result) -async def test_update_chat(async_mpt_ops, chat_id, short_uuid): +async def test_update_chat(async_mpt_ops, created_chat, short_uuid): service = async_mpt_ops.helpdesk.chats new_description = f"e2e update {short_uuid}" - result = await service.update(chat_id, {"description": new_description}) + result = await service.update(created_chat.id, {"description": new_description}) - assert result.id == chat_id + assert isinstance(result, Chat) assert result.to_dict().get("description") == new_description diff --git a/tests/e2e/helpdesk/chats/test_sync_chats.py b/tests/e2e/helpdesk/chats/test_sync_chats.py index ebf36612..718d8ac9 100644 --- a/tests/e2e/helpdesk/chats/test_sync_chats.py +++ b/tests/e2e/helpdesk/chats/test_sync_chats.py @@ -8,12 +8,12 @@ pytestmark = [pytest.mark.flaky] -def test_get_chat(mpt_ops, chat_id): +def test_get_chat(mpt_ops, created_chat): service = mpt_ops.helpdesk.chats - result = service.get(chat_id) + result = service.get(created_chat.id) - assert result.id == chat_id + assert isinstance(result, Chat) def test_list_chats(mpt_ops): @@ -25,13 +25,13 @@ def test_list_chats(mpt_ops): assert all(isinstance(chat, Chat) for chat in result) -def test_update_chat(mpt_ops, chat_id, short_uuid): +def test_update_chat(mpt_ops, created_chat, short_uuid): service = mpt_ops.helpdesk.chats new_description = f"e2e update {short_uuid}" - result = service.update(chat_id, {"description": new_description}) + result = service.update(created_chat.id, {"description": new_description}) - assert result.id == chat_id + assert isinstance(result, Chat) assert result.to_dict().get("description") == new_description diff --git a/tests/e2e/helpdesk/forms/test_async_forms.py b/tests/e2e/helpdesk/forms/test_async_forms.py index b3ebc989..aaf087a6 100644 --- a/tests/e2e/helpdesk/forms/test_async_forms.py +++ b/tests/e2e/helpdesk/forms/test_async_forms.py @@ -11,7 +11,7 @@ async def test_get_form(async_mpt_ops, async_created_form): result = await async_mpt_ops.helpdesk.forms.get(async_created_form.id) - assert result.id == async_created_form.id + assert isinstance(result, Form) async def test_list_forms(async_mpt_ops): @@ -24,7 +24,7 @@ async def test_list_forms(async_mpt_ops): def test_create_form(async_created_form): result = async_created_form - assert result is not None + assert isinstance(result, Form) async def test_update_form(async_mpt_ops, async_created_form, short_uuid): @@ -32,14 +32,14 @@ async def test_update_form(async_mpt_ops, async_created_form, short_uuid): result = await async_mpt_ops.helpdesk.forms.update(async_created_form.id, update_data) - assert result.id == async_created_form.id + assert isinstance(result, Form) assert result.to_dict().get("description") == update_data["description"] async def test_publish_form(async_mpt_ops, async_created_form): result = await async_mpt_ops.helpdesk.forms.publish(async_created_form.id) - assert result is not None + assert isinstance(result, Form) async def test_unpublish_form(async_mpt_ops, async_created_published_form): diff --git a/tests/e2e/helpdesk/forms/test_sync_forms.py b/tests/e2e/helpdesk/forms/test_sync_forms.py index ec9c25a5..d0fdd730 100644 --- a/tests/e2e/helpdesk/forms/test_sync_forms.py +++ b/tests/e2e/helpdesk/forms/test_sync_forms.py @@ -11,7 +11,7 @@ def test_get_form(mpt_ops, created_form): result = mpt_ops.helpdesk.forms.get(created_form.id) - assert result.id == created_form.id + assert isinstance(result, Form) def test_list_forms(mpt_ops): @@ -24,7 +24,7 @@ def test_list_forms(mpt_ops): def test_create_form(created_form): result = created_form - assert result is not None + assert isinstance(result, Form) def test_update_form(mpt_ops, created_form, short_uuid): @@ -32,14 +32,14 @@ def test_update_form(mpt_ops, created_form, short_uuid): result = mpt_ops.helpdesk.forms.update(created_form.id, update_data) - assert result.id == created_form.id + assert isinstance(result, Form) assert result.to_dict().get("description") == update_data["description"] def test_publish_form(mpt_ops, created_form): result = mpt_ops.helpdesk.forms.publish(created_form.id) - assert result is not None + assert isinstance(result, Form) def test_unpublish_form(mpt_ops, created_published_form): diff --git a/tests/e2e/helpdesk/parameter_groups/parameters/test_async_parameters.py b/tests/e2e/helpdesk/parameter_groups/parameters/test_async_parameters.py index 40a1d0f1..c23c2955 100644 --- a/tests/e2e/helpdesk/parameter_groups/parameters/test_async_parameters.py +++ b/tests/e2e/helpdesk/parameter_groups/parameters/test_async_parameters.py @@ -18,7 +18,7 @@ async def test_get_parameter_group_parameter( async_created_parameter_group_parameter.id ) - assert result.id == async_created_parameter_group_parameter.id + assert isinstance(result, ParameterGroupParameter) async def test_list_parameter_group_parameters( @@ -34,7 +34,7 @@ async def test_list_parameter_group_parameters( def test_create_parameter_group_parameter(async_created_parameter_group_parameter): result = async_created_parameter_group_parameter - assert result is not None + assert isinstance(result, ParameterGroupParameter) async def test_update_parameter_group_parameter( @@ -47,7 +47,7 @@ async def test_update_parameter_group_parameter( update_data, ) - assert result.id == async_created_parameter_group_parameter.id + assert isinstance(result, ParameterGroupParameter) assert result.to_dict().get("displayOrder") == update_data["displayOrder"] diff --git a/tests/e2e/helpdesk/parameter_groups/parameters/test_sync_parameters.py b/tests/e2e/helpdesk/parameter_groups/parameters/test_sync_parameters.py index 231548b4..b489b79c 100644 --- a/tests/e2e/helpdesk/parameter_groups/parameters/test_sync_parameters.py +++ b/tests/e2e/helpdesk/parameter_groups/parameters/test_sync_parameters.py @@ -16,7 +16,7 @@ def test_get_parameter_group_parameter( ): result = parameter_group_parameters_service.get(created_parameter_group_parameter.id) - assert result.id == created_parameter_group_parameter.id + assert isinstance(result, ParameterGroupParameter) def test_list_parameter_group_parameters( @@ -32,7 +32,7 @@ def test_list_parameter_group_parameters( def test_create_parameter_group_parameter(created_parameter_group_parameter): result = created_parameter_group_parameter - assert result is not None + assert isinstance(result, ParameterGroupParameter) def test_update_parameter_group_parameter( @@ -44,7 +44,7 @@ def test_update_parameter_group_parameter( created_parameter_group_parameter.id, update_data ) - assert result.id == created_parameter_group_parameter.id + assert isinstance(result, ParameterGroupParameter) assert result.to_dict().get("displayOrder") == update_data["displayOrder"] diff --git a/tests/e2e/helpdesk/parameter_groups/test_async_parameter_groups.py b/tests/e2e/helpdesk/parameter_groups/test_async_parameter_groups.py index bf3ca84c..11c91bcc 100644 --- a/tests/e2e/helpdesk/parameter_groups/test_async_parameter_groups.py +++ b/tests/e2e/helpdesk/parameter_groups/test_async_parameter_groups.py @@ -14,7 +14,7 @@ async def test_get_parameter_group(async_parameter_groups_service, async_created_parameter_group): result = await async_parameter_groups_service.get(async_created_parameter_group.id) - assert result.id == async_created_parameter_group.id + assert isinstance(result, ParameterGroup) async def test_list_parameter_groups(async_parameter_groups_service): @@ -27,7 +27,7 @@ async def test_list_parameter_groups(async_parameter_groups_service): def test_create_parameter_group(async_created_parameter_group): result = async_created_parameter_group - assert result is not None + assert isinstance(result, ParameterGroup) async def test_update_parameter_group( @@ -39,7 +39,7 @@ async def test_update_parameter_group( async_created_parameter_group.id, update_data ) - assert result.id == async_created_parameter_group.id + assert isinstance(result, ParameterGroup) assert result.to_dict().get("description") == update_data["description"] diff --git a/tests/e2e/helpdesk/parameter_groups/test_sync_parameter_groups.py b/tests/e2e/helpdesk/parameter_groups/test_sync_parameter_groups.py index 415103fd..ae66f3f6 100644 --- a/tests/e2e/helpdesk/parameter_groups/test_sync_parameter_groups.py +++ b/tests/e2e/helpdesk/parameter_groups/test_sync_parameter_groups.py @@ -14,7 +14,7 @@ def test_get_parameter_group(parameter_groups_service, created_parameter_group): result = parameter_groups_service.get(created_parameter_group.id) - assert result.id == created_parameter_group.id + assert isinstance(result, ParameterGroup) def test_list_parameter_groups(parameter_groups_service): @@ -27,7 +27,7 @@ def test_list_parameter_groups(parameter_groups_service): def test_create_parameter_group(created_parameter_group): result = created_parameter_group - assert result is not None + assert isinstance(result, ParameterGroup) def test_update_parameter_group(parameter_groups_service, created_parameter_group, short_uuid): @@ -35,7 +35,7 @@ def test_update_parameter_group(parameter_groups_service, created_parameter_grou result = parameter_groups_service.update(created_parameter_group.id, update_data) - assert result.id == created_parameter_group.id + assert isinstance(result, ParameterGroup) assert result.to_dict().get("description") == update_data["description"] diff --git a/tests/e2e/helpdesk/parameters/test_async_parameters.py b/tests/e2e/helpdesk/parameters/test_async_parameters.py index d12988cb..1522adc3 100644 --- a/tests/e2e/helpdesk/parameters/test_async_parameters.py +++ b/tests/e2e/helpdesk/parameters/test_async_parameters.py @@ -14,7 +14,7 @@ async def test_get_parameter(async_mpt_ops, async_created_parameter): result = await async_mpt_ops.helpdesk.parameters.get(async_created_parameter.id) - assert result.id == async_created_parameter.id + assert isinstance(result, Parameter) async def test_list_parameters(async_mpt_ops): @@ -27,7 +27,7 @@ async def test_list_parameters(async_mpt_ops): def test_create_parameter(async_created_parameter): result = async_created_parameter - assert result is not None + assert isinstance(result, Parameter) async def test_update_parameter(async_mpt_ops, async_created_parameter, short_uuid): @@ -35,7 +35,7 @@ async def test_update_parameter(async_mpt_ops, async_created_parameter, short_uu result = await async_mpt_ops.helpdesk.parameters.update(async_created_parameter.id, update_data) - assert result.id == async_created_parameter.id + assert isinstance(result, Parameter) assert result.to_dict().get("description") == update_data["description"] diff --git a/tests/e2e/helpdesk/parameters/test_sync_parameters.py b/tests/e2e/helpdesk/parameters/test_sync_parameters.py index 6be08d8b..46617470 100644 --- a/tests/e2e/helpdesk/parameters/test_sync_parameters.py +++ b/tests/e2e/helpdesk/parameters/test_sync_parameters.py @@ -14,7 +14,7 @@ def test_get_parameter(mpt_ops, created_parameter): result = mpt_ops.helpdesk.parameters.get(created_parameter.id) - assert result.id == created_parameter.id + assert isinstance(result, Parameter) def test_list_parameters(mpt_ops): @@ -27,7 +27,7 @@ def test_list_parameters(mpt_ops): def test_create_parameter(created_parameter): result = created_parameter - assert result is not None + assert isinstance(result, Parameter) def test_update_parameter(mpt_ops, created_parameter, short_uuid): @@ -35,7 +35,7 @@ def test_update_parameter(mpt_ops, created_parameter, short_uuid): result = mpt_ops.helpdesk.parameters.update(created_parameter.id, update_data) - assert result.id == created_parameter.id + assert isinstance(result, Parameter) assert result.to_dict().get("description") == update_data["description"] diff --git a/tests/e2e/helpdesk/queues/test_async_queues.py b/tests/e2e/helpdesk/queues/test_async_queues.py index 8ffe6ec4..5024f4de 100644 --- a/tests/e2e/helpdesk/queues/test_async_queues.py +++ b/tests/e2e/helpdesk/queues/test_async_queues.py @@ -11,7 +11,7 @@ async def test_get_queue(async_mpt_ops, async_created_queue): result = await async_mpt_ops.helpdesk.queues.get(async_created_queue.id) - assert result.id == async_created_queue.id + assert isinstance(result, Queue) async def test_list_queues(async_mpt_ops): @@ -32,7 +32,7 @@ async def test_update_queue(async_mpt_ops, async_created_queue, short_uuid): result = await async_mpt_ops.helpdesk.queues.update(async_created_queue.id, update_data) - assert result.id == async_created_queue.id + assert isinstance(result, Queue) assert result.to_dict().get("description") == update_data["description"] diff --git a/tests/e2e/helpdesk/queues/test_sync_queues.py b/tests/e2e/helpdesk/queues/test_sync_queues.py index 46149c3f..ac759c09 100644 --- a/tests/e2e/helpdesk/queues/test_sync_queues.py +++ b/tests/e2e/helpdesk/queues/test_sync_queues.py @@ -11,7 +11,7 @@ def test_get_queue(mpt_ops, created_queue): result = mpt_ops.helpdesk.queues.get(created_queue.id) - assert result.id == created_queue.id + assert isinstance(result, Queue) def test_list_queues(mpt_ops): @@ -32,7 +32,7 @@ def test_update_queue(mpt_ops, created_queue, short_uuid): result = mpt_ops.helpdesk.queues.update(created_queue.id, update_data) - assert result.id == created_queue.id + assert isinstance(result, Queue) assert result.to_dict().get("description") == update_data["description"]