ariatosca-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tliron <...@git.apache.org>
Subject [GitHub] incubator-ariatosca pull request #72: ARIA-105 integrate modeling
Date Mon, 20 Mar 2017 15:54:39 GMT
Github user tliron commented on a diff in the pull request:

    https://github.com/apache/incubator-ariatosca/pull/72#discussion_r106939198
  
    --- Diff: tests/modeling/test_models.py ---
    @@ -663,66 +646,45 @@ def _node(self, storage, node, is_host, ip, host_fk=None):
             kwargs = dict(
                 name='node',
                 node_template=node,
    +            type=storage.type.list()[0],
                 runtime_properties={},
                 state='',
    -            service_instance=storage.service_instance.list()[0]
    +            service=storage.service.list()[0]
             )
             if ip:
                 kwargs['runtime_properties']['ip'] = ip
             if is_host:
                 kwargs['host_fk'] = 1
             elif host_fk:
                 kwargs['host_fk'] = host_fk
    -        node_instance = Node(**kwargs)
    -        storage.node.put(node_instance)
    -        return node_instance
    +        node = Node(**kwargs)
    +        storage.node.put(node)
    +        return node
     
     
    -class TestRelationshipInstance(object):
    +class TestRelationship(object):
         @pytest.mark.parametrize(
    -        'is_valid, source_requirement_index, target_node_id, target_capability_name,
type_name, '
    -        'template_name, type_hierarchy, source_position, target_position',
    +        'is_valid, source_position, target_position',
             [
    -            (False, m_cls, 'target_node_id', 'target_cap_name', 'type_name', 'template_name',
[], 0,
    -             0),
    -            (False, 0, m_cls, 'target_cap_name', 'type_name', 'template_name', [], 0,
0),
    -            (False, 0, 'target_node_id', m_cls, 'type_name', 'template_name', [], 0,
0),
    -            (False, 0, 'target_node_id', 'target_cap_name', m_cls, 'template_name', [],
0, 0),
    -            (False, 0, 'target_node_id', 'target_cap_name', 'type_name', m_cls, [], 0,
0),
    -            (False, 0, 'target_node_id', 'target_cap_name', 'type_name', 'template_name',
m_cls, 0,
    -             0),
    -            (False, 0, 'target_node_id', 'target_cap_name', 'type_name', 'template_name',
[], m_cls,
    -             0),
    -            (False, 0, 'target_node_id', 'target_cap_name', 'type_name', 'template_name',
[], 0,
    -             m_cls),
    -
    -            (True, 0, 'target_node_id', 'target_cap_name', 'type_name', 'template_name',
[], 0, 0),
    -            (True, None, 'target_node_id', 'target_cap_name', 'type_name', 'template_name',
[], 0,
    -             0),
    -            (True, 0, None, 'target_cap_name', 'type_name', 'template_name', [], 0, 0),
    -            (True, 0, 'target_node_id', None, 'type_name', 'template_name', [], 0, 0),
    -            (True, 0, 'target_node_id', 'target_cap_name', None, 'template_name', [],
0, 0),
    -            (True, 0, 'target_node_id', 'target_cap_name', 'type_name', None, [], 0,
0),
    -            (True, 0, 'target_node_id', 'target_cap_name', 'type_name', 'template_name',
[], None,
    -             0),
    -            (True, 0, 'target_node_id', 'target_cap_name', 'type_name', 'template_name',
[], 0,
    -             None),
    +            (False, m_cls, 0),
    --- End diff --
    
    `Relationship` comprises almost entirely foreign keys now! For the test I left the only
few columns that are values.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message