Exemple #1
0
 def setUp(self):
     _mock_auth(200)
     self.conn = Connection('1', 'dfw', password='******')
     self.client = Client(self.conn)
     self.agent = agent.from_dict(agent_mock.agent(), self.conn)
 def setUp(self):
     _mock_auth(200)
     self.conn = Connection('1', 'dfw', password='******')
     self.client = Client(self.conn)
     self.agent = agent.from_dict(agent_mock.agent(), self.conn)
 def get_agent(self, agent_id):
     url = '{0}/{1}/{2}'.format(self._connection.host, 'agent',
                                agent_id)
     resp = self._connection.request(Http.get, url)
     return agent.from_dict(resp.json(), connection=self._connection)
 def agents(self):
     url = self._connection.host + '/user/agents'
     resp = self._connection.request(Http.get, url)
     return (agent.from_dict(a, connection=self._connection)
             for a in resp.json())
 def get_agent(self, agent_id):
     url = '{0}/{1}/{2}'.format(self._connection.host, 'agent', agent_id)
     resp = self._connection.request(Http.get, url)
     return agent.from_dict(resp.json(), connection=self._connection)
 def agents(self):
     url = self._connection.host + '/user/agents'
     resp = self._connection.request(Http.get, url)
     return (agent.from_dict(a, connection=self._connection)
             for a in resp.json())