def METHOD_NAME(self, session, proto, workspace, test_client):
    token = self._join_agent(test_client, session)
    agent = Agent.query.one()
    assert not agent.is_online
    message = f'{{"action": "JOIN_AGENT", "workspace": "{workspace.name}", "token": "{token}", "executors": [] }}'
    assert proto.onMessage(message, False)
    assert agent.is_online
    message = '{"action": "LEAVE_AGENT"}'
    assert proto.onMessage(message, False)
    assert not agent.is_online