# Path: networking_vsphere/tests/base.py
# CONF = cfg.CONF
# class TestCase(base.BaseTestCase):
#     def setUp(self):
#     def setup_rpc_mocks(self):
#     def flags(self, **kw):
#     def reset_flags(self):
#     def del_attributes(self):
# 
# Path: networking_vsphere/tests/unit/utils/fake_vmware_api.py
# _CLASSES = ['session', 'VirtualMachine', 'HostSystem', 'HostNetworkSystem',
#             'ClusterComputeResource', 'Network', 'DistributedVirtualSwitch',
#             'DistributedVirtualPortgroup', 'Task']
#     VM_UUID = "1111-2222-3333-4444"
#     VM_NAME = "TEST_VIRTUAL_MACHINE"
#     VM_MAC = "11:22:33:44:55:ef"
#     HOST_NAME = "TEST_HOST"
#     PORTGROUP_NAME = "6d382cca-d8c6-42df-897d-9b6a99d4c04d"
#     PORTGROUP_KEY = "Portgroup-270"
# class Constants(object):
# class Prop(object):
# class ManagedObject(object):
# class DataObject(object):
# class Network(ManagedObject):
# class ClusterComputeResource(ManagedObject):
# class HostNetworkSystem(ManagedObject):
# class HostSystem(ManagedObject):
# class VirtualDisk(DataObject):
# class VirtualPCNet32(DataObject):
# class VirtualMachine(ManagedObject):
# class DistributedVirtualPortgroup(ManagedObject):
# class DistributedVirtualSwitch(ManagedObject):
# class Task(ManagedObject):
# class FakeFactory(object):
# class FakeVim(object):
# class FakeDynamicPropertyObject(object):
# class FakeObjectContent(object):
# class FakeRetrieveResultObject(object):
# class FakeVimUtil(object):
# def reset():
# def cleanup():
# def _create_object(table, table_obj):
#     def __init__(self):
#     def __init__(self, name="ManagedObject", obj_ref=None):
#     def set(self, attr, val):
#     def get(self, attr):
#     def __setattr__(self, attr, val):
#     def __getattr__(self, attr):
#     def __init__(self):
#     def __init__(self, **kwargs):
#     def __init__(self):
#     def __init__(self):
#     def __init__(self):
#     def __init__(self):
#     def __init__(self, **kwargs):
#     def __init__(self):
#     def __init__(self):
#     def __init__(self, task_name, state="running"):
# def create_network():
# def create_host_network_system():
# def create_host():
# def create_cluster_compute_resource():
# def create_virtual_machine():
# def create_distributed_virtual_portgroup():
# def create_distributed_virtual_switch():
# def create_task(task_name, state="running"):
# def is_task_done(task_name):
#     def create(self, obj_name):
#     def __init__(self, protocol="https", host="localhost", trace=None):
#     def get_service_content(self):
#     def _login(self):
#     def _retrieve_properties(self, method, *args, **kwargs):
#     def _delete_port_group(self, method, *args, **kwargs):
#     def _just_return_task(self, method):
#     def _just_return(self):
#     def _query_dvs_by_uuid(self, method, *args, **kwargs):
#     def _find_by_inventory_path(self, method, *args, **kwargs):
#     def _reconfigure_dv_port_task(self, method, *args, **kwargs):
#     def _wait_for_updates(self, method, *args, **kwargs):
#     def __getattr__(self, attr_name):
#     def __init__(self):
#     def __init__(self):
#     def __init__(self):
#     def __init__(self):
#     def RetrievePropertiesEx(self, prop_coll, specSet, options):
#     def ContinueRetrievePropertiesEx(self, prop_coll, token=None):


from networking_vsphere.tests import base
from networking_vsphere.tests.unit.utils import fake_vmware_api
from networking_vsphere.utils import vim_util
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
#    not use this file except in compliance with the License. You may obtain
#    a copy of the License at
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.
#



class VimUtilsTestCase(base.TestCase):

    def setUp(self):
        super(VimUtilsTestCase, self).setUp()

    def test_build_recursive_traversal_spec(self):
        client_factory = fake_vmware_api.FakeFactory()
        trav_specs = vim_util.build_recursive_traversal_spec(client_factory)
        spec_names = ["rpToRp", "rpToVm", "crToRp", "crToH",
                      "dcToHf", "dcToVmf", "dcToDs", "hToVm",
                      "dsToVm", "visitFolders"]
        for spec in trav_specs:
            self.assertIn(spec.name, spec_names)

    def test_dynamic_property(self):

