# Path: cloudify_resources/tasks.py
# def _refresh_source_and_target_runtime_props(ctx, **kwargs):
# def _update_source_and_target_runtime_props(ctx, **kwargs):
# def create_list(ctx, **kwargs):
# def create_list_item(ctx, **kwargs):
# def delete_list_item(ctx, **kwargs):
# def delete_list(ctx, **kwargs):
# def reserve_list_item(ctx, **kwargs):
# def return_list_item(ctx, **kwargs):
# 
# Path: cloudify_resources/constants.py
# RESOURCES_LIST_PROPERTY = 'resource_config'
# 
# FREE_RESOURCES_LIST_PROPERTY = 'free_resources'
# 
# RESERVATIONS_PROPERTY = 'reservations'
# 
# SINGLE_RESERVATION_PROPERTY = 'reservation'


import unittest
from cloudify.state import current_ctx
from cloudify.mocks import (
    MockCloudifyContext,
    MockNodeContext,
    MockNodeInstanceContext,
    MockRelationshipContext,
    MockRelationshipSubjectContext
)
from cloudify_resources import tasks
from cloudify_resources.constants import (
    RESOURCES_LIST_PROPERTY,
    FREE_RESOURCES_LIST_PROPERTY,
    RESERVATIONS_PROPERTY,
    SINGLE_RESERVATION_PROPERTY
)
                '10.0.2.0/24',
                '10.0.3.0/24'
            ]
        }

        ctx = MockCloudifyContext(
            node_id='test_resources',
            node_type='cloudify.nodes.resources.List',
            properties=properties
        )

        current_ctx.set(ctx)
        return ctx

    def _mock_resource_list_item_ctx(self):
        ctx = MockCloudifyContext(
            node_id='test_item',
            node_type='cloudify.nodes.resources.ListItem'
        )

        current_ctx.set(ctx)
        return ctx

    def _mock_item_to_resources_list_rel_ctx(self):
        # target
        tar_rel_subject_ctx = MockRelationshipSubjectContext(
            node=MockNodeContext(
                id='test_resources',
                type='cloudify.nodes.resources.List',
                properties={

# Path: cloudify_resources/tasks.py
# def _refresh_source_and_target_runtime_props(ctx, **kwargs):
# def _update_source_and_target_runtime_props(ctx, **kwargs):
# def create_list(ctx, **kwargs):
# def create_list_item(ctx, **kwargs):
# def delete_list_item(ctx, **kwargs):
# def delete_list(ctx, **kwargs):
# def reserve_list_item(ctx, **kwargs):
# def return_list_item(ctx, **kwargs):
# 
# Path: cloudify_resources/constants.py
# RESOURCES_LIST_PROPERTY = 'resource_config'
# 
# FREE_RESOURCES_LIST_PROPERTY = 'free_resources'
# 
# RESERVATIONS_PROPERTY = 'reservations'
# 
# SINGLE_RESERVATION_PROPERTY = 'reservation'


# Path: cloudify_resources/tests/test_tasks.py
import unittest
from cloudify.state import current_ctx
from cloudify.mocks import (
    MockCloudifyContext,
    MockNodeContext,
    MockNodeInstanceContext,
    MockRelationshipContext,
    MockRelationshipSubjectContext
)
from cloudify_resources import tasks
from cloudify_resources.constants import (
    RESOURCES_LIST_PROPERTY,
    FREE_RESOURCES_LIST_PROPERTY,
    RESERVATIONS_PROPERTY,
    SINGLE_RESERVATION_PROPERTY
)

                '10.0.2.0/24',
                '10.0.3.0/24'
            ]
        }

        ctx = MockCloudifyContext(
            node_id='test_resources',
            node_type='cloudify.nodes.resources.List',
            properties=properties
        )

        current_ctx.set(ctx)
        return ctx

    def _mock_resource_list_item_ctx(self):
        ctx = MockCloudifyContext(
            node_id='test_item',
            node_type='cloudify.nodes.resources.ListItem'
        )

        current_ctx.set(ctx)
        return ctx

    def _mock_item_to_resources_list_rel_ctx(self):
        # target
        tar_rel_subject_ctx = MockRelationshipSubjectContext(
            node=MockNodeContext(
                id='test_resources',
                type='cloudify.nodes.resources.List',
                properties={

                    'resource_config': [