# Path: tenable_io/api/models.py
# class Plugin(BaseModel):
# 
#     def __init__(
#             self,
#             id=None,
#             name=None
#     ):
#         self.id = id
#         self.name = name
# 
# class PluginAttribute(BaseModel):
# 
#     def __init__(
#             self,
#             attribute_name=None,
#             attribute_value=None
#     ):
#         self.attribute_name = attribute_name
#         self.attribute_value = attribute_value
# 
# class PluginDetails(BaseModel):
# 
#     def __init__(
#             self,
#             id=None,
#             name=None,
#             family_name=None,
#             attributes=None
#     ):
#         self._attributes = None
#         self.id = id
#         self.name = name
#         self.family_name = family_name
#         self.attributes = attributes
# 
#     @property
#     def attributes(self):
#         return self._attributes
# 
#     @attributes.setter
#     @BaseModel._model_list(PluginAttribute)
#     def attributes(self, attributes):
#         self._attributes = attributes
# 
# class PluginFamily(BaseModel):
# 
#     def __init__(
#             self,
#             id=None,
#             name=None,
#             count=None
#     ):
#         self.id = id
#         self.name = name
#         self.count = count
# 
# class PluginFamilyDetails(BaseModel):
# 
#     def __init__(
#             self,
#             id=None,
#             name=None,
#             plugins=None
#     ):
#         self._plugins = None
#         self.id = id
#         self.name = name
#         self.plugins = plugins
# 
#     @property
#     def plugins(self):
#         return self._plugins
# 
#     @plugins.setter
#     @BaseModel._model_list(Plugin)
#     def plugins(self, plugins):
#         self._plugins = plugins
# 
# class PluginFamilyList(BaseModel):
# 
#     def __init__(
#             self,
#             families=None
#     ):
#         self._families = None
#         self.families = families
# 
#     @property
#     def families(self):
#         return self._families
# 
#     @families.setter
#     @BaseModel._model_list(PluginFamily)
#     def families(self, families):
#         self._families = families


import pytest
from tenable_io.api.models import Plugin, PluginAttribute, PluginDetails, PluginFamily, PluginFamilyDetails, \
    PluginFamilyList



@pytest.mark.vcr()
def test_plugins_families(client):
    family_list = client.plugins_api.families()
    assert isinstance(family_list, PluginFamilyList), u'The `families` method did not return type `PluginFamilyList`.'
    assert len(family_list.families) > 0, u'Service expect return at least 1 plugin family.'
    for f in family_list.families:
        assert isinstance(f, PluginFamily), u'families should have type of `PluginFamily`.'


@pytest.mark.vcr()
def test_plugins_family_details(client):
    family_list = client.plugins_api.families()
    family_details = client.plugins_api.family_details(family_list.families[0].id)
    assert isinstance(family_details, PluginFamilyDetails), \
        u'The `family_details` method did not return type `PluginFamilyDetails`.'
    for p in family_details.plugins:
        isinstance(p, Plugin), u'List has instances of type.'


@pytest.mark.vcr()
def test_plugins_plugin_details(client):
    family_list = client.plugins_api.families()
    family_details = client.plugins_api.family_details(family_list.families[0].id)
    assert len(family_details.plugins) > 0, u'Plugin family should contain plugins.'
    plugin_details = client.plugins_api.plugin_details(family_details.plugins[0].id)
    assert isinstance(plugin_details,

# Path: tenable_io/api/models.py
# class Plugin(BaseModel):
# 
#     def __init__(
#             self,
#             id=None,
#             name=None
#     ):
#         self.id = id
#         self.name = name
# 
# class PluginAttribute(BaseModel):
# 
#     def __init__(
#             self,
#             attribute_name=None,
#             attribute_value=None
#     ):
#         self.attribute_name = attribute_name
#         self.attribute_value = attribute_value
# 
# class PluginDetails(BaseModel):
# 
#     def __init__(
#             self,
#             id=None,
#             name=None,
#             family_name=None,
#             attributes=None
#     ):
#         self._attributes = None
#         self.id = id
#         self.name = name
#         self.family_name = family_name
#         self.attributes = attributes
# 
#     @property
#     def attributes(self):
#         return self._attributes
# 
#     @attributes.setter
#     @BaseModel._model_list(PluginAttribute)
#     def attributes(self, attributes):
#         self._attributes = attributes
# 
# class PluginFamily(BaseModel):
# 
#     def __init__(
#             self,
#             id=None,
#             name=None,
#             count=None
#     ):
#         self.id = id
#         self.name = name
#         self.count = count
# 
# class PluginFamilyDetails(BaseModel):
# 
#     def __init__(
#             self,
#             id=None,
#             name=None,
#             plugins=None
#     ):
#         self._plugins = None
#         self.id = id
#         self.name = name
#         self.plugins = plugins
# 
#     @property
#     def plugins(self):
#         return self._plugins
# 
#     @plugins.setter
#     @BaseModel._model_list(Plugin)
#     def plugins(self, plugins):
#         self._plugins = plugins
# 
# class PluginFamilyList(BaseModel):
# 
#     def __init__(
#             self,
#             families=None
#     ):
#         self._families = None
#         self.families = families
# 
#     @property
#     def families(self):
#         return self._families
# 
#     @families.setter
#     @BaseModel._model_list(PluginFamily)
#     def families(self, families):
#         self._families = families


# Path: tests/integration/api/test_plugins.py
import pytest
from tenable_io.api.models import Plugin, PluginAttribute, PluginDetails, PluginFamily, PluginFamilyDetails, \
    PluginFamilyList




@pytest.mark.vcr()
def test_plugins_families(client):
    family_list = client.plugins_api.families()
    assert isinstance(family_list, PluginFamilyList), u'The `families` method did not return type `PluginFamilyList`.'
    assert len(family_list.families) > 0, u'Service expect return at least 1 plugin family.'
    for f in family_list.families:
        assert isinstance(f, PluginFamily), u'families should have type of `PluginFamily`.'


@pytest.mark.vcr()
def test_plugins_family_details(client):
    family_list = client.plugins_api.families()
    family_details = client.plugins_api.family_details(family_list.families[0].id)
    assert isinstance(family_details, PluginFamilyDetails), \
        u'The `family_details` method did not return type `PluginFamilyDetails`.'
    for p in family_details.plugins:
        isinstance(p, Plugin), u'List has instances of type.'


@pytest.mark.vcr()
def test_plugins_plugin_details(client):
    family_list = client.plugins_api.families()
    family_details = client.plugins_api.family_details(family_list.families[0].id)
    assert len(family_details.plugins) > 0, u'Plugin family should contain plugins.'
    plugin_details = client.plugins_api.plugin_details(family_details.plugins[0].id)
    assert isinstance(plugin_details,

                      PluginDetails), u'The `plugin_details` method did not return type `PluginDetails`.'