test: add unit tests and fixtures

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
JesseMarkowitz
2026-02-27 23:13:15 -05:00
parent 389732fd9e
commit 726905cc09
7 changed files with 699 additions and 0 deletions

View File

@@ -0,0 +1,57 @@
{
"id": "chatgpt-conv-001",
"title": "Python Async Tutorial",
"create_time": 1704067200.0,
"update_time": 1704153600.0,
"project_title": "Learning Python",
"mapping": {
"node-root": {
"id": "node-root",
"parent": null,
"children": ["node-1"],
"message": null
},
"node-1": {
"id": "node-1",
"parent": "node-root",
"children": ["node-2"],
"message": {
"id": "node-1",
"author": {"role": "user"},
"create_time": 1704067200.0,
"content": {
"content_type": "text",
"parts": ["How does async/await work in Python?"]
}
}
},
"node-2": {
"id": "node-2",
"parent": "node-1",
"children": ["node-3"],
"message": {
"id": "node-2",
"author": {"role": "assistant"},
"create_time": 1704067210.0,
"content": {
"content_type": "text",
"parts": ["Async/await in Python allows you to write concurrent code using coroutines.\n\n```python\nimport asyncio\n\nasync def main():\n await asyncio.sleep(1)\n print('Done!')\n\nasyncio.run(main())\n```"]
}
}
},
"node-3": {
"id": "node-3",
"parent": "node-2",
"children": [],
"message": {
"id": "node-3",
"author": {"role": "user"},
"create_time": 1704067300.0,
"content": {
"content_type": "image_asset_pointer",
"parts": [{"content_type": "image_asset_pointer", "asset_pointer": "file://some-image"}]
}
}
}
}
}

43
tests/fixtures/chatgpt_no_project.json vendored Normal file
View File

@@ -0,0 +1,43 @@
{
"id": "chatgpt-conv-002",
"title": "Quick Question",
"create_time": 1706745600.0,
"update_time": 1706745900.0,
"project_title": null,
"mapping": {
"node-root": {
"id": "node-root",
"parent": null,
"children": ["msg-1"],
"message": null
},
"msg-1": {
"id": "msg-1",
"parent": "node-root",
"children": ["msg-2"],
"message": {
"id": "msg-1",
"author": {"role": "user"},
"create_time": 1706745600.0,
"content": {
"content_type": "text",
"parts": ["What is the capital of France?"]
}
}
},
"msg-2": {
"id": "msg-2",
"parent": "msg-1",
"children": [],
"message": {
"id": "msg-2",
"author": {"role": "assistant"},
"create_time": 1706745610.0,
"content": {
"content_type": "text",
"parts": ["The capital of France is Paris."]
}
}
}
}
}

35
tests/fixtures/claude_conversation.json vendored Normal file
View File

@@ -0,0 +1,35 @@
{
"uuid": "claude-conv-001",
"name": "StartOS Service Packaging",
"created_at": "2024-06-10T14:32:00.000Z",
"updated_at": "2024-06-10T15:00:00.000Z",
"project": {
"uuid": "proj-001",
"name": "StarTOS Packaging"
},
"chat_messages": [
{
"uuid": "msg-001",
"sender": "human",
"created_at": "2024-06-10T14:32:00.000Z",
"content": [
{"type": "text", "text": "How do I create a manifest.ts for a StartOS service?"}
]
},
{
"uuid": "msg-002",
"sender": "assistant",
"created_at": "2024-06-10T14:32:10.000Z",
"content": [
{"type": "text", "text": "To create a manifest.ts for a StartOS service, you need to define the package metadata:\n\n```typescript\nimport { sdk } from './sdk'\n\nexport const manifest = sdk.Manifest.of({\n id: 'my-service',\n title: 'My Service',\n version: '1.0.0',\n})\n```"},
{"type": "tool_use", "id": "tool-001", "name": "search", "input": {"query": "startOS docs"}}
]
},
{
"uuid": "msg-003",
"sender": "human",
"created_at": "2024-06-10T14:45:00.000Z",
"content": "Thank you, that helped!"
}
]
}

23
tests/fixtures/claude_no_project.json vendored Normal file
View File

@@ -0,0 +1,23 @@
{
"uuid": "claude-conv-002",
"name": "Explain Docker",
"created_at": "2024-08-01T09:00:00.000Z",
"updated_at": "2024-08-01T09:05:00.000Z",
"project": null,
"chat_messages": [
{
"uuid": "msg-004",
"sender": "human",
"created_at": "2024-08-01T09:00:00.000Z",
"content": "Can you explain Docker containers briefly?"
},
{
"uuid": "msg-005",
"sender": "assistant",
"created_at": "2024-08-01T09:00:10.000Z",
"content": [
{"type": "text", "text": "Docker containers are lightweight, isolated environments that package an application and its dependencies together, ensuring consistent behaviour across different systems."}
]
}
]
}