# Path: f5_heat/resources/f5_ltm_pool.py
# class F5LTMPool(resource.Resource, F5BigIPMixin):
#     PROPERTIES = (
#         NAME,
#         BIGIP_SERVER,
#         PARTITION,
#         SERVICE_DOWN_ACTION,
#         MEMBERS
#     ) = (
#         'name',
#         'bigip_server',
#         'partition',
#         'service_down_action',
#         'members'
#     )
#     _MEMBER_KEYS = (
#         MEMBER_IP, MEMBER_PORT
#     ) = (
#         'member_ip', 'member_port'
#     )
#     def _assign_members(self):
#     def handle_create(self):
#     def handle_delete(self):
# def resource_mapping():


from f5_heat.resources import f5_ltm_pool
from heat.common import exception
from heat.common import template_format
from heat.engine.hot.template import HOTemplate20150430
from heat.engine import rsrc_defn
from heat.engine import template
import mock
import pytest

def test_handle_create_error(CreatePoolSideEffect):
    '''Currently, test exists to satisfy code 100% code coverage.'''
    with pytest.raises(exception.ResourceFailure):
        CreatePoolSideEffect.handle_create()


def test_handle_create_assign_members_error(AssignMembersSideEffect):
    '''Currently, test exists to satisfy code 100% code coverage.'''
    with pytest.raises(exception.ResourceFailure):
        AssignMembersSideEffect.handle_create()


def test_handle_delete(F5LTMPoolExists):
    assert F5LTMPoolExists.handle_delete() is True
    assert F5LTMPoolExists.bigip.tm.ltm.pools.pool.load.call_args == \
        mock.call(name='testing_pool', partition='Common')


def test_handle_delete_no_exists(F5LTMPoolNoExists):
    assert F5LTMPoolNoExists.handle_delete() is True


def test_handle_delete_error(DeletePoolSideEffect):
    '''Currently, test exists to satisfy code 100% code coverage.'''
    with pytest.raises(exception.ResourceFailure):
        DeletePoolSideEffect.handle_delete()


def test_resource_mapping():

# Path: f5_heat/resources/f5_ltm_pool.py
# class F5LTMPool(resource.Resource, F5BigIPMixin):
#     PROPERTIES = (
#         NAME,
#         BIGIP_SERVER,
#         PARTITION,
#         SERVICE_DOWN_ACTION,
#         MEMBERS
#     ) = (
#         'name',
#         'bigip_server',
#         'partition',
#         'service_down_action',
#         'members'
#     )
#     _MEMBER_KEYS = (
#         MEMBER_IP, MEMBER_PORT
#     ) = (
#         'member_ip', 'member_port'
#     )
#     def _assign_members(self):
#     def handle_create(self):
#     def handle_delete(self):
# def resource_mapping():


# Path: f5_heat/resources/test/test_f5_ltm_pool.py
from f5_heat.resources import f5_ltm_pool
from heat.common import exception
from heat.common import template_format
from heat.engine.hot.template import HOTemplate20150430
from heat.engine import rsrc_defn
from heat.engine import template
import mock
import pytest


def test_handle_create_error(CreatePoolSideEffect):
    '''Currently, test exists to satisfy code 100% code coverage.'''
    with pytest.raises(exception.ResourceFailure):
        CreatePoolSideEffect.handle_create()


def test_handle_create_assign_members_error(AssignMembersSideEffect):
    '''Currently, test exists to satisfy code 100% code coverage.'''
    with pytest.raises(exception.ResourceFailure):
        AssignMembersSideEffect.handle_create()


def test_handle_delete(F5LTMPoolExists):
    assert F5LTMPoolExists.handle_delete() is True
    assert F5LTMPoolExists.bigip.tm.ltm.pools.pool.load.call_args == \
        mock.call(name='testing_pool', partition='Common')


def test_handle_delete_no_exists(F5LTMPoolNoExists):
    assert F5LTMPoolNoExists.handle_delete() is True


def test_handle_delete_error(DeletePoolSideEffect):
    '''Currently, test exists to satisfy code 100% code coverage.'''
    with pytest.raises(exception.ResourceFailure):
        DeletePoolSideEffect.handle_delete()


def test_resource_mapping():

    rsrc_map = f5_ltm_pool.resource_mapping()