# Path: oslo_vmware/constants.py
# ESX_DATACENTER_PATH = 'ha-datacenter'
# USER_AGENT = 'OpenStack-ESX-Adapter'
# SOAP_COOKIE_KEY = 'vmware_soap_session'
# CGI_COOKIE_KEY = 'vmware_cgi_ticket'
# 
# Path: oslo_vmware/objects/datastore.py
# @property
# def datastore(self):
#     return self._datastore_name
# 
# Path: oslo_vmware/vim_util.py
# LOG = logging.getLogger(__name__)
# def get_moref(value, type_):
# def get_moref_value(moref):
# def get_moref_type(moref):
# def build_selection_spec(client_factory, name):
# def build_traversal_spec(client_factory, name, type_, path, skip, select_set):
# def build_recursive_traversal_spec(client_factory):
# def build_property_spec(client_factory, type_='VirtualMachine',
#                         properties_to_collect=None, all_properties=False):
# def build_object_spec(client_factory, root_folder, traversal_specs):
# def build_property_filter_spec(client_factory, property_specs, object_specs):
# def get_objects(vim, type_, max_objects, properties_to_collect=None,
#                 all_properties=False):
# def get_object_properties(vim, moref, properties_to_collect, skip_op_id=False):
# def get_object_properties_dict(vim, moref, properties_to_collect):
# def _get_token(retrieve_result):
# def cancel_retrieval(vim, retrieve_result):
# def continue_retrieval(vim, retrieve_result):
#     def __init__(self, vim, retrieve_result):
#     def __enter__(self):
#     def __exit__(self, exc_type, exc_value, traceback):
#     def __iter__(self):
# def get_object_property(vim, moref, property_name, skip_op_id=False):
# def find_extension(vim, key):
# def register_extension(vim, key, type, label='OpenStack',
#                        summary='OpenStack services', version='1.0'):
# def get_vc_version(session):
# def get_inventory_path(vim, entity_ref, max_objects=100):
# def get_http_service_request_spec(client_factory, method, uri):
# def get_prop_spec(client_factory, spec_type, properties):
# def get_obj_spec(client_factory, obj, select_set=None):
# def get_prop_filter_spec(client_factory, obj_spec, prop_spec):
# def get_properties_for_a_collection_of_objects(vim, type_,
#                                                obj_list, properties,
#                                                max_objects=None):
# def propset_dict(propset):
# def storage_placement_spec(client_factory,
#                            dsc_ref,
#                            type,
#                            clone_spec=None,
#                            config_spec=None,
#                            relocate_spec=None,
#                            vm_ref=None,
#                            folder=None,
#                            clone_name=None,
#                            res_pool_ref=None,
#                            host_ref=None):
# def serialize_object(obj):
# class WithRetrieval(object):


from unittest import mock
from oslo_utils import units
from oslo_vmware import constants
from oslo_vmware.objects import datastore
from oslo_vmware.tests import base
from oslo_vmware import vim_util
import urllib.parse as urlparse
            ('dsname', ['/a/b/c/', 'x.vmdk ']),
            ('dsname', ['a/b/c/ ', 'x.vmdk'])]

        canonical_p = datastore.DatastorePath('dsname', 'a/b/c', 'x.vmdk')
        for t in args:
            p = datastore.DatastorePath(t[0], *t[1])
            self.assertNotEqual(str(canonical_p), str(p))

    def test_equal(self):
        a = datastore.DatastorePath('ds_name', 'a')
        b = datastore.DatastorePath('ds_name', 'a')
        self.assertEqual(a, b)

    def test_join(self):
        p = datastore.DatastorePath('ds_name', 'a')
        ds_path = p.join('b')
        self.assertEqual('[ds_name] a/b', str(ds_path))

        p = datastore.DatastorePath('ds_name', 'a')
        ds_path = p.join()
        bad_args = [
            [None],
            ['', None],
            ['a', None],
            ['a', None, 'b']]
        for arg in bad_args:
            self.assertRaises(ValueError, p.join, *arg)

    def test_ds_path_parse(self):
        p = datastore.DatastorePath.parse('[dsname]')

# Path: oslo_vmware/constants.py
# ESX_DATACENTER_PATH = 'ha-datacenter'
# USER_AGENT = 'OpenStack-ESX-Adapter'
# SOAP_COOKIE_KEY = 'vmware_soap_session'
# CGI_COOKIE_KEY = 'vmware_cgi_ticket'
# 
# Path: oslo_vmware/objects/datastore.py
# @property
# def datastore(self):
#     return self._datastore_name
# 
# Path: oslo_vmware/vim_util.py
# LOG = logging.getLogger(__name__)
# def get_moref(value, type_):
# def get_moref_value(moref):
# def get_moref_type(moref):
# def build_selection_spec(client_factory, name):
# def build_traversal_spec(client_factory, name, type_, path, skip, select_set):
# def build_recursive_traversal_spec(client_factory):
# def build_property_spec(client_factory, type_='VirtualMachine',
#                         properties_to_collect=None, all_properties=False):
# def build_object_spec(client_factory, root_folder, traversal_specs):
# def build_property_filter_spec(client_factory, property_specs, object_specs):
# def get_objects(vim, type_, max_objects, properties_to_collect=None,
#                 all_properties=False):
# def get_object_properties(vim, moref, properties_to_collect, skip_op_id=False):
# def get_object_properties_dict(vim, moref, properties_to_collect):
# def _get_token(retrieve_result):
# def cancel_retrieval(vim, retrieve_result):
# def continue_retrieval(vim, retrieve_result):
#     def __init__(self, vim, retrieve_result):
#     def __enter__(self):
#     def __exit__(self, exc_type, exc_value, traceback):
#     def __iter__(self):
# def get_object_property(vim, moref, property_name, skip_op_id=False):
# def find_extension(vim, key):
# def register_extension(vim, key, type, label='OpenStack',
#                        summary='OpenStack services', version='1.0'):
# def get_vc_version(session):
# def get_inventory_path(vim, entity_ref, max_objects=100):
# def get_http_service_request_spec(client_factory, method, uri):
# def get_prop_spec(client_factory, spec_type, properties):
# def get_obj_spec(client_factory, obj, select_set=None):
# def get_prop_filter_spec(client_factory, obj_spec, prop_spec):
# def get_properties_for_a_collection_of_objects(vim, type_,
#                                                obj_list, properties,
#                                                max_objects=None):
# def propset_dict(propset):
# def storage_placement_spec(client_factory,
#                            dsc_ref,
#                            type,
#                            clone_spec=None,
#                            config_spec=None,
#                            relocate_spec=None,
#                            vm_ref=None,
#                            folder=None,
#                            clone_name=None,
#                            res_pool_ref=None,
#                            host_ref=None):
# def serialize_object(obj):
# class WithRetrieval(object):


# Path: oslo_vmware/tests/objects/test_datastore.py
from unittest import mock
from oslo_utils import units
from oslo_vmware import constants
from oslo_vmware.objects import datastore
from oslo_vmware.tests import base
from oslo_vmware import vim_util
import urllib.parse as urlparse

            ('dsname', ['/a/b/c/', 'x.vmdk ']),
            ('dsname', ['a/b/c/ ', 'x.vmdk'])]

        canonical_p = datastore.DatastorePath('dsname', 'a/b/c', 'x.vmdk')
        for t in args:
            p = datastore.DatastorePath(t[0], *t[1])
            self.assertNotEqual(str(canonical_p), str(p))

    def test_equal(self):
        a = datastore.DatastorePath('ds_name', 'a')
        b = datastore.DatastorePath('ds_name', 'a')
        self.assertEqual(a, b)

    def test_join(self):
        p = datastore.DatastorePath('ds_name', 'a')
        ds_path = p.join('b')
        self.assertEqual('[ds_name] a/b', str(ds_path))

        p = datastore.DatastorePath('ds_name', 'a')
        ds_path = p.join()
        bad_args = [
            [None],
            ['', None],
            ['a', None],
            ['a', None, 'b']]
        for arg in bad_args:
            self.assertRaises(ValueError, p.join, *arg)

    def test_ds_path_parse(self):
        p = datastore.DatastorePath.parse('[dsname]')

        self.assertEqual('dsname', p.datastore)