@@ -137,32 +137,34 @@ async def test_prompt(self) -> None:
137
137
class TestAgent :
138
138
"""Integration tests for the synchronous methods of the Agent class."""
139
139
140
- def get_test_agent (self ) -> Agent :
141
- return Agent (
142
- cloud_agent_id = AGENT_AWS_ID ,
143
- cloud_alias_id = "TSTALIASID" ,
144
- registration_id = self .AGENT_REGISTRATION_ID ,
145
- registered_on = "2025-01-16T18:57:35.680Z" ,
146
- type = "CUSTOM" ,
147
- sessions = {},
148
- current_session = None ,
149
- )
150
-
151
140
@pytest .fixture (autouse = True , scope = "function" )
152
141
def init (self , syn : Synapse ) -> None :
153
142
self .syn = syn
143
+
154
144
if syn .repoEndpoint == "https://repo-dev.dev.sagebase.org/repo/v1" :
155
145
self .AGENT_REGISTRATION_ID = "7"
146
+ registered_on = "2025-08-11T20:39:35.355Z"
156
147
else :
157
148
self .AGENT_REGISTRATION_ID = "29"
149
+ registered_on = "2025-01-16T18:57:35.680Z"
150
+
151
+ self .agent = Agent (
152
+ cloud_agent_id = AGENT_AWS_ID ,
153
+ cloud_alias_id = "TSTALIASID" ,
154
+ registration_id = self .AGENT_REGISTRATION_ID ,
155
+ registered_on = registered_on ,
156
+ type = "CUSTOM" ,
157
+ sessions = {},
158
+ current_session = None ,
159
+ )
158
160
159
161
async def test_register (self ) -> None :
160
162
# GIVEN an Agent with a valid agent AWS id
161
163
agent = Agent (cloud_agent_id = AGENT_AWS_ID )
162
164
# WHEN I register the agent
163
165
await agent .register_async (synapse_client = self .syn )
164
166
# THEN I expect the agent to be registered
165
- expected_agent = self .get_test_agent ()
167
+ expected_agent = self .agent
166
168
assert agent == expected_agent
167
169
168
170
async def test_get (self ) -> None :
@@ -171,7 +173,7 @@ async def test_get(self) -> None:
171
173
# WHEN I get the agent
172
174
await agent .get_async (synapse_client = self .syn )
173
175
# THEN I expect the agent to be returned
174
- expected_agent = self .get_test_agent ()
176
+ expected_agent = self .agent
175
177
assert agent == expected_agent
176
178
177
179
async def test_get_no_registration_id (self ) -> None :
0 commit comments