Github user mxmrlv commented on a diff in the pull request:
https://github.com/apache/incubator-ariatosca/pull/77#discussion_r108178303
--- Diff: tests/orchestrator/workflows/builtin/__init__.py ---
@@ -13,18 +13,65 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-from tests import mock
+from aria.orchestrator.workflows.builtin import workflows
-def assert_node_install_operations(operations, with_relationships=False):
- all_operations = mock.operations.OPERATIONS_INSTALL if
with_relationships else \
- mock.operations.NODE_OPERATIONS_INSTALL
- for i, operation in enumerate(operations):
- assert operation.name.startswith(all_operations[i] + '.')
+def _assert_relationships(operations, expected_op_full_name,
relationships=0):
+ """
+ :param operations: and iterable of operations
+ :param expected_op_full_name: Note that source/target doesn't really
matter since they are
+ dropped
+ :param relationships: the number of relationships
+ :return:
+ """
+ expected_op_name = expected_op_full_name.rsplit('_', 1)[0]
+ for _ in xrange(relationships):
+ # Since the target and source operations start of the same way, we
only need to retrieve the
+ # suffix once
+ operation = next(operations)
+ relationship_id_1 = operation.actor.id
+ edge1 = operation.runs_on
+ _assert_cfg_interface_op(operation, expected_op_name)
-def assert_node_uninstall_operations(operations, with_relationships=False):
- all_operations = mock.operations.OPERATIONS_UNINSTALL if
with_relationships else \
- mock.operations.NODE_OPERATIONS_UNINSTALL
- for i, operation in enumerate(operations):
- assert operation.name.startswith(all_operations[i] + '.')
+ operation = next(operations)
+ relationship_id_2 = operation.actor.id
+ edge2 = operation.runs_on
+ _assert_cfg_interface_op(operation, expected_op_name)
+
+ assert relationship_id_1 == relationship_id_2
+ print '++++' + edge1, edge2
--- End diff --
delete
---
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 [email protected] or file a JIRA ticket
with INFRA.
---