Beispiel #1
0
 def test_get_agent(self, fake_client):
     """
     Test the get_agent method
     """
     agents = Agents(fake_client, "base")
     agents.get_agent("org_slug", "agent_id")
     url = "base/organizations/org_slug/agents/agent_id"
     fake_client.get.assert_called_with(url)
Beispiel #2
0
def test_get_agent(fake_client):
    """
    Test the get_agent method
    """
    agents = Agents(fake_client, "base")
    agents.get_agent("org_slug", "agent_id")
    fake_client.get.assert_called_with(
        agents.path.format("org_slug") + "agent_id")
Beispiel #3
0
def test_list_all_agents(fake_client):
    agents = Agents(fake_client, "base")
    agents.list_all("org_slug")
    fake_client.get.assert_called_with(
        agents.path.format("org_slug"),
        {
            "name": None,
            "hostname": None,
            "version": None,
            "page": 0
        },
        with_pagination=False,
    )
Beispiel #4
0
    def agents(self):
        """
        Get Agent operations for the Buildkite API

        :return: Client
        """
        return Agents(self.client, self.base_url)
Beispiel #5
0
def test_stop_agent(fake_client):
    agents = Agents(fake_client, "base")
    agents.stop_agent("org_slug", "agent_id")
    fake_client.put.assert_called_with(agents.path.format("org_slug") +
                                       "agent_id/stop",
                                       body={"force": True})
Beispiel #6
0
 def agents(self):
     return Agents(self.client, self.base_url)