# Path: tenable_io/api/models.py
# class Agent(BaseModel):
# 
#     def __init__(
#             self,
#             distro=None,
#             id=None,
#             ip=None,
#             last_scanned=None,
#             name=None,
#             platform=None,
#             uuid=None,
#             linked_on=None,
#             last_connect=None,
#             plugin_feed_id=None,
#             core_build=None,
#             core_version=None,
#             groups=None,
#             status=None
#     ):
#         self.distro = distro
#         self.id = id
#         self.ip = ip
#         self.last_scanned = last_scanned
#         self.name = name
#         self.platform = platform
#         self.uuid = uuid
#         self.linked_on = linked_on
#         self.last_connect = last_connect
#         self.plugin_feed_id = plugin_feed_id
#         self.core_build = core_build
#         self.core_version = core_version
#         self.groups = groups
#         self.status = status
# 
# class AgentList(BaseModel):
# 
#     def __init__(
#             self,
#             agents=None,
#             pagination=None
#     ):
#         self._agents = None
#         self.agents = agents
#         self._pagination = None
#         self.pagination = pagination
# 
#     @property
#     def agents(self):
#         return self._agents
# 
#     @agents.setter
#     @BaseModel._model_list(Agent)
#     def agents(self, agents):
#         self._agents = agents
# 
#     @property
#     def pagination(self):
#         return self._pagination
# 
#     @pagination.setter
#     @BaseModel._model(FilterPagination)
#     def pagination(self, pagination):
#         self._pagination = pagination


import pytest
from tenable_io.api.models import Agent, AgentList



@pytest.mark.vcr()
def test_agents_list(client):
    agent_list = client.agents_api.list(limit=2)
    assert isinstance(agent_list, AgentList), u'The `list` method did not return type `AgentList`.'
    assert len(agent_list.agents) == 2, u'Expected limit to be applied.'
    for a in agent_list.agents:
        assert isinstance(a, Agent), u'Agents property does not represent type.'


@pytest.mark.vcr()
def test_agents_get(client):
    agent_list = client.agents_api.list()
    assert len(agent_list.agents) > 0, u'Expected at least one agent.'
    agent = client.agents_api.get(agent_list.agents[0].id)

# Path: tenable_io/api/models.py
# class Agent(BaseModel):
# 
#     def __init__(
#             self,
#             distro=None,
#             id=None,
#             ip=None,
#             last_scanned=None,
#             name=None,
#             platform=None,
#             uuid=None,
#             linked_on=None,
#             last_connect=None,
#             plugin_feed_id=None,
#             core_build=None,
#             core_version=None,
#             groups=None,
#             status=None
#     ):
#         self.distro = distro
#         self.id = id
#         self.ip = ip
#         self.last_scanned = last_scanned
#         self.name = name
#         self.platform = platform
#         self.uuid = uuid
#         self.linked_on = linked_on
#         self.last_connect = last_connect
#         self.plugin_feed_id = plugin_feed_id
#         self.core_build = core_build
#         self.core_version = core_version
#         self.groups = groups
#         self.status = status
# 
# class AgentList(BaseModel):
# 
#     def __init__(
#             self,
#             agents=None,
#             pagination=None
#     ):
#         self._agents = None
#         self.agents = agents
#         self._pagination = None
#         self.pagination = pagination
# 
#     @property
#     def agents(self):
#         return self._agents
# 
#     @agents.setter
#     @BaseModel._model_list(Agent)
#     def agents(self, agents):
#         self._agents = agents
# 
#     @property
#     def pagination(self):
#         return self._pagination
# 
#     @pagination.setter
#     @BaseModel._model(FilterPagination)
#     def pagination(self, pagination):
#         self._pagination = pagination


# Path: tests/integration/api/test_agents.py
import pytest
from tenable_io.api.models import Agent, AgentList




@pytest.mark.vcr()
def test_agents_list(client):
    agent_list = client.agents_api.list(limit=2)
    assert isinstance(agent_list, AgentList), u'The `list` method did not return type `AgentList`.'
    assert len(agent_list.agents) == 2, u'Expected limit to be applied.'
    for a in agent_list.agents:
        assert isinstance(a, Agent), u'Agents property does not represent type.'


@pytest.mark.vcr()
def test_agents_get(client):
    agent_list = client.agents_api.list()
    assert len(agent_list.agents) > 0, u'Expected at least one agent.'
    agent = client.agents_api.get(agent_list.agents[0].id)

    assert isinstance(agent, Agent), u'The `get` method did not return type `AgentList`.'