Skip to content

Commit 7684440

Browse files
Lingling PengLingling Peng
authored andcommitted
fix registration time
1 parent 0362994 commit 7684440

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

tests/integration/synapseclient/models/async/test_agent_async.py

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -137,32 +137,34 @@ async def test_prompt(self) -> None:
137137
class TestAgent:
138138
"""Integration tests for the synchronous methods of the Agent class."""
139139

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-
151140
@pytest.fixture(autouse=True, scope="function")
152141
def init(self, syn: Synapse) -> None:
153142
self.syn = syn
143+
154144
if syn.repoEndpoint == "https://repo-dev.dev.sagebase.org/repo/v1":
155145
self.AGENT_REGISTRATION_ID = "7"
146+
registered_on = "2025-08-11T20:39:35.355Z"
156147
else:
157148
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+
)
158160

159161
async def test_register(self) -> None:
160162
# GIVEN an Agent with a valid agent AWS id
161163
agent = Agent(cloud_agent_id=AGENT_AWS_ID)
162164
# WHEN I register the agent
163165
await agent.register_async(synapse_client=self.syn)
164166
# THEN I expect the agent to be registered
165-
expected_agent = self.get_test_agent()
167+
expected_agent = self.agent
166168
assert agent == expected_agent
167169

168170
async def test_get(self) -> None:
@@ -171,7 +173,7 @@ async def test_get(self) -> None:
171173
# WHEN I get the agent
172174
await agent.get_async(synapse_client=self.syn)
173175
# THEN I expect the agent to be returned
174-
expected_agent = self.get_test_agent()
176+
expected_agent = self.agent
175177
assert agent == expected_agent
176178

177179
async def test_get_no_registration_id(self) -> None:

0 commit comments

Comments
 (0)