# Path: f5_heat/resources/f5_bigip_device.py
# class BigIPConnectionFailed(HTTPError):
# class F5BigIPDevice(resource.Resource):
#     PROPERTIES = (
#         IP,
#         USERNAME,
#         PASSWORD
#     ) = (
#         'ip',
#         'username',
#         'password'
#     )
#     def get_bigip(self):
#     def handle_create(self):
#     def handle_delete(self):
# def resource_mapping():
# 
# Path: f5_heat/resources/f5_bigip_device.py
# class BigIPConnectionFailed(HTTPError):
#     pass


from f5.bigip import ManagementRoot
from f5_heat.resources import f5_bigip_device
from f5_heat.resources.f5_bigip_device import BigIPConnectionFailed
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
    F5BigIP.get_bigip = mock_get_bigip
    return F5BigIP


# Tests

# Removed __init__ override, so removing test
@mock.patch.object(
    f5_bigip_device.ManagementRoot,
    '__init__',
    side_effect=Exception()
)
def itest__init__error(mocked_bigip):
    template_dict = mock_template()
    rsrc_def = create_resource_definition(template_dict)
    with pytest.raises(Exception):
        f5_bigip_device.F5BigIPDevice(
            'test_template',
            rsrc_def,
            mock.MagicMock()
        )


def test_handle_create(F5BigIPSideEffect):
    create_result = F5BigIPSideEffect.handle_create()
    assert create_result is None
    assert F5BigIPSideEffect.resource_id is not None


def test_handle_create_http_error(F5BigIPHTTPError):

# Path: f5_heat/resources/f5_bigip_device.py
# class BigIPConnectionFailed(HTTPError):
# class F5BigIPDevice(resource.Resource):
#     PROPERTIES = (
#         IP,
#         USERNAME,
#         PASSWORD
#     ) = (
#         'ip',
#         'username',
#         'password'
#     )
#     def get_bigip(self):
#     def handle_create(self):
#     def handle_delete(self):
# def resource_mapping():
# 
# Path: f5_heat/resources/f5_bigip_device.py
# class BigIPConnectionFailed(HTTPError):
#     pass


# Path: f5_heat/resources/test/test_f5_bigip_device.py
from f5.bigip import ManagementRoot
from f5_heat.resources import f5_bigip_device
from f5_heat.resources.f5_bigip_device import BigIPConnectionFailed
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

    F5BigIP.get_bigip = mock_get_bigip
    return F5BigIP


# Tests

# Removed __init__ override, so removing test
@mock.patch.object(
    f5_bigip_device.ManagementRoot,
    '__init__',
    side_effect=Exception()
)
def itest__init__error(mocked_bigip):
    template_dict = mock_template()
    rsrc_def = create_resource_definition(template_dict)
    with pytest.raises(Exception):
        f5_bigip_device.F5BigIPDevice(
            'test_template',
            rsrc_def,
            mock.MagicMock()
        )


def test_handle_create(F5BigIPSideEffect):
    create_result = F5BigIPSideEffect.handle_create()
    assert create_result is None
    assert F5BigIPSideEffect.resource_id is not None


def test_handle_create_http_error(F5BigIPHTTPError):

    with pytest.raises(BigIPConnectionFailed):