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
8 changes: 3 additions & 5 deletions tests/e2e/helpdesk/cases/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,14 @@ def invalid_case_id():


@pytest.fixture
def case_factory(short_uuid):
def case_factory(short_uuid, created_queue):
def factory(
title: str = "E2E Created Helpdesk Case",
description: str = "E2E Created Helpdesk Case Description",
):
return {
"title": f"{title} {short_uuid}",
"description": description,
"priority": "Low",
"type": "General",
"queue": {"id": created_queue.id},
"chat": {"lastMessage": {"content": "E2E testing!!!"}},
}

return factory
Expand Down
15 changes: 6 additions & 9 deletions tests/e2e/helpdesk/cases/test_async_cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ def test_create_case(async_created_case):
assert result is not None


@pytest.mark.skip(reason="Unskip after MPT-19124 completed")
async def test_update_case(async_mpt_ops, async_created_case, short_uuid):
update_data = {"description": f"e2e update {short_uuid}"}
assert async_created_case.to_dict().get("awaiting") is False
update_data = {"awaiting": True}

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

assert result.id == async_created_case.id
assert result.to_dict().get("description") == update_data["description"]
assert result.to_dict().get("awaiting") is True


@pytest.mark.skip(reason="Unskip after MPT-19124 completed")
Expand All @@ -48,15 +48,12 @@ async def test_process_case(async_mpt_ops, async_created_case):
assert result is not None


@pytest.mark.skip(reason="Unskip after MPT-19124 completed")
async def test_query_case(async_mpt_ops, async_created_case):
processed_case = await async_mpt_ops.helpdesk.cases.process(async_created_case.id)

async def test_query_case(async_mpt_ops, async_created_case, short_uuid):
result = await async_mpt_ops.helpdesk.cases.query(
processed_case.id, {"queryPrompt": "Could you provide more details?"}
async_created_case.id, {"queryPrompt": f"e2e update {short_uuid}"}
)

assert result is not None
assert result.to_dict().get("queryPrompt") == f"e2e update {short_uuid}"


@pytest.mark.skip(reason="Unskip after MPT-19124 completed")
Expand Down
15 changes: 6 additions & 9 deletions tests/e2e/helpdesk/cases/test_sync_cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ def test_create_case(created_case):
assert result is not None


@pytest.mark.skip(reason="Unskip after MPT-19124 completed")
def test_update_case(mpt_ops, created_case, short_uuid):
update_data = {"description": f"e2e update {short_uuid}"}
assert created_case.to_dict().get("awaiting") is False
update_data = {"awaiting": True}

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

assert result.id == created_case.id
assert result.to_dict().get("description") == update_data["description"]
assert result.to_dict().get("awaiting") is True


@pytest.mark.skip(reason="Unskip after MPT-19124 completed")
Expand All @@ -48,15 +48,12 @@ def test_process_case(mpt_ops, created_case):
assert result is not None


@pytest.mark.skip(reason="Unskip after MPT-19124 completed")
def test_query_case(mpt_ops, created_case):
processed_case = mpt_ops.helpdesk.cases.process(created_case.id)

def test_query_case(mpt_ops, created_case, short_uuid):
result = mpt_ops.helpdesk.cases.query(
processed_case.id, {"queryPrompt": "Could you provide more details?"}
created_case.id, {"queryPrompt": f"e2e update {short_uuid}"}
)

assert result is not None
assert result.to_dict().get("queryPrompt") == f"e2e update {short_uuid}"


@pytest.mark.skip(reason="Unskip after MPT-19124 completed")
Expand Down
Loading