Skip to content

Commit be76fe1

Browse files
committed
test: remove CLI-dependent tests
1 parent 99d6059 commit be76fe1

2 files changed

Lines changed: 4 additions & 113 deletions

File tree

tests/test_client.py

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -55,47 +55,3 @@ async def gen():
5555
transport = MockTransport()
5656
client = RipperdocSDKClient(transport=transport)
5757
assert client._custom_transport == transport
58-
59-
@pytest.mark.asyncio
60-
async def test_connect_without_prompt(self):
61-
"""Test connecting without an initial prompt."""
62-
client = RipperdocSDKClient()
63-
try:
64-
await client.connect()
65-
# Should succeed and be connected
66-
# In a real test, we'd verify connection state
67-
await client.disconnect()
68-
except Exception as e:
69-
pytest.skip(f"Ripperdoc CLI not available: {e}")
70-
71-
@pytest.mark.asyncio
72-
async def test_connect_with_string_prompt(self):
73-
"""Test connecting with a string prompt."""
74-
client = RipperdocSDKClient()
75-
try:
76-
await client.connect(prompt="Hello, Ripperdoc!")
77-
await client.disconnect()
78-
except Exception as e:
79-
pytest.skip(f"Ripperdoc CLI not available: {e}")
80-
81-
@pytest.mark.asyncio
82-
async def test_send_message(self):
83-
"""Test sending a message after connection."""
84-
client = RipperdocSDKClient()
85-
try:
86-
await client.connect()
87-
# In a full test, we'd send and verify response
88-
await client.disconnect()
89-
except Exception as e:
90-
pytest.skip(f"Ripperdoc CLI not available: {e}")
91-
92-
@pytest.mark.asyncio
93-
async def test_disconnect(self):
94-
"""Test disconnecting from Ripperdoc."""
95-
client = RipperdocSDKClient()
96-
try:
97-
await client.connect()
98-
await client.disconnect()
99-
# Should successfully disconnect
100-
except Exception as e:
101-
pytest.skip(f"Ripperdoc CLI not available: {e}")

tests/test_query.py

Lines changed: 4 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
"""Tests for query function."""
22

3-
import json
43
from collections.abc import AsyncIterator
54

65
import pytest
@@ -13,72 +12,8 @@ class TestQuery:
1312
"""Tests for query function."""
1413

1514
@pytest.mark.asyncio
16-
async def test_query_with_string_prompt(self, default_options, test_prompt):
17-
"""Test query with a string prompt."""
18-
# Note: This test requires ripperdoc CLI to be installed
19-
# In CI/CD, this should be mocked or skipped if CLI not available
20-
messages: list[Message] = []
21-
try:
22-
async for msg in query(prompt=test_prompt, options=default_options):
23-
messages.append(msg)
24-
# Break after first message for testing
25-
if isinstance(msg, AssistantMessage):
26-
break
27-
except Exception as e:
28-
pytest.skip(f"Ripperdoc CLI not available: {e}")
29-
30-
@pytest.mark.asyncio
31-
async def test_query_with_default_options(self, test_prompt):
32-
"""Test query with default options (None)."""
33-
messages: list[Message] = []
34-
try:
35-
async for msg in query(prompt=test_prompt):
36-
messages.append(msg)
37-
if isinstance(msg, AssistantMessage):
38-
break
39-
except Exception as e:
40-
pytest.skip(f"Ripperdoc CLI not available: {e}")
41-
42-
@pytest.mark.asyncio
43-
async def test_query_with_custom_options(self, test_prompt):
44-
"""Test query with custom options."""
45-
options = RipperdocAgentOptions(
46-
permission_mode="acceptEdits",
47-
)
48-
messages: list[Message] = []
49-
try:
50-
async for msg in query(prompt=test_prompt, options=options):
51-
messages.append(msg)
52-
if isinstance(msg, AssistantMessage):
53-
break
54-
except Exception as e:
55-
pytest.skip(f"Ripperdoc CLI not available: {e}")
56-
57-
@pytest.mark.asyncio
58-
async def test_query_with_streaming_prompt(self):
59-
"""Test query with streaming prompt (AsyncIterable)."""
60-
61-
async def stream_prompt() -> AsyncIterator[dict]:
62-
"""Stream prompt as a series of messages."""
63-
yield {"type": "user", "content": [{"type": "text", "text": "Hello"}]}
64-
65-
messages: list[Message] = []
66-
try:
67-
async for msg in query(prompt=stream_prompt()):
68-
messages.append(msg)
69-
if isinstance(msg, AssistantMessage):
70-
break
71-
except Exception as e:
72-
pytest.skip(f"Ripperdoc CLI not available: {e}")
73-
74-
@pytest.mark.asyncio
75-
async def test_query_returns_iterator(self, test_prompt):
15+
async def test_query_returns_iterator(self):
7616
"""Test that query returns an async iterator."""
77-
try:
78-
result = query(prompt=test_prompt)
79-
assert hasattr(result, "__aiter__")
80-
# Consume the iterator
81-
async for _ in result:
82-
break
83-
except Exception as e:
84-
pytest.skip(f"Ripperdoc CLI not available: {e}")
17+
# Just verify the interface, don't actually connect
18+
result = query(prompt="test")
19+
assert hasattr(result, "__aiter__")

0 commit comments

Comments
 (0)