Repository: incubator-ariatosca Updated Branches: refs/heads/ARIA-39-Genericize-storage-models ee4209616 -> 3cca6f5ed
lynting and reordering Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/3cca6f5e Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/3cca6f5e Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/3cca6f5e Branch: refs/heads/ARIA-39-Genericize-storage-models Commit: 3cca6f5ed22da936676a467e06b16c1f1c8a1ac2 Parents: ee42096 Author: mxmrlv <mxm...@gmail.com> Authored: Tue Dec 20 16:28:24 2016 +0200 Committer: mxmrlv <mxm...@gmail.com> Committed: Tue Dec 20 16:28:24 2016 +0200 ---------------------------------------------------------------------- aria/orchestrator/context/workflow.py | 8 +-- aria/storage/base_model.py | 89 ++++++++++++------------- aria/storage/model.py | 10 +-- aria/storage/structure.py | 41 ++++-------- tests/storage/test_model_storage.py | 4 +- tests/storage/test_models.py | 100 +++++++++++++++-------------- 6 files changed, 119 insertions(+), 133 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/3cca6f5e/aria/orchestrator/context/workflow.py ---------------------------------------------------------------------- diff --git a/aria/orchestrator/context/workflow.py b/aria/orchestrator/context/workflow.py index feca33a..7f53a9c 100644 --- a/aria/orchestrator/context/workflow.py +++ b/aria/orchestrator/context/workflow.py @@ -74,11 +74,11 @@ class WorkflowContext(BaseContext): """ Iterator over nodes """ - key = 'deployment_{0}'.format(self.model.node_instance.model_cls.user_id_column()) + key = 'deployment_{0}'.format(self.model.node_instance.model_cls.name_column_name()) return self.model.node.iter( filters={ - key: getattr(self.deployment, self.deployment.user_id_column()) + key: getattr(self.deployment, self.deployment.name_column_name()) } ) @@ -87,10 +87,10 @@ class WorkflowContext(BaseContext): """ Iterator over node instances """ - key = 'deployment_{0}'.format(self.model.node_instance.model_cls.user_id_column()) + key = 'deployment_{0}'.format(self.model.node_instance.model_cls.name_column_name()) return self.model.node_instance.iter( filters={ - key: getattr(self.deployment, self.deployment.user_id_column()) + key: getattr(self.deployment, self.deployment.name_column_name()) } ) http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/3cca6f5e/aria/storage/base_model.py ---------------------------------------------------------------------- diff --git a/aria/storage/base_model.py b/aria/storage/base_model.py index 352f121..92a1656 100644 --- a/aria/storage/base_model.py +++ b/aria/storage/base_model.py @@ -52,7 +52,7 @@ from sqlalchemy import ( orm, ) -from .structure import ModelBase +from .structure import ModelMixin from .type import ( List, @@ -74,10 +74,10 @@ __all__ = ( 'TaskBase' ) -#pylint: disable=no-self-argument +#pylint: disable=no-self-argument, abstract-method -class BlueprintBase(ModelBase): +class BlueprintBase(ModelMixin): """ Blueprint model representation. """ @@ -90,7 +90,7 @@ class BlueprintBase(ModelBase): description = Column(Text) -class DeploymentBase(ModelBase): +class DeploymentBase(ModelMixin): """ Deployment model representation. """ @@ -120,15 +120,14 @@ class DeploymentBase(ModelBase): @declared_attr def blueprint_name(cls): - return association_proxy('blueprint', cls.user_id_column()) + return association_proxy('blueprint', cls.name_column_name()) -class ExecutionBase(ModelBase): +class ExecutionBase(ModelMixin): """ Execution model representation. """ # Needed only for pylint. the id will be populated by sqlalcehmy and the proper column. - id = None __tablename__ = 'executions' _private_fields = ['deployment_fk'] @@ -189,7 +188,7 @@ class ExecutionBase(ModelBase): @declared_attr def deployment_name(cls): - return association_proxy('deployment', cls.user_id_column()) + return association_proxy('deployment', cls.name_column_name()) @declared_attr def blueprint_name(cls): @@ -198,12 +197,12 @@ class ExecutionBase(ModelBase): def __str__(self): return '<{0} id=`{1}` (status={2})>'.format( self.__class__.__name__, - self.id, + getattr(self, self.name_column_name()), self.status ) -class DeploymentUpdateBase(ModelBase): +class DeploymentUpdateBase(ModelMixin): """ Deployment update model representation. """ @@ -232,7 +231,7 @@ class DeploymentUpdateBase(ModelBase): @declared_attr def execution_name(cls): - return association_proxy('execution', cls.user_id_column()) + return association_proxy('execution', cls.name_column_name()) @declared_attr def deployment_fk(cls): @@ -244,7 +243,7 @@ class DeploymentUpdateBase(ModelBase): @declared_attr def deployment_name(cls): - return association_proxy('deployment', cls.user_id_column()) + return association_proxy('deployment', cls.name_column_name()) def to_dict(self, suppress_error=False, **kwargs): dep_update_dict = super(DeploymentUpdateBase, self).to_dict(suppress_error) #pylint: disable=no-member @@ -253,12 +252,11 @@ class DeploymentUpdateBase(ModelBase): return dep_update_dict -class DeploymentUpdateStepBase(ModelBase): +class DeploymentUpdateStepBase(ModelMixin): """ Deployment update step model representation. """ # Needed only for pylint. the id will be populated by sqlalcehmy and the proper column. - id = None __tablename__ = 'deployment_update_steps' _private_fields = ['deployment_update_fk'] @@ -292,15 +290,14 @@ class DeploymentUpdateStepBase(ModelBase): @declared_attr def deployment_update(cls): - return cls.one_to_many_relationship('deployment_update_fk', - backreference='steps') + return cls.one_to_many_relationship('deployment_update_fk', backreference='steps') @declared_attr def deployment_update_name(cls): - return association_proxy('deployment_update', cls.user_id_column()) + return association_proxy('deployment_update', cls.name_column_name()) def __hash__(self): - return hash((self.id, self.entity_id)) + return hash((getattr(self, self.id_column_name()), self.entity_id)) def __lt__(self, other): """ @@ -327,7 +324,7 @@ class DeploymentUpdateStepBase(ModelBase): return False -class DeploymentModificationBase(ModelBase): +class DeploymentModificationBase(ModelMixin): """ Deployment modification model representation. """ @@ -354,15 +351,14 @@ class DeploymentModificationBase(ModelBase): @declared_attr def deployment(cls): - return cls.one_to_many_relationship('deployment_fk', - backreference='modifications') + return cls.one_to_many_relationship('deployment_fk', backreference='modifications') @declared_attr def deployment_name(cls): - return association_proxy('deployment', cls.user_id_column()) + return association_proxy('deployment', cls.name_column_name()) -class NodeBase(ModelBase): +class NodeBase(ModelMixin): """ Node model representation. """ @@ -383,7 +379,7 @@ class NodeBase(ModelBase): @declared_attr def host_name(cls): - return association_proxy('host', cls.user_id_column()) + return association_proxy('host', cls.name_column_name()) @declared_attr def deployment_fk(cls): @@ -395,11 +391,11 @@ class NodeBase(ModelBase): @declared_attr def deployment_name(cls): - return association_proxy('deployment', cls.user_id_column()) + return association_proxy('deployment', cls.name_column_name()) @declared_attr def blueprint_name(cls): - return association_proxy('deployment', 'blueprint_{0}'.format(cls.user_id_column())) + return association_proxy('deployment', 'blueprint_{0}'.format(cls.name_column_name())) deploy_number_of_instances = Column(Integer, nullable=False) max_number_of_instances = Column(Integer, nullable=False) @@ -414,7 +410,7 @@ class NodeBase(ModelBase): type_hierarchy = Column(List) -class RelationshipBase(ModelBase): +class RelationshipBase(ModelMixin): """ Relationship model representation. """ @@ -433,7 +429,7 @@ class RelationshipBase(ModelBase): @declared_attr def source_name(cls): - return association_proxy('source_node', cls.user_id_column()) + return association_proxy('source_node', cls.name_column_name()) @declared_attr def target_node_fk(cls): @@ -441,12 +437,11 @@ class RelationshipBase(ModelBase): @declared_attr def target_node(cls): - return cls.one_to_many_relationship('target_node_fk', - backreference='inbound_relationships') + return cls.one_to_many_relationship('target_node_fk', backreference='inbound_relationships') @declared_attr def target_name(cls): - return association_proxy('target_node', cls.user_id_column()) + return association_proxy('target_node', cls.name_column_name()) source_interfaces = Column(Dict) source_operations = Column(Dict, nullable=False) @@ -457,7 +452,7 @@ class RelationshipBase(ModelBase): properties = Column(Dict) -class NodeInstanceBase(ModelBase): +class NodeInstanceBase(ModelMixin): """ Node instance model representation. """ @@ -479,7 +474,7 @@ class NodeInstanceBase(ModelBase): @declared_attr def host_name(cls): - return association_proxy('host', cls.user_id_column()) + return association_proxy('host', cls.name_column_name()) @declared_attr def deployment(cls): @@ -499,10 +494,10 @@ class NodeInstanceBase(ModelBase): @declared_attr def node_name(cls): - return association_proxy('node', cls.user_id_column()) + return association_proxy('node', cls.name_column_name()) -class RelationshipInstanceBase(ModelBase): +class RelationshipInstanceBase(ModelMixin): """ Relationship instance model representation. """ @@ -522,7 +517,7 @@ class RelationshipInstanceBase(ModelBase): @declared_attr def source_node_instance_name(cls): - return association_proxy('source_node_instance', cls.user_id_column()) + return association_proxy('source_node_instance', cls.name_column_name()) @declared_attr def target_node_instance_fk(cls): @@ -535,7 +530,7 @@ class RelationshipInstanceBase(ModelBase): @declared_attr def target_node_instance_name(cls): - return association_proxy('target_node_instance', cls.user_id_column()) + return association_proxy('target_node_instance', cls.name_column_name()) @declared_attr def relationship_fk(cls): @@ -547,10 +542,10 @@ class RelationshipInstanceBase(ModelBase): @declared_attr def relationship_name(cls): - return association_proxy('relationship', cls.user_id_column()) + return association_proxy('relationship', cls.name_column_name()) -class PluginBase(ModelBase): +class PluginBase(ModelMixin): """ Plugin model representation. """ @@ -560,17 +555,17 @@ class PluginBase(ModelBase): distribution = Column(Text) distribution_release = Column(Text) distribution_version = Column(Text) - excluded_wheels = Column(Dict) + excluded_wheels = Column(List) package_name = Column(Text, nullable=False, index=True) package_source = Column(Text) package_version = Column(Text) - supported_platform = Column(Dict) - supported_py_versions = Column(Dict) + supported_platform = Column(Text) + supported_py_versions = Column(List) uploaded_at = Column(DateTime, nullable=False, index=True) - wheels = Column(Dict, nullable=False) + wheels = Column(List, nullable=False) -class TaskBase(ModelBase): +class TaskBase(ModelMixin): """ A Model which represents an task """ @@ -583,7 +578,7 @@ class TaskBase(ModelBase): @declared_attr def node_instance_name(cls): - return association_proxy('node_instance', cls.user_id_column()) + return association_proxy('node_instance', cls.name_column_name()) @declared_attr def node_instance(cls): @@ -595,7 +590,7 @@ class TaskBase(ModelBase): @declared_attr def relationship_instance_name(cls): - return association_proxy('relationship_instance', cls.user_id_column()) + return association_proxy('relationship_instance', cls.name_column_name()) @declared_attr def relationship_instance(cls): @@ -653,7 +648,7 @@ class TaskBase(ModelBase): @declared_attr def execution_name(cls): - return association_proxy('execution', cls.user_id_column()) + return association_proxy('execution', cls.name_column_name()) @property def actor(self): http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/3cca6f5e/aria/storage/model.py ---------------------------------------------------------------------- diff --git a/aria/storage/model.py b/aria/storage/model.py index 61795aa..afca3e4 100644 --- a/aria/storage/model.py +++ b/aria/storage/model.py @@ -36,9 +36,7 @@ classes: * ProviderContext - provider context implementation model. * Plugin - plugin implementation model. """ -from sqlalchemy.ext.associationproxy import association_proxy from sqlalchemy.ext.declarative import declarative_base -from sqlalchemy.ext.declarative import declared_attr from . import structure from . import base_model as base @@ -58,7 +56,10 @@ __all__ = ( ) -DeclarativeBase = declarative_base(cls=(structure.ARIADeclarativeBase, structure.ModelIdMixin)) +#pylint: disable=abstract-method +# The required abstract method implementation are implemented in the ModelIDMixin, which is used as +# a base to the DeclerativeBase. +DeclarativeBase = declarative_base(cls=structure.ModelIDMixin) class Blueprint(DeclarativeBase, base.BlueprintBase): @@ -68,6 +69,7 @@ class Blueprint(DeclarativeBase, base.BlueprintBase): class Deployment(DeclarativeBase, base.DeploymentBase): pass + class Execution(DeclarativeBase, base.ExecutionBase): pass @@ -105,4 +107,4 @@ class Plugin(DeclarativeBase, base.PluginBase): class Task(DeclarativeBase, base.TaskBase): - pass \ No newline at end of file + pass http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/3cca6f5e/aria/storage/structure.py ---------------------------------------------------------------------- diff --git a/aria/storage/structure.py b/aria/storage/structure.py index 0e99e2b..fe6a144 100644 --- a/aria/storage/structure.py +++ b/aria/storage/structure.py @@ -37,17 +37,14 @@ from sqlalchemy import ( ) -class ModelBase(object): - - # overriding pylint stuff - __tablename__ = None +class ModelMixin(object): @classmethod - def storage_id_column(cls): + def id_column_name(cls): raise NotImplementedError @classmethod - def user_id_column(cls): + def name_column_name(cls): raise NotImplementedError @classmethod @@ -74,7 +71,7 @@ class ModelBase(object): """ table = cls._get_cls_by_tablename(table.__tablename__) foreign_key_str = '{tablename}.{unique_id}'.format(tablename=table.__tablename__, - unique_id=table.storage_id_column()) + unique_id=table.id_column_name()) column = Column(ForeignKey(foreign_key_str, ondelete='CASCADE'), nullable=nullable) column.__remote_table_name = table.__name__ @@ -98,7 +95,7 @@ class ModelBase(object): '{child_class.__name__}.{foreign_key_column}'\ .format( parent_class_name=parent_table.__name__, - parent_unique_id=parent_table.storage_id_column(), + parent_unique_id=parent_table.id_column_name(), child_class=cls, foreign_key_column=foreign_key_column ) @@ -116,7 +113,7 @@ class ModelBase(object): remote_side_str = '{cls.__name__}.{remote_column}'.format( cls=cls, - remote_column=cls.storage_id_column() + remote_column=cls.id_column_name() ) primaryjoin_str = '{remote_side_str} == {cls.__name__}.{local_column}'.format( remote_side_str=remote_side_str, @@ -164,30 +161,20 @@ class ModelBase(object): fields.update(cls.__table__.columns.keys()) return fields - set(cls._private_fields) + def __repr__(self): + return '<{__class__.__name__} id=`{id}`>'.format( + __class__=self.__class__, + id=getattr(self, self.name_column_name())) + -class ModelIdMixin(object): +class ModelIDMixin(object): id = Column(Integer, primary_key=True, autoincrement=True) name = Column(Text, nullable=True, index=True) @classmethod - def storage_id_column(cls): + def id_column_name(cls): return 'id' @classmethod - def user_id_column(cls): + def name_column_name(cls): return 'name' - - -class ARIADeclarativeBase(object): - """ - Abstract base class for all SQL models that allows [de]serialization - """ - # This would be overridden once the models are created. Created for pylint. - __table__ = None - - _private_fields = [] - - def __repr__(self): - return '<{__class__.__name__} id=`{id}`>'.format( - __class__=self.__class__, - id=getattr(self, self.user_id_column())) http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/3cca6f5e/tests/storage/test_model_storage.py ---------------------------------------------------------------------- diff --git a/tests/storage/test_model_storage.py b/tests/storage/test_model_storage.py index 7441099..43dfa1b 100644 --- a/tests/storage/test_model_storage.py +++ b/tests/storage/test_model_storage.py @@ -29,7 +29,7 @@ from aria import application_model_storage from tests.storage import get_sqlite_api_kwargs, release_sqlite_storage -class MockModel(model.DeclarativeBase, structure.ModelBase): +class MockModel(model.DeclarativeBase, structure.ModelMixin): #pylint: disable=abstract-method __tablename__ = 'mock_models' some_dict = Column(aria_type.Dict) value = Column(Integer) @@ -46,7 +46,7 @@ def storage(): @pytest.fixture(scope='module', autouse=True) def module_cleanup(): - model.DeclarativeBase.metadata.remove(MockModel.__table__) + model.DeclarativeBase.metadata.remove(MockModel.__table__) #pylint: disable=no-member def test_storage_base(storage): http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/3cca6f5e/tests/storage/test_models.py ---------------------------------------------------------------------- diff --git a/tests/storage/test_models.py b/tests/storage/test_models.py index fcf2c2d..0a4b8d9 100644 --- a/tests/storage/test_models.py +++ b/tests/storage/test_models.py @@ -194,12 +194,15 @@ class TestBlueprint(object): ) def test_blueprint_model_creation(self, empty_storage, is_valid, plan, description, created_at, updated_at, main_file_name): - _test_model(is_valid=is_valid, storage=empty_storage, model_name='blueprint', - model_cls=Blueprint, model_kwargs=dict(plan=plan, - description=description, - created_at=created_at, - updated_at=updated_at, - main_file_name=main_file_name)) + _test_model(is_valid=is_valid, + storage=empty_storage, + model_name='blueprint', + model_cls=Blueprint, + model_kwargs=dict(plan=plan, + description=description, + created_at=created_at, + updated_at=updated_at, + main_file_name=main_file_name)) class TestDeployment(object): @@ -695,51 +698,50 @@ class TestPlugin(object): 'distribution_version, excluded_wheels, package_name, package_source, ' 'package_version, supported_platform, supported_py_versions, uploaded_at, wheels', [ - (False, m_cls, 'dis_name', 'dis_rel', 'dis_ver', {}, 'pak_name', 'pak_src', 'pak_ver', - {}, {}, now, {}), - (False, 'arc_name', m_cls, 'dis_rel', 'dis_ver', {}, 'pak_name', 'pak_src', 'pak_ver', - {}, {}, now, {}), - (False, 'arc_name', 'dis_name', m_cls, 'dis_ver', {}, 'pak_name', 'pak_src', 'pak_ver', - {}, {}, now, {}), - (False, 'arc_name', 'dis_name', 'dis_rel', m_cls, {}, 'pak_name', 'pak_src', 'pak_ver', - {}, {}, now, {}), + (False, m_cls, 'dis_name', 'dis_rel', 'dis_ver', [], 'pak_name', 'pak_src', 'pak_ver', + 'sup_plat', [], now, []), + (False, 'arc_name', m_cls, 'dis_rel', 'dis_ver', [], 'pak_name', 'pak_src', 'pak_ver', + 'sup_plat', [], now, []), + (False, 'arc_name', 'dis_name', m_cls, 'dis_ver', [], 'pak_name', 'pak_src', 'pak_ver', + 'sup_plat', [], now, []), + (False, 'arc_name', 'dis_name', 'dis_rel', m_cls, [], 'pak_name', 'pak_src', 'pak_ver', + 'sup_plat', [], now, []), (False, 'arc_name', 'dis_name', 'dis_rel', 'dis_ver', m_cls, 'pak_name', 'pak_src', - 'pak_ver', {}, {}, now, {}), - (False, 'arc_name', 'dis_name', 'dis_rel', 'dis_ver', {}, m_cls, 'pak_src', 'pak_ver', - {}, {}, now, {}), - (False, 'arc_name', 'dis_name', 'dis_rel', 'dis_ver', {}, 'pak_name', m_cls, 'pak_ver', - {}, {}, now, {}), - (False, 'arc_name', 'dis_name', 'dis_rel', 'dis_ver', {}, 'pak_name', 'pak_src', m_cls, - {}, {}, now, {}), - (False, 'arc_name', 'dis_name', 'dis_rel', 'dis_ver', {}, 'pak_name', 'pak_src', - 'pak_ver', m_cls, {}, now, {}), - (False, 'arc_name', 'dis_name', 'dis_rel', 'dis_ver', {}, 'pak_name', 'pak_src', - 'pak_ver', {}, m_cls, now, {}), - (False, 'arc_name', 'dis_name', 'dis_rel', 'dis_ver', {}, 'pak_name', 'pak_src', - 'pak_ver', {}, {}, m_cls, {}), - (False, 'arc_name', 'dis_name', 'dis_rel', 'dis_ver', {}, 'pak_name', 'pak_src', - 'pak_ver', {}, {}, now, m_cls), - - (True, 'arc_name', 'dis_name', 'dis_rel', 'dis_ver', {}, 'pak_name', 'pak_src', - 'pak_ver', {}, {}, now, {}), - (True, 'arc_name', None, 'dis_rel', 'dis_ver', {}, 'pak_name', 'pak_src', 'pak_ver', - {}, {}, now, {}), - (True, 'arc_name', 'dis_name', None, 'dis_ver', {}, 'pak_name', 'pak_src', 'pak_ver', - {}, {}, now, {}), - (True, 'arc_name', 'dis_name', 'dis_rel', None, {}, 'pak_name', 'pak_src', 'pak_ver', - {}, {}, now, {}), + 'pak_ver', 'sup_plat', [], now, []), + (False, 'arc_name', 'dis_name', 'dis_rel', 'dis_ver', [], m_cls, 'pak_src', 'pak_ver', + 'sup_plat', [], now, []), + (False, 'arc_name', 'dis_name', 'dis_rel', 'dis_ver', [], 'pak_name', m_cls, 'pak_ver', + 'sup_plat', [], now, []), + (False, 'arc_name', 'dis_name', 'dis_rel', 'dis_ver', [], 'pak_name', 'pak_src', m_cls, + 'sup_plat', [], now, []), + (False, 'arc_name', 'dis_name', 'dis_rel', 'dis_ver', [], 'pak_name', 'pak_src', + 'pak_ver', m_cls, [], now, []), + (False, 'arc_name', 'dis_name', 'dis_rel', 'dis_ver', [], 'pak_name', 'pak_src', + 'pak_ver', 'sup_plat', m_cls, now, []), + (False, 'arc_name', 'dis_name', 'dis_rel', 'dis_ver', [], 'pak_name', 'pak_src', + 'pak_ver', 'sup_plat', [], m_cls, []), + (False, 'arc_name', 'dis_name', 'dis_rel', 'dis_ver', [], 'pak_name', 'pak_src', + 'pak_ver', 'sup_plat', [], now, m_cls), + + (True, 'arc_name', 'dis_name', 'dis_rel', 'dis_ver', [], 'pak_name', 'pak_src', 'pak_ver', 'ver', [], now, []), + (True, 'arc_name', None, 'dis_rel', 'dis_ver', [], 'pak_name', 'pak_src', 'pak_ver', + 'sup_plat', [], now, []), + (True, 'arc_name', 'dis_name', None, 'dis_ver', [], 'pak_name', 'pak_src', 'pak_ver', + 'sup_plat', [], now, []), + (True, 'arc_name', 'dis_name', 'dis_rel', None, [], 'pak_name', 'pak_src', 'pak_ver', + 'sup_plat', [], now, []), (True, 'arc_name', 'dis_name', 'dis_rel', 'dis_ver', None, 'pak_name', 'pak_src', - 'pak_ver', {}, {}, now, {}), - (True, 'arc_name', 'dis_name', 'dis_rel', 'dis_ver', {}, 'pak_name', None, 'pak_ver', - {}, {}, now, {}), - (True, 'arc_name', 'dis_name', 'dis_rel', 'dis_ver', {}, 'pak_name', 'pak_src', None, - {}, {}, now, {}), - (True, 'arc_name', 'dis_name', 'dis_rel', 'dis_ver', {}, 'pak_name', 'pak_src', - 'pak_ver', None, {}, now, {}), - (True, 'arc_name', 'dis_name', 'dis_rel', 'dis_ver', {}, 'pak_name', 'pak_src', - 'pak_ver', {}, None, now, {}), - (True, 'arc_name', 'dis_name', 'dis_rel', 'dis_ver', {}, 'pak_name', 'pak_src', - 'pak_ver', {}, {}, now, {}), + 'pak_ver', 'sup_plat', {}, now, []), + (True, 'arc_name', 'dis_name', 'dis_rel', 'dis_ver', [], 'pak_name', None, 'pak_ver', + 'sup_plat', [], now, []), + (True, 'arc_name', 'dis_name', 'dis_rel', 'dis_ver', [], 'pak_name', 'pak_src', None, + 'sup_plat', [], now, []), + (True, 'arc_name', 'dis_name', 'dis_rel', 'dis_ver', [], 'pak_name', 'pak_src', + 'pak_ver', None, {}, now, []), + (True, 'arc_name', 'dis_name', 'dis_rel', 'dis_ver', [], 'pak_name', 'pak_src', + 'pak_ver', 'sup_plat', None, now, []), + (True, 'arc_name', 'dis_name', 'dis_rel', 'dis_ver', [], 'pak_name', 'pak_src', + 'pak_ver', 'sup_plat', [], now, []), ] ) def test_plugin_model_creation(self, empty_storage, is_valid, archive_name, distribution,