'Test create_folder when child not present.'

def test_create_folder_not_present(self):

    prop_val = mock.Mock()
    prop_val.ManagedObjectReference = []
    child_folder = mock.sentinel.child_folder
    session = fake.FakeSession()
    with mock.patch.object(session, '_call_method', side_effect=[prop_val, child_folder]):
        child_name = 'child_folder'
        parent_folder = mock.sentinel.parent_folder
        parent_folder.value = 'parent-ref'
        ret = vm_util.create_folder(session, parent_folder, child_name)
        self.assertEqual(child_folder, ret)
        expected_invoke_api = [mock.call(vutil, 'get_object_property', parent_folder, 'childEntity'), mock.call(session.vim, 'CreateFolder', parent_folder, name=child_name)]
        self.assertEqual(expected_invoke_api, session._call_method.mock_calls)