# Path: networking_vsphere/tests/base.py
# CONF = cfg.CONF
# class TestCase(base.BaseTestCase):
#     def setUp(self):
#     def setup_rpc_mocks(self):
#     def flags(self, **kw):
#     def reset_flags(self):
#     def del_attributes(self):
# 
# Path: networking_vsphere/tests/unit/utils/fake_vmware_api.py
# _CLASSES = ['session', 'VirtualMachine', 'HostSystem', 'HostNetworkSystem',
#             'ClusterComputeResource', 'Network', 'DistributedVirtualSwitch',
#             'DistributedVirtualPortgroup', 'Task']
#     VM_UUID = "1111-2222-3333-4444"
#     VM_NAME = "TEST_VIRTUAL_MACHINE"
#     VM_MAC = "11:22:33:44:55:ef"
#     HOST_NAME = "TEST_HOST"
#     PORTGROUP_NAME = "6d382cca-d8c6-42df-897d-9b6a99d4c04d"
#     PORTGROUP_KEY = "Portgroup-270"
# class Constants(object):
# class Prop(object):
# class ManagedObject(object):
# class DataObject(object):
# class Network(ManagedObject):
# class ClusterComputeResource(ManagedObject):
# class HostNetworkSystem(ManagedObject):
# class HostSystem(ManagedObject):
# class VirtualDisk(DataObject):
# class VirtualPCNet32(DataObject):
# class VirtualMachine(ManagedObject):
# class DistributedVirtualPortgroup(ManagedObject):
# class DistributedVirtualSwitch(ManagedObject):
# class Task(ManagedObject):
# class FakeFactory(object):
# class FakeVim(object):
# class FakeDynamicPropertyObject(object):
# class FakeObjectContent(object):
# class FakeRetrieveResultObject(object):
# class FakeVimUtil(object):
# def reset():
# def cleanup():
# def _create_object(table, table_obj):
#     def __init__(self):
#     def __init__(self, name="ManagedObject", obj_ref=None):
#     def set(self, attr, val):
#     def get(self, attr):
#     def __setattr__(self, attr, val):
#     def __getattr__(self, attr):
#     def __init__(self):
#     def __init__(self, **kwargs):
#     def __init__(self):
#     def __init__(self):
#     def __init__(self):
#     def __init__(self):
#     def __init__(self, **kwargs):
#     def __init__(self):
#     def __init__(self):
#     def __init__(self, task_name, state="running"):
# def create_network():
# def create_host_network_system():
# def create_host():
# def create_cluster_compute_resource():
# def create_virtual_machine():
# def create_distributed_virtual_portgroup():
# def create_distributed_virtual_switch():
# def create_task(task_name, state="running"):
# def is_task_done(task_name):
#     def create(self, obj_name):
#     def __init__(self, protocol="https", host="localhost", trace=None):
#     def get_service_content(self):
#     def _login(self):
#     def _retrieve_properties(self, method, *args, **kwargs):
#     def _delete_port_group(self, method, *args, **kwargs):
#     def _just_return_task(self, method):
#     def _just_return(self):
#     def _query_dvs_by_uuid(self, method, *args, **kwargs):
#     def _find_by_inventory_path(self, method, *args, **kwargs):
#     def _reconfigure_dv_port_task(self, method, *args, **kwargs):
#     def _wait_for_updates(self, method, *args, **kwargs):
#     def __getattr__(self, attr_name):
#     def __init__(self):
#     def __init__(self):
#     def __init__(self):
#     def __init__(self):
#     def RetrievePropertiesEx(self, prop_coll, specSet, options):
#     def ContinueRetrievePropertiesEx(self, prop_coll, token=None):


# Path: networking_vsphere/tests/unit/utils/test_vim_util.py
from networking_vsphere.tests import base
from networking_vsphere.tests.unit.utils import fake_vmware_api
from networking_vsphere.utils import vim_util

#    Licensed under the Apache License, Version 2.0 (the "License"); you may
#    not use this file except in compliance with the License. You may obtain
#    a copy of the License at
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.
#



class VimUtilsTestCase(base.TestCase):

    def setUp(self):
        super(VimUtilsTestCase, self).setUp()

    def test_build_recursive_traversal_spec(self):
        client_factory = fake_vmware_api.FakeFactory()
        trav_specs = vim_util.build_recursive_traversal_spec(client_factory)
        spec_names = ["rpToRp", "rpToVm", "crToRp", "crToH",
                      "dcToHf", "dcToVmf", "dcToDs", "hToVm",
                      "dsToVm", "visitFolders"]
        for spec in trav_specs:
            self.assertIn(spec.name, spec_names)

    def test_dynamic_property(self):

        vim = fake_vmware_api.FakeVimUtil()