# Path: tests/base.py
# LOG = oslo_logging.getLogger(__name__)
# class TestCase(base.BaseTestCase):
#     def setUp(self):
#     def _common_cleanup(self):
#     def log_level(self, level):
#     def mock_object(self, obj, attr_name, new_attr=None, **kwargs):
#     def assertDictMatch(self, d1, d2, approx_equal=False, tolerance=0.001):
#         def raise_assertion(msg):
# 
# Path: virtman/path.py
# LOG = logging.getLogger(__name__)
# class Path(object):
# class Paths(object):
#     def __init__(self, connection):
#     def __str__(self):
#     def connection_to_str(connection):
#     def connect(path):
#     def disconnect(path):
#     def _find_paths_to_remove(paths, parent_connections):
#     def _add_new_connection(paths, parent_connections):
#     def rebuild_multipath(paths, parent_connections, multipath_name,
#                           multipath_path):
#     def create_multipath(multipath_name, disks):
#     def reload_multipath(multipath_name, disks):
#     def delete_multipath(multipath_name):
# 
# Path: virtman/drivers/dmsetup.py
# class DmExecutor(dmsetup.Dmsetup):
#     def __init__(self):
# def remove_table(name):
# def reload_table(name, table):
# def multipath(name, disks):
# def reload_multipath(name, disks):
# def origin(origin_name, origin_dev):
# def snapshot(origin_path, snapshot_name, snapshot_dev):
# 
# Path: virtman/drivers/connector.py
# class ISCSIExecutor(ISCSIConnector):
#     def __init__(self):
# def connect_volume(connection):
# def disconnect_volume(connection, device_info):


import mock
from tests import base
from virtman import path
from virtman.drivers import dmsetup
from virtman.drivers import connector
        path.device_path = path.device_info['path']
        path.connected = True
        return '/dev/disk/by-path/'+str(path)

    @staticmethod
    def disconnect(path):
        path.connected = False

FakePath1 = FakePath(test_connection1)
FakePath.connect(FakePath1)
FakePath2 = FakePath(test_connection2)
FakePath.connect(FakePath2)
test_paths = {str(FakePath1): FakePath1,
              str(FakePath2): FakePath2}


class TestPath(base.TestCase):
    def setUp(self):
        super(TestPath, self).setUp()
        self.path = path.Path(test_connection1)

    def test_str(self):
        expected = 'ip-10.0.0.1:3260-iscsi-iqn.2010-10.org.' \
                   'openstack:volume-00000001-lun-1'
        result = str(self.path)
        self.assertEqual(expected, result)

    def test_connect(self):
        expected = '/dev/disk/by-path/ip-10.0.0.1:3260-iscsi-iqn.2010-10.' \
                   'org.openstack:volume-00000001-lun-1'

# Path: tests/base.py
# LOG = oslo_logging.getLogger(__name__)
# class TestCase(base.BaseTestCase):
#     def setUp(self):
#     def _common_cleanup(self):
#     def log_level(self, level):
#     def mock_object(self, obj, attr_name, new_attr=None, **kwargs):
#     def assertDictMatch(self, d1, d2, approx_equal=False, tolerance=0.001):
#         def raise_assertion(msg):
# 
# Path: virtman/path.py
# LOG = logging.getLogger(__name__)
# class Path(object):
# class Paths(object):
#     def __init__(self, connection):
#     def __str__(self):
#     def connection_to_str(connection):
#     def connect(path):
#     def disconnect(path):
#     def _find_paths_to_remove(paths, parent_connections):
#     def _add_new_connection(paths, parent_connections):
#     def rebuild_multipath(paths, parent_connections, multipath_name,
#                           multipath_path):
#     def create_multipath(multipath_name, disks):
#     def reload_multipath(multipath_name, disks):
#     def delete_multipath(multipath_name):
# 
# Path: virtman/drivers/dmsetup.py
# class DmExecutor(dmsetup.Dmsetup):
#     def __init__(self):
# def remove_table(name):
# def reload_table(name, table):
# def multipath(name, disks):
# def reload_multipath(name, disks):
# def origin(origin_name, origin_dev):
# def snapshot(origin_path, snapshot_name, snapshot_dev):
# 
# Path: virtman/drivers/connector.py
# class ISCSIExecutor(ISCSIConnector):
#     def __init__(self):
# def connect_volume(connection):
# def disconnect_volume(connection, device_info):


# Path: tests/test_path.py
import mock
from tests import base
from virtman import path
from virtman.drivers import dmsetup
from virtman.drivers import connector

        path.device_path = path.device_info['path']
        path.connected = True
        return '/dev/disk/by-path/'+str(path)

    @staticmethod
    def disconnect(path):
        path.connected = False

FakePath1 = FakePath(test_connection1)
FakePath.connect(FakePath1)
FakePath2 = FakePath(test_connection2)
FakePath.connect(FakePath2)
test_paths = {str(FakePath1): FakePath1,
              str(FakePath2): FakePath2}


class TestPath(base.TestCase):
    def setUp(self):
        super(TestPath, self).setUp()
        self.path = path.Path(test_connection1)

    def test_str(self):
        expected = 'ip-10.0.0.1:3260-iscsi-iqn.2010-10.org.' \
                   'openstack:volume-00000001-lun-1'
        result = str(self.path)
        self.assertEqual(expected, result)

    def test_connect(self):
        expected = '/dev/disk/by-path/ip-10.0.0.1:3260-iscsi-iqn.2010-10.' \
                   'org.openstack:volume-00000001-lun-1'

        self.mock_object(connector, 'connect_volume',