# Path: f5_heat/resources/f5_cm_sync.py
# class F5CmSync(resource.Resource, F5BigIPMixin):
#     PROPERTIES = (
#         BIGIP_SERVER,
#         DEVICE_GROUP,
#         DEVICE_GROUP_PARTITION
#     ) = (
#         'bigip_server',
#         'device_group',
#         'device_group_partition'
#     )
#     def handle_create(self):
#     def check_create_complete(self, token):
#     def handle_delete(self):
# def resource_mapping():


from f5_heat.resources import f5_cm_sync
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
    assert 'test' in ex.value.message


def test_handle_create_error_sync_fails(CreateSyncSyncFails):
    '''Currently, test exists to satisfy 100% code coverage.'''
    with pytest.raises(exception.ResourceFailure) as ex:
        CreateSyncSyncFails.handle_create()
    assert 'test' in ex.value.message


def test_handle_check_create_complete_true(F5CmSync):
    F5CmSync.get_bigip()
    F5CmSync.bigip.tm.cm.sync_status = SyncStatusEntries('In Sync')
    check_result = F5CmSync.check_create_complete('token')
    assert check_result is True


def test_handle_check_create_complete_false(F5CmSync):
    F5CmSync.get_bigip()
    F5CmSync.bigip.tm.cm.sync_status = SyncStatusEntries('disconnected')
    check_result = F5CmSync.check_create_complete('token')
    assert check_result is False


def test_handle_delete(F5CmSync):
    delete_result = F5CmSync.handle_delete()
    assert delete_result is True


def test_resource_mapping():

# Path: f5_heat/resources/f5_cm_sync.py
# class F5CmSync(resource.Resource, F5BigIPMixin):
#     PROPERTIES = (
#         BIGIP_SERVER,
#         DEVICE_GROUP,
#         DEVICE_GROUP_PARTITION
#     ) = (
#         'bigip_server',
#         'device_group',
#         'device_group_partition'
#     )
#     def handle_create(self):
#     def check_create_complete(self, token):
#     def handle_delete(self):
# def resource_mapping():


# Path: f5_heat/resources/test/test_f5_cm_sync.py
from f5_heat.resources import f5_cm_sync
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

    assert 'test' in ex.value.message


def test_handle_create_error_sync_fails(CreateSyncSyncFails):
    '''Currently, test exists to satisfy 100% code coverage.'''
    with pytest.raises(exception.ResourceFailure) as ex:
        CreateSyncSyncFails.handle_create()
    assert 'test' in ex.value.message


def test_handle_check_create_complete_true(F5CmSync):
    F5CmSync.get_bigip()
    F5CmSync.bigip.tm.cm.sync_status = SyncStatusEntries('In Sync')
    check_result = F5CmSync.check_create_complete('token')
    assert check_result is True


def test_handle_check_create_complete_false(F5CmSync):
    F5CmSync.get_bigip()
    F5CmSync.bigip.tm.cm.sync_status = SyncStatusEntries('disconnected')
    check_result = F5CmSync.check_create_complete('token')
    assert check_result is False


def test_handle_delete(F5CmSync):
    delete_result = F5CmSync.handle_delete()
    assert delete_result is True


def test_resource_mapping():

    rsrc_map = f5_cm_sync.resource_mapping()