Merge pull request #106 from hartsock/issues/104

Demonstrates proper use of Managed Entity parent attribute
This commit is contained in:
Shawn Hartsock
2014-08-12 18:10:46 -04:00
2 changed files with 329 additions and 0 deletions

294
tests/fixtures/root_folder_parent.yaml vendored Normal file
View File

@@ -0,0 +1,294 @@
interactions:
- request:
body: null
headers:
Accept: ['*/*']
Accept-Encoding: ['gzip, deflate']
User-Agent: [python-requests/2.3.0 CPython/3.4.1 Darwin/13.3.0]
method: GET
uri: https://vcsa:443//sdk/vimServiceVersions.xml
response:
body: {string: "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<!--\n Copyright
2008-2012 VMware, Inc. All rights reserved.\n-->\n<namespaces version=\"1.0\">\n
\ <namespace>\n <name>urn:vim25</name>\n <version>5.5</version>\n <priorVersions>\n
\ <version>5.1</version>\n <version>5.0</version>\n <version>4.1</version>\n
\ <version>4.0</version>\n <version>2.5u2</version>\n <version>2.5</version>\n
\ </priorVersions>\n </namespace>\n <namespace>\n <name>urn:vim2</name>\n
\ <version>2.0</version>\n </namespace>\n</namespaces>\n"}
headers:
Connection: [Keep-Alive]
Content-Length: ['530']
Content-Type: [text/xml]
Date: ['Tue, 12 Aug 2014 19:57:19 GMT']
status: {code: 200, message: OK}
- request:
body: '<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soapenv:Body><RetrieveServiceContent xmlns="urn:vim25"><_this type="ServiceInstance">ServiceInstance</_this></RetrieveServiceContent></soapenv:Body>
</soapenv:Envelope>'
headers:
Accept-Encoding: ['gzip, deflate']
Content-Type: [text/xml; charset=UTF-8]
Cookie: ['']
SOAPAction: ['"urn:vim25/5.5"']
method: POST
uri: https://vcsa:443/sdk
response:
body: {string: "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<soapenv:Envelope
xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\"\n xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\"\n
xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"\n xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n<soapenv:Body>\n<RetrieveServiceContentResponse
xmlns=\"urn:vim25\"><returnval><rootFolder type=\"Folder\">group-d1</rootFolder><propertyCollector
type=\"PropertyCollector\">propertyCollector</propertyCollector><viewManager
type=\"ViewManager\">ViewManager</viewManager><about><name>VMware vCenter
Server</name><fullName>VMware vCenter Server 5.5.0 build-1750787 (Sim)</fullName><vendor>VMware,
Inc.</vendor><version>5.5.0</version><build>1750787 (Sim)</build><localeVersion>INTL</localeVersion><localeBuild>000</localeBuild><osType>linux-x64</osType><productLineId>vpx</productLineId><apiType>VirtualCenter</apiType><apiVersion>5.5</apiVersion><instanceUuid>0CEDF86B-B8A6-484F-9601-F9C5E4F83F45</instanceUuid><licenseProductName>VMware
VirtualCenter Server</licenseProductName><licenseProductVersion>5.0</licenseProductVersion></about><setting
type=\"OptionManager\">VpxSettings</setting><userDirectory type=\"UserDirectory\">UserDirectory</userDirectory><sessionManager
type=\"SessionManager\">SessionManager</sessionManager><authorizationManager
type=\"AuthorizationManager\">AuthorizationManager</authorizationManager><serviceManager
type=\"ServiceManager\">ServiceMgr</serviceManager><perfManager type=\"PerformanceManager\">PerfMgr</perfManager><scheduledTaskManager
type=\"ScheduledTaskManager\">ScheduledTaskManager</scheduledTaskManager><alarmManager
type=\"AlarmManager\">AlarmManager</alarmManager><eventManager type=\"EventManager\">EventManager</eventManager><taskManager
type=\"TaskManager\">TaskManager</taskManager><extensionManager type=\"ExtensionManager\">ExtensionManager</extensionManager><customizationSpecManager
type=\"CustomizationSpecManager\">CustomizationSpecManager</customizationSpecManager><customFieldsManager
type=\"CustomFieldsManager\">CustomFieldsManager</customFieldsManager><diagnosticManager
type=\"DiagnosticManager\">DiagMgr</diagnosticManager><licenseManager type=\"LicenseManager\">LicenseManager</licenseManager><searchIndex
type=\"SearchIndex\">SearchIndex</searchIndex><fileManager type=\"FileManager\">FileManager</fileManager><datastoreNamespaceManager
type=\"DatastoreNamespaceManager\">DatastoreNamespaceManager</datastoreNamespaceManager><virtualDiskManager
type=\"VirtualDiskManager\">virtualDiskManager</virtualDiskManager><snmpSystem
type=\"HostSnmpSystem\">SnmpSystem</snmpSystem><vmProvisioningChecker type=\"VirtualMachineProvisioningChecker\">ProvChecker</vmProvisioningChecker><vmCompatibilityChecker
type=\"VirtualMachineCompatibilityChecker\">CompatChecker</vmCompatibilityChecker><ovfManager
type=\"OvfManager\">OvfManager</ovfManager><ipPoolManager type=\"IpPoolManager\">IpPoolManager</ipPoolManager><dvSwitchManager
type=\"DistributedVirtualSwitchManager\">DVSManager</dvSwitchManager><hostProfileManager
type=\"HostProfileManager\">HostProfileManager</hostProfileManager><clusterProfileManager
type=\"ClusterProfileManager\">ClusterProfileManager</clusterProfileManager><complianceManager
type=\"ProfileComplianceManager\">MoComplianceManager</complianceManager><localizationManager
type=\"LocalizationManager\">LocalizationManager</localizationManager><storageResourceManager
type=\"StorageResourceManager\">StorageResourceManager</storageResourceManager><guestOperationsManager
type=\"GuestOperationsManager\">guestOperationsManager</guestOperationsManager></returnval></RetrieveServiceContentResponse>\n</soapenv:Body>\n</soapenv:Envelope>"}
headers:
Cache-Control: [no-cache]
Connection: [Keep-Alive]
Content-Length: ['3611']
Content-Type: [text/xml; charset=utf-8]
Date: ['Tue, 12 Aug 2014 19:57:19 GMT']
Set-Cookie: ['vmware_soap_session="52f9d648-9738-fa0d-722c-989a2a6848ee"; Path=/;
HttpOnly; Secure; ']
status: {code: 200, message: OK}
- request:
body: '<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soapenv:Body><Login xmlns="urn:vim25"><_this type="SessionManager">SessionManager</_this><userName>my_user</userName><password>my_password</password></Login></soapenv:Body>
</soapenv:Envelope>'
headers:
Accept-Encoding: ['gzip, deflate']
Content-Type: [text/xml; charset=UTF-8]
Cookie: ['vmware_soap_session="52f9d648-9738-fa0d-722c-989a2a6848ee"; Path=/;
HttpOnly; Secure; ']
SOAPAction: ['"urn:vim25/5.5"']
method: POST
uri: https://vcsa:443/sdk
response:
body: {string: "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<soapenv:Envelope
xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\"\n xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\"\n
xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"\n xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n<soapenv:Body>\n<LoginResponse
xmlns=\"urn:vim25\"><returnval><key>52b2e74c-889a-50fa-021d-0ca429bc0730</key><userName>my_user</userName><fullName>my_user
</fullName><loginTime>2014-08-12T19:57:19.158827Z</loginTime><lastActiveTime>2014-08-12T19:57:19.158827Z</lastActiveTime><locale>en</locale><messageLocale>en</messageLocale><extensionSession>false</extensionSession><ipAddress>172.16.16.1</ipAddress><userAgent></userAgent><callCount>0</callCount></returnval></LoginResponse>\n</soapenv:Body>\n</soapenv:Envelope>"}
headers:
Cache-Control: [no-cache]
Connection: [Keep-Alive]
Content-Length: ['788']
Content-Type: [text/xml; charset=utf-8]
Date: ['Tue, 12 Aug 2014 19:57:19 GMT']
status: {code: 200, message: OK}
- request:
body: '<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soapenv:Body><RetrieveServiceContent xmlns="urn:vim25"><_this type="ServiceInstance">ServiceInstance</_this></RetrieveServiceContent></soapenv:Body>
</soapenv:Envelope>'
headers:
Accept-Encoding: ['gzip, deflate']
Content-Type: [text/xml; charset=UTF-8]
Cookie: ['vmware_soap_session="52f9d648-9738-fa0d-722c-989a2a6848ee"; Path=/;
HttpOnly; Secure; ']
SOAPAction: ['"urn:vim25/5.5"']
method: POST
uri: https://vcsa:443/sdk
response:
body: {string: "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<soapenv:Envelope
xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\"\n xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\"\n
xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"\n xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n<soapenv:Body>\n<RetrieveServiceContentResponse
xmlns=\"urn:vim25\"><returnval><rootFolder type=\"Folder\">group-d1</rootFolder><propertyCollector
type=\"PropertyCollector\">propertyCollector</propertyCollector><viewManager
type=\"ViewManager\">ViewManager</viewManager><about><name>VMware vCenter
Server</name><fullName>VMware vCenter Server 5.5.0 build-1750787 (Sim)</fullName><vendor>VMware,
Inc.</vendor><version>5.5.0</version><build>1750787 (Sim)</build><localeVersion>INTL</localeVersion><localeBuild>000</localeBuild><osType>linux-x64</osType><productLineId>vpx</productLineId><apiType>VirtualCenter</apiType><apiVersion>5.5</apiVersion><instanceUuid>0CEDF86B-B8A6-484F-9601-F9C5E4F83F45</instanceUuid><licenseProductName>VMware
VirtualCenter Server</licenseProductName><licenseProductVersion>5.0</licenseProductVersion></about><setting
type=\"OptionManager\">VpxSettings</setting><userDirectory type=\"UserDirectory\">UserDirectory</userDirectory><sessionManager
type=\"SessionManager\">SessionManager</sessionManager><authorizationManager
type=\"AuthorizationManager\">AuthorizationManager</authorizationManager><serviceManager
type=\"ServiceManager\">ServiceMgr</serviceManager><perfManager type=\"PerformanceManager\">PerfMgr</perfManager><scheduledTaskManager
type=\"ScheduledTaskManager\">ScheduledTaskManager</scheduledTaskManager><alarmManager
type=\"AlarmManager\">AlarmManager</alarmManager><eventManager type=\"EventManager\">EventManager</eventManager><taskManager
type=\"TaskManager\">TaskManager</taskManager><extensionManager type=\"ExtensionManager\">ExtensionManager</extensionManager><customizationSpecManager
type=\"CustomizationSpecManager\">CustomizationSpecManager</customizationSpecManager><customFieldsManager
type=\"CustomFieldsManager\">CustomFieldsManager</customFieldsManager><diagnosticManager
type=\"DiagnosticManager\">DiagMgr</diagnosticManager><licenseManager type=\"LicenseManager\">LicenseManager</licenseManager><searchIndex
type=\"SearchIndex\">SearchIndex</searchIndex><fileManager type=\"FileManager\">FileManager</fileManager><datastoreNamespaceManager
type=\"DatastoreNamespaceManager\">DatastoreNamespaceManager</datastoreNamespaceManager><virtualDiskManager
type=\"VirtualDiskManager\">virtualDiskManager</virtualDiskManager><snmpSystem
type=\"HostSnmpSystem\">SnmpSystem</snmpSystem><vmProvisioningChecker type=\"VirtualMachineProvisioningChecker\">ProvChecker</vmProvisioningChecker><vmCompatibilityChecker
type=\"VirtualMachineCompatibilityChecker\">CompatChecker</vmCompatibilityChecker><ovfManager
type=\"OvfManager\">OvfManager</ovfManager><ipPoolManager type=\"IpPoolManager\">IpPoolManager</ipPoolManager><dvSwitchManager
type=\"DistributedVirtualSwitchManager\">DVSManager</dvSwitchManager><hostProfileManager
type=\"HostProfileManager\">HostProfileManager</hostProfileManager><clusterProfileManager
type=\"ClusterProfileManager\">ClusterProfileManager</clusterProfileManager><complianceManager
type=\"ProfileComplianceManager\">MoComplianceManager</complianceManager><localizationManager
type=\"LocalizationManager\">LocalizationManager</localizationManager><storageResourceManager
type=\"StorageResourceManager\">StorageResourceManager</storageResourceManager><guestOperationsManager
type=\"GuestOperationsManager\">guestOperationsManager</guestOperationsManager></returnval></RetrieveServiceContentResponse>\n</soapenv:Body>\n</soapenv:Envelope>"}
headers:
Cache-Control: [no-cache]
Connection: [Keep-Alive]
Content-Length: ['3611']
Content-Type: [text/xml; charset=utf-8]
Date: ['Tue, 12 Aug 2014 19:57:19 GMT']
status: {code: 200, message: OK}
- request:
body: '<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soapenv:Body><RetrievePropertiesEx xmlns="urn:vim25"><_this type="PropertyCollector">propertyCollector</_this><specSet><propSet><type>ServiceInstance</type><all>false</all><pathSet>content</pathSet></propSet><objectSet><obj
type="ServiceInstance">ServiceInstance</obj><skip>false</skip></objectSet></specSet><options><maxObjects>1</maxObjects></options></RetrievePropertiesEx></soapenv:Body>
</soapenv:Envelope>'
headers:
Accept-Encoding: ['gzip, deflate']
Content-Type: [text/xml; charset=UTF-8]
Cookie: ['vmware_soap_session="52f9d648-9738-fa0d-722c-989a2a6848ee"; Path=/;
HttpOnly; Secure; ']
SOAPAction: ['"urn:vim25/5.5"']
method: POST
uri: https://vcsa:443/sdk
response:
body: {string: "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<soapenv:Envelope
xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\"\n xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\"\n
xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"\n xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n<soapenv:Body>\n<RetrievePropertiesExResponse
xmlns=\"urn:vim25\"><returnval><objects><obj type=\"ServiceInstance\">ServiceInstance</obj><propSet><name>content</name><val
xsi:type=\"ServiceContent\"><rootFolder type=\"Folder\">group-d1</rootFolder><propertyCollector
type=\"PropertyCollector\">propertyCollector</propertyCollector><viewManager
type=\"ViewManager\">ViewManager</viewManager><about><name>VMware vCenter
Server</name><fullName>VMware vCenter Server 5.5.0 build-1750787 (Sim)</fullName><vendor>VMware,
Inc.</vendor><version>5.5.0</version><build>1750787 (Sim)</build><localeVersion>INTL</localeVersion><localeBuild>000</localeBuild><osType>linux-x64</osType><productLineId>vpx</productLineId><apiType>VirtualCenter</apiType><apiVersion>5.5</apiVersion><instanceUuid>0CEDF86B-B8A6-484F-9601-F9C5E4F83F45</instanceUuid><licenseProductName>VMware
VirtualCenter Server</licenseProductName><licenseProductVersion>5.0</licenseProductVersion></about><setting
type=\"OptionManager\">VpxSettings</setting><userDirectory type=\"UserDirectory\">UserDirectory</userDirectory><sessionManager
type=\"SessionManager\">SessionManager</sessionManager><authorizationManager
type=\"AuthorizationManager\">AuthorizationManager</authorizationManager><serviceManager
type=\"ServiceManager\">ServiceMgr</serviceManager><perfManager type=\"PerformanceManager\">PerfMgr</perfManager><scheduledTaskManager
type=\"ScheduledTaskManager\">ScheduledTaskManager</scheduledTaskManager><alarmManager
type=\"AlarmManager\">AlarmManager</alarmManager><eventManager type=\"EventManager\">EventManager</eventManager><taskManager
type=\"TaskManager\">TaskManager</taskManager><extensionManager type=\"ExtensionManager\">ExtensionManager</extensionManager><customizationSpecManager
type=\"CustomizationSpecManager\">CustomizationSpecManager</customizationSpecManager><customFieldsManager
type=\"CustomFieldsManager\">CustomFieldsManager</customFieldsManager><diagnosticManager
type=\"DiagnosticManager\">DiagMgr</diagnosticManager><licenseManager type=\"LicenseManager\">LicenseManager</licenseManager><searchIndex
type=\"SearchIndex\">SearchIndex</searchIndex><fileManager type=\"FileManager\">FileManager</fileManager><datastoreNamespaceManager
type=\"DatastoreNamespaceManager\">DatastoreNamespaceManager</datastoreNamespaceManager><virtualDiskManager
type=\"VirtualDiskManager\">virtualDiskManager</virtualDiskManager><snmpSystem
type=\"HostSnmpSystem\">SnmpSystem</snmpSystem><vmProvisioningChecker type=\"VirtualMachineProvisioningChecker\">ProvChecker</vmProvisioningChecker><vmCompatibilityChecker
type=\"VirtualMachineCompatibilityChecker\">CompatChecker</vmCompatibilityChecker><ovfManager
type=\"OvfManager\">OvfManager</ovfManager><ipPoolManager type=\"IpPoolManager\">IpPoolManager</ipPoolManager><dvSwitchManager
type=\"DistributedVirtualSwitchManager\">DVSManager</dvSwitchManager><hostProfileManager
type=\"HostProfileManager\">HostProfileManager</hostProfileManager><clusterProfileManager
type=\"ClusterProfileManager\">ClusterProfileManager</clusterProfileManager><complianceManager
type=\"ProfileComplianceManager\">MoComplianceManager</complianceManager><localizationManager
type=\"LocalizationManager\">LocalizationManager</localizationManager><storageResourceManager
type=\"StorageResourceManager\">StorageResourceManager</storageResourceManager><guestOperationsManager
type=\"GuestOperationsManager\">guestOperationsManager</guestOperationsManager></val></propSet></objects></returnval></RetrievePropertiesExResponse>\n</soapenv:Body>\n</soapenv:Envelope>"}
headers:
Cache-Control: [no-cache]
Connection: [Keep-Alive]
Content-Length: ['3751']
Content-Type: [text/xml; charset=utf-8]
Date: ['Tue, 12 Aug 2014 19:57:19 GMT']
status: {code: 200, message: OK}
- request:
body: '<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soapenv:Body><RetrievePropertiesEx xmlns="urn:vim25"><_this type="PropertyCollector">propertyCollector</_this><specSet><propSet><type>Folder</type><all>false</all><pathSet>parent</pathSet></propSet><objectSet><obj
type="Folder">group-d1</obj><skip>false</skip></objectSet></specSet><options><maxObjects>1</maxObjects></options></RetrievePropertiesEx></soapenv:Body>
</soapenv:Envelope>'
headers:
Accept-Encoding: ['gzip, deflate']
Content-Type: [text/xml; charset=UTF-8]
Cookie: ['vmware_soap_session="52f9d648-9738-fa0d-722c-989a2a6848ee"; Path=/;
HttpOnly; Secure; ']
SOAPAction: ['"urn:vim25/5.5"']
method: POST
uri: https://vcsa:443/sdk
response:
body: {string: "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<soapenv:Envelope
xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\"\n xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\"\n
xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"\n xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n<soapenv:Body>\n<RetrievePropertiesExResponse
xmlns=\"urn:vim25\"><returnval><objects><obj type=\"Folder\">group-d1</obj></objects></returnval></RetrievePropertiesExResponse>\n</soapenv:Body>\n</soapenv:Envelope>"}
headers:
Cache-Control: [no-cache]
Connection: [Keep-Alive]
Content-Length: ['481']
Content-Type: [text/xml; charset=utf-8]
Date: ['Tue, 12 Aug 2014 19:57:19 GMT']
status: {code: 200, message: OK}
- request:
body: '<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soapenv:Body><RetrievePropertiesEx xmlns="urn:vim25"><_this type="PropertyCollector">propertyCollector</_this><specSet><propSet><type>Folder</type><all>false</all><pathSet>parent</pathSet></propSet><objectSet><obj
type="Folder">group-d1</obj><skip>false</skip></objectSet></specSet><options><maxObjects>1</maxObjects></options></RetrievePropertiesEx></soapenv:Body>
</soapenv:Envelope>'
headers:
Accept-Encoding: ['gzip, deflate']
Content-Type: [text/xml; charset=UTF-8]
Cookie: ['vmware_soap_session="52f9d648-9738-fa0d-722c-989a2a6848ee"; Path=/;
HttpOnly; Secure; ']
SOAPAction: ['"urn:vim25/5.5"']
method: POST
uri: https://vcsa:443/sdk
response:
body: {string: "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<soapenv:Envelope
xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\"\n xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\"\n
xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"\n xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n<soapenv:Body>\n<RetrievePropertiesExResponse
xmlns=\"urn:vim25\"><returnval><objects><obj type=\"Folder\">group-d1</obj></objects></returnval></RetrievePropertiesExResponse>\n</soapenv:Body>\n</soapenv:Envelope>"}
headers:
Cache-Control: [no-cache]
Connection: [Keep-Alive]
Content-Length: ['481']
Content-Type: [text/xml; charset=utf-8]
Date: ['Tue, 12 Aug 2014 19:57:19 GMT']
status: {code: 200, message: OK}
version: 1

View File

@@ -0,0 +1,35 @@
# VMware vSphere Python SDK
# Copyright (c) 2008-2014 VMware, Inc. All Rights Reserved.
#
# 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.
from __future__ import print_function
from tests import fixtures_path
import unittest
import vcr
from pyVim import connect
class ManagedObjectTests(unittest.TestCase):
@vcr.use_cassette('root_folder_parent.yaml',
cassette_library_dir=fixtures_path, record_mode='once')
def test_root_folder_parent(self):
# see: http://python3porting.com/noconv.html
si = connect.SmartConnect(host='vcsa',
user='my_user',
pwd='my_password')
root_folder = si.content.rootFolder
self.assertTrue(hasattr(root_folder, 'parent'))
# NOTE (hartsock): assertIsNone does not work in Python 2.6
self.assertTrue(root_folder.parent is None)