@@ -19,8 +19,7 @@ def test_agent_creation_response_creation(self):
19
19
"""Test creating an AgentCreationResponse instance."""
20
20
response_data = {
21
21
"id" : "test-agent-123" ,
22
- "name" : "Test Agent" ,
23
- "version" : "1.0.0" ,
22
+ "name" : "test-agent:1.0.0" ,
24
23
"created_at" : datetime .now (),
25
24
"updated_at" : datetime .now (),
26
25
"status" : "completed" ,
@@ -29,8 +28,7 @@ def test_agent_creation_response_creation(self):
29
28
response = AgentCreationResponse (** response_data )
30
29
31
30
assert response .id == "test-agent-123"
32
- assert response .name == "Test Agent"
33
- assert response .version == "1.0.0"
31
+ assert response .name == "test-agent:1.0.0"
34
32
assert response .status == "completed"
35
33
36
34
@@ -40,11 +38,10 @@ class TestAgentMethods:
40
38
def test_agent_get_by_name_and_version (self , mock_client ):
41
39
"""Test getting an agent by name and version."""
42
40
client = mock_client
43
- response = client .agent .get (name = "test-agent" , version = " 1.0.0" )
41
+ response = client .agent .get (name = "test-agent: 1.0.0" )
44
42
45
43
assert isinstance (response , AgentInfo )
46
- assert response .name == "test-agent"
47
- assert response .version == "1.0.0"
44
+ assert response .name == "test-agent:1.0.0"
48
45
assert response .description == "Test agent description"
49
46
assert response .prompt == "Test agent prompt"
50
47
assert response .status == "completed"
@@ -57,18 +54,19 @@ def test_agent_get_by_id(self, mock_client):
57
54
assert isinstance (response , AgentInfo )
58
55
assert response .id == "agent-123"
59
56
assert response .name == "agent-agent-123"
60
- assert response .version == "latest"
61
57
62
58
def test_agent_get_validation_error (self , mock_client ):
63
59
"""Test that get method validates input parameters."""
64
60
client = mock_client
65
61
66
62
with pytest .raises (
67
- ValueError , match = "Only one of `id` or `name` can be provided."
63
+ ValueError , match = "Only one of `id` or `name` or `prompt` can be provided."
68
64
):
69
65
client .agent .get (id = "agent-123" , name = "test-agent" )
70
66
71
- with pytest .raises (ValueError , match = "Either `id` or `name` must be provided." ):
67
+ with pytest .raises (
68
+ ValueError , match = "Either `id` or `name` or `prompt` must be provided."
69
+ ):
72
70
client .agent .get ()
73
71
74
72
def test_agent_list (self , mock_client ):
@@ -79,8 +77,8 @@ def test_agent_list(self, mock_client):
79
77
assert isinstance (response , list )
80
78
assert len (response ) == 2
81
79
assert all (isinstance (agent , AgentInfo ) for agent in response )
82
- assert response [0 ].name == "test-agent-1"
83
- assert response [1 ].name == "test-agent-2"
80
+ assert response [0 ].name . startswith ( "test-agent-1" )
81
+ assert response [1 ].name . startswith ( "test-agent-2" )
84
82
85
83
def test_agent_create (self , mock_client ):
86
84
"""Test creating an agent."""
@@ -99,7 +97,6 @@ def test_agent_create(self, mock_client):
99
97
100
98
assert isinstance (response , AgentCreationResponse )
101
99
assert response .name == "new-agent"
102
- assert response .version == "1.0.0"
103
100
assert response .status == "pending"
104
101
105
102
def test_agent_create_validation_error (self , mock_client ):
@@ -125,15 +122,13 @@ def test_agent_execute(self, mock_client):
125
122
)
126
123
127
124
response = client .agent .execute (
128
- name = "test-agent" ,
129
- version = "1.0.0" ,
125
+ name = "test-agent:1.0.0" ,
130
126
inputs = {"input" : "test data" },
131
127
config = config ,
132
128
)
133
129
134
130
assert isinstance (response , AgentExecutionResponse )
135
- assert response .name == "test-agent"
136
- assert response .version == "1.0.0"
131
+ assert response .name == "test-agent:1.0.0"
137
132
assert response .status == "completed"
138
133
assert response .response == {"result" : "execution result" }
139
134
assert isinstance (response .usage , CreditUsage )
@@ -147,7 +142,6 @@ def test_agent_execute_without_version(self, mock_client):
147
142
148
143
assert isinstance (response , AgentExecutionResponse )
149
144
assert response .name == "test-agent"
150
- assert response .version == "latest"
151
145
152
146
def test_agent_execute_batch_mode_required (self , mock_client ):
153
147
"""Test that execute method requires batch mode."""
0 commit comments