Back to index

plone3  3.1.7
Public Member Functions | Private Member Functions
GenericSetup.tests.test_content.FolderishExporterImporterTests Class Reference

List of all members.

Public Member Functions

def tearDown
def test_export_empty_site
def test_export_empty_site_with_setup_tool
def test_export_site_with_non_exportable_simple_items
def test_export_site_with_exportable_simple_items
def test_export_site_with_subfolders
def test_export_site_with_csvaware
def test_import_empty_site
def test_import_empty_site_with_setup_tool
def test_import_site_with_subfolders
def test_import_site_with_subitems
def test_import_site_with_subitems_and_blanklines_dotobjects
def test_import_site_with_subitem_unknown_portal_type
def test_import_site_with_subitems_and_no_preserve
def test_import_site_with_subitemss_and_preserve
def test_import_site_with_subitemss_and_preserve_partial
def test_import_site_with_subfolders_and_preserve

Private Member Functions

def _getExporter
def _getImporter
def _makeSetupTool
def _setUpAdapters

Detailed Description

Definition at line 133 of file test_content.py.


Member Function Documentation

Definition at line 138 of file test_content.py.

00138 
00139     def _getExporter(self):
00140         from Products.GenericSetup.content import exportSiteStructure
00141         return exportSiteStructure

Here is the caller graph for this function:

Definition at line 142 of file test_content.py.

00142 
00143     def _getImporter(self):
00144         from Products.GenericSetup.content import importSiteStructure
00145         return importSiteStructure

Here is the caller graph for this function:

Definition at line 146 of file test_content.py.

00146 
00147     def _makeSetupTool(self):
00148         from Products.GenericSetup.tool import SetupTool
00149         return SetupTool('portal_setup')

Here is the caller graph for this function:

Definition at line 150 of file test_content.py.

00150 
00151     def _setUpAdapters(self):
00152         from OFS.Folder import Folder
00153         from zope.app.testing import ztapi
00154         #from OFS.Image import File
00155 
00156         from Products.GenericSetup.interfaces import IFilesystemExporter
00157         from Products.GenericSetup.interfaces import IFilesystemImporter
00158         from Products.GenericSetup.interfaces import ICSVAware
00159         from Products.GenericSetup.interfaces import IINIAware
00160         from Products.GenericSetup.interfaces import IDAVAware
00161 
00162         from Products.GenericSetup.content import \
00163              SimpleINIAware
00164         from Products.GenericSetup.content import \
00165              FolderishExporterImporter
00166         from Products.GenericSetup.content import \
00167              CSVAwareFileAdapter
00168         from Products.GenericSetup.content import \
00169              INIAwareFileAdapter
00170         from Products.GenericSetup.content import \
00171              DAVAwareFileAdapter
00172 
00173         ztapi.provideAdapter(IObjectManager,
00174                              IFilesystemExporter,
00175                              FolderishExporterImporter,
00176                             )
00177 
00178         ztapi.provideAdapter(IObjectManager,
00179                              IFilesystemImporter,
00180                              FolderishExporterImporter,
00181                             )
00182 
00183         ztapi.provideAdapter(IPropertyManager,
00184                              IINIAware,
00185                              SimpleINIAware,
00186                             )
00187 
00188         ztapi.provideAdapter(ICSVAware,
00189                              IFilesystemExporter,
00190                              CSVAwareFileAdapter,
00191                             )
00192 
00193         ztapi.provideAdapter(ICSVAware,
00194                              IFilesystemImporter,
00195                              CSVAwareFileAdapter,
00196                             )
00197 
00198         ztapi.provideAdapter(IINIAware,
00199                              IFilesystemExporter,
00200                              INIAwareFileAdapter,
00201                             )
00202 
00203         ztapi.provideAdapter(IINIAware,
00204                              IFilesystemImporter,
00205                              INIAwareFileAdapter,
00206                             )
00207 
00208         ztapi.provideAdapter(IDAVAware,
00209                              IFilesystemExporter,
00210                              DAVAwareFileAdapter,
00211                             )
00212 
00213         ztapi.provideAdapter(IDAVAware,
00214                              IFilesystemImporter,
00215                              DAVAwareFileAdapter,
00216                             )
00217 

Here is the caller graph for this function:

Definition at line 135 of file test_content.py.

00135 
00136     def tearDown(self):
00137         cleanUp()

Here is the call graph for this function:

Definition at line 218 of file test_content.py.

00218 
00219     def test_export_empty_site(self):
00220         self._setUpAdapters()
00221         site = _makeFolder('site')
00222         site.title = 'test_export_empty_site'
00223         site.description = 'Testing export of an empty site.'
00224         context = DummyExportContext(site)
00225         exporter = self._getExporter()
00226         exporter(context)
00227 
00228         self.assertEqual(len(context._wrote), 2)
00229         filename, text, content_type = context._wrote[0]
00230         self.assertEqual(filename, 'structure/.objects')
00231         self.assertEqual(content_type, 'text/comma-separated-values')
00232 
00233         objects = [x for x in reader(StringIO(text))]
00234         self.assertEqual(len(objects), 0)
00235 
00236         filename, text, content_type = context._wrote[1]
00237         self.assertEqual(filename, 'structure/.properties')
00238         self.assertEqual(content_type, 'text/plain')
00239 
00240         parser = ConfigParser()
00241         parser.readfp(StringIO(text))
00242 
00243         defaults = parser.defaults()
00244         self.assertEqual(len(defaults), 1)
00245         self.assertEqual(defaults['title'], site.title)

Here is the call graph for this function:

Definition at line 246 of file test_content.py.

00246 
00247     def test_export_empty_site_with_setup_tool(self):
00248         self._setUpAdapters()
00249         site = _makeFolder('site')
00250         site._setObject('setup_tool', self._makeSetupTool())
00251         site._updateProperty('title', 'test_export_empty_site_with_setup_tool')
00252         site._setProperty('description',
00253                           'Testing export of an empty site with setup tool.')
00254         context = DummyExportContext(site)
00255         exporter = self._getExporter()
00256         exporter(context)
00257 
00258         self.assertEqual(len(context._wrote), 2)
00259         filename, text, content_type = context._wrote[0]
00260         self.assertEqual(filename, 'structure/.objects')
00261         self.assertEqual(content_type, 'text/comma-separated-values')
00262 
00263         objects = [x for x in reader(StringIO(text))]
00264         self.assertEqual(len(objects), 0)
00265 
00266         filename, text, content_type = context._wrote[1]
00267         self.assertEqual(filename, 'structure/.properties')
00268         self.assertEqual(content_type, 'text/plain')
00269 
00270         parser = ConfigParser()
00271         parser.readfp(StringIO(text))
00272 
00273         defaults = parser.defaults()
00274         self.assertEqual(len(defaults), 2)
00275         self.assertEqual(defaults['title'], site.title)
00276         self.assertEqual(defaults['description'], site.description)

Here is the call graph for this function:

Definition at line 423 of file test_content.py.

00423 
00424     def test_export_site_with_csvaware(self):
00425         from Products.GenericSetup.utils import _getDottedName
00426         self._setUpAdapters()
00427 
00428         site = _makeFolder('site')
00429         site.title = 'test_export_site_with_csvaware'
00430         site._setProperty('description',
00431                           'Testing export of an site with CSV-aware content.')
00432 
00433         aware = _makeCSVAware('aware')
00434         site._setObject('aware', aware)
00435 
00436         context = DummyExportContext(site)
00437         exporter = self._getExporter()
00438         exporter(context)
00439 
00440         self.assertEqual(len(context._wrote), 3)
00441         filename, text, content_type = context._wrote[0]
00442         self.assertEqual(filename, 'structure/.objects')
00443         self.assertEqual(content_type, 'text/comma-separated-values')
00444 
00445         objects = [x for x in reader(StringIO(text))]
00446         self.assertEqual(len(objects), 1)
00447         self.assertEqual(objects[0][0], 'aware')
00448         self.assertEqual(objects[0][1], _getDottedName(aware.__class__))
00449 
00450         filename, text, content_type = context._wrote[1]
00451         self.assertEqual(filename, 'structure/.properties')
00452         self.assertEqual(content_type, 'text/plain')
00453 
00454         parser = ConfigParser()
00455         parser.readfp(StringIO(text))
00456 
00457         defaults = parser.defaults()
00458         self.assertEqual(len(defaults), 2)
00459         self.assertEqual(defaults['title'], site.title)
00460         self.assertEqual(defaults['description'], site.description)
00461 
00462         filename, text, content_type = context._wrote[2]
00463         self.assertEqual(filename, 'structure/aware.csv')
00464         self.assertEqual(content_type, 'text/comma-separated-values')
00465         rows = [x for x in reader(StringIO(text))]
00466         self.assertEqual(len(rows), 2)
00467         self.assertEqual(rows[0][0], 'one')
00468         self.assertEqual(rows[0][1], 'two')
00469         self.assertEqual(rows[0][2], 'three')
00470         self.assertEqual(rows[1][0], 'four')
00471         self.assertEqual(rows[1][1], 'five')
00472         self.assertEqual(rows[1][2], 'six')

Here is the call graph for this function:

Definition at line 316 of file test_content.py.

00316 
00317     def test_export_site_with_exportable_simple_items(self):
00318         from Products.GenericSetup.utils import _getDottedName
00319         self._setUpAdapters()
00320         ITEM_IDS = ('foo', 'bar', 'baz')
00321 
00322         site = _makeFolder('site')
00323         site.title = 'AAA'
00324         site._setProperty('description', 'CCC')
00325         aware = _makeINIAware('aside')
00326         dotted = _getDottedName(aware.__class__)
00327         for id in ITEM_IDS:
00328             site._setObject(id, _makeINIAware(id))
00329 
00330         context = DummyExportContext(site)
00331         exporter = self._getExporter()
00332         exporter(context)
00333 
00334         self.assertEqual(len(context._wrote), 2 + len(ITEM_IDS))
00335         filename, text, content_type = context._wrote[0]
00336         self.assertEqual(filename, 'structure/.objects')
00337         self.assertEqual(content_type, 'text/comma-separated-values')
00338 
00339         objects = [x for x in reader(StringIO(text))]
00340         self.assertEqual(len(objects), 3)
00341         for index in range(len(ITEM_IDS)):
00342             self.assertEqual(objects[index][0], ITEM_IDS[index])
00343             self.assertEqual(objects[index][1], dotted)
00344 
00345             filename, text, content_type = context._wrote[index+2]
00346             self.assertEqual(filename, 'structure/%s.ini' % ITEM_IDS[index])
00347             object = site._getOb(ITEM_IDS[index])
00348             self.assertEqual(text.strip(),
00349                              object.as_ini().strip())
00350             self.assertEqual(content_type, 'text/plain')
00351 
00352         filename, text, content_type = context._wrote[1]
00353         self.assertEqual(filename, 'structure/.properties')
00354         self.assertEqual(content_type, 'text/plain')
00355         parser = ConfigParser()
00356         parser.readfp(StringIO(text))
00357 
00358         defaults = parser.defaults()
00359         self.assertEqual(len(defaults), 2)
00360         self.assertEqual(defaults['title'], 'AAA')
00361         self.assertEqual(defaults['description'], 'CCC')

Here is the call graph for this function:

Definition at line 277 of file test_content.py.

00277 
00278     def test_export_site_with_non_exportable_simple_items(self):
00279         from Products.GenericSetup.utils import _getDottedName
00280         self._setUpAdapters()
00281         ITEM_IDS = ('foo', 'bar', 'baz')
00282 
00283         site = _makeFolder('site')
00284         site.title = 'AAA'
00285         site._setProperty('description', 'CCC')
00286         item = _makeItem('aside')
00287         dotted = _getDottedName(item.__class__)
00288         for id in ITEM_IDS:
00289             site._setObject(id, _makeItem(id))
00290 
00291         context = DummyExportContext(site)
00292         exporter = self._getExporter()
00293         exporter(context)
00294 
00295         self.assertEqual(len(context._wrote), 2)
00296         filename, text, content_type = context._wrote[0]
00297         self.assertEqual(filename, 'structure/.objects')
00298         self.assertEqual(content_type, 'text/comma-separated-values')
00299 
00300         objects = [x for x in reader(StringIO(text))]
00301         self.assertEqual(len(objects), 3)
00302         for index in range(len(ITEM_IDS)):
00303             self.assertEqual(objects[index][0], ITEM_IDS[index])
00304             self.assertEqual(objects[index][1], dotted)
00305 
00306         filename, text, content_type = context._wrote[1]
00307         self.assertEqual(filename, 'structure/.properties')
00308         self.assertEqual(content_type, 'text/plain')
00309         parser = ConfigParser()
00310         parser.readfp(StringIO(text))
00311 
00312         defaults = parser.defaults()
00313         self.assertEqual(len(defaults), 2)
00314         self.assertEqual(defaults['title'], 'AAA')
00315         self.assertEqual(defaults['description'], 'CCC')

Here is the call graph for this function:

Definition at line 362 of file test_content.py.

00362 
00363     def test_export_site_with_subfolders(self):
00364         from Products.GenericSetup.utils import _getDottedName
00365         self._setUpAdapters()
00366         FOLDER_IDS = ('foo', 'bar', 'baz')
00367 
00368         site = _makeFolder('site')
00369         site.title = 'AAA'
00370         site._setProperty('description', 'CCC')
00371         aside = _makeFolder('aside')
00372         dotted = _getDottedName(aside.__class__)
00373         for id in FOLDER_IDS:
00374             folder = _makeFolder(id)
00375             folder.title = 'Title: %s' % id
00376             site._setObject(id, folder)
00377 
00378         context = DummyExportContext(site)
00379         exporter = self._getExporter()
00380         exporter(context)
00381 
00382         self.assertEqual(len(context._wrote), 2 + (2 *len(FOLDER_IDS)))
00383         filename, text, content_type = context._wrote[0]
00384         self.assertEqual(filename, 'structure/.objects')
00385         self.assertEqual(content_type, 'text/comma-separated-values')
00386 
00387         objects = [x for x in reader(StringIO(text))]
00388         self.assertEqual(len(objects), 3)
00389 
00390         for index in range(len(FOLDER_IDS)):
00391             id = FOLDER_IDS[index]
00392             self.assertEqual(objects[index][0], id)
00393             self.assertEqual(objects[index][1], dotted)
00394 
00395             filename, text, content_type = context._wrote[2 + (2 * index)]
00396             self.assertEqual(filename, '/'.join(('structure', id, '.objects')))
00397             self.assertEqual(content_type, 'text/comma-separated-values')
00398             subobjects = [x for x in reader(StringIO(text))]
00399             self.assertEqual(len(subobjects), 0)
00400 
00401             filename, text, content_type = context._wrote[2 + (2 * index) + 1]
00402             self.assertEqual(filename,
00403                              '/'.join(('structure', id, '.properties')))
00404             self.assertEqual(content_type, 'text/plain')
00405             parser = ConfigParser()
00406             parser.readfp(StringIO(text))
00407 
00408             defaults = parser.defaults()
00409             self.assertEqual(len(defaults), 1)
00410             self.assertEqual(defaults['title'], 'Title: %s' % id)
00411 
00412         filename, text, content_type = context._wrote[1]
00413         self.assertEqual(filename, 'structure/.properties')
00414         self.assertEqual(content_type, 'text/plain')
00415 
00416         parser = ConfigParser()
00417         parser.readfp(StringIO(text))
00418 
00419         defaults = parser.defaults()
00420         self.assertEqual(len(defaults), 2)
00421         self.assertEqual(defaults['title'], 'AAA')
00422         self.assertEqual(defaults['description'], 'CCC')

Here is the call graph for this function:

Definition at line 473 of file test_content.py.

00473 
00474     def test_import_empty_site(self):
00475         self._setUpAdapters()
00476         site = _makeFolder('site')
00477         context = DummyImportContext(site)
00478         context._files['structure/.objects'] = ''
00479         importer = self._getImporter()
00480         self.assertEqual(len(site.objectIds()), 0)
00481         importer(context)
00482         self.assertEqual(len(site.objectIds()), 0)

Here is the call graph for this function:

Definition at line 483 of file test_content.py.

00483 
00484     def test_import_empty_site_with_setup_tool(self):
00485         self._setUpAdapters()
00486         site = _makeFolder('site')
00487         site._setObject('setup_tool', self._makeSetupTool())
00488         context = DummyImportContext(site)
00489         importer = self._getImporter()
00490 
00491         self.assertEqual(len(site.objectIds()), 1)
00492         self.assertEqual(site.objectIds()[0], 'setup_tool')
00493         importer(context)
00494         self.assertEqual(len(site.objectIds()), 1)
00495         self.assertEqual(site.objectIds()[0], 'setup_tool')

Here is the call graph for this function:

Definition at line 496 of file test_content.py.

00496 
00497     def test_import_site_with_subfolders(self):
00498         from Products.GenericSetup.utils import _getDottedName
00499         self._setUpAdapters()
00500         FOLDER_IDS = ('foo', 'bar', 'baz')
00501 
00502         site = _makeFolder('site')
00503         dotted = _getDottedName(site.__class__)
00504 
00505         context = DummyImportContext(site)
00506 
00507         for id in FOLDER_IDS:
00508             context._files['structure/%s/.objects' % id] = ''
00509             context._files['structure/%s/.properties' % id] = (
00510                 _PROPERTIES_TEMPLATE % id )
00511 
00512         _ROOT_OBJECTS = '\n'.join(['%s,%s' % (id, dotted)
00513                                         for id in FOLDER_IDS])
00514 
00515         context._files['structure/.objects'] = _ROOT_OBJECTS
00516         context._files['structure/.properties'] = (
00517                 _PROPERTIES_TEMPLATE % 'Test Site')
00518 
00519         importer = self._getImporter()
00520         importer(context)
00521 
00522         content = site.objectValues()
00523         self.assertEqual(len(content), len(FOLDER_IDS))

Here is the call graph for this function:

Definition at line 668 of file test_content.py.

00668 
00669     def test_import_site_with_subfolders_and_preserve(self):
00670         from Products.GenericSetup.utils import _getDottedName
00671         self._setUpAdapters()
00672 
00673         site = _makeFolder('site')
00674         site._setObject('foo', _makeFolder('foo'))
00675         foo = site._getOb('foo')
00676         foo._setObject('bar', _makeFolder('bar'))
00677         bar = foo._getOb('bar')
00678 
00679         context = DummyImportContext(site)
00680         # We want to add 'baz' to 'foo', without losing 'bar'
00681         context._files['structure/.objects'
00682                       ] = 'foo,%s' % _getDottedName(foo.__class__)
00683         context._files['structure/.preserve'] = '*'
00684         context._files['structure/foo/.objects'
00685                       ] = 'baz,%s' % _getDottedName(bar.__class__)
00686         context._files['structure/foo/.preserve'] = '*'
00687         context._files['structure/foo/baz/.objects'] = ''
00688 
00689         importer = self._getImporter()
00690         importer(context)
00691 
00692         self.assertEqual(len(site.objectIds()), 1)
00693         self.assertEqual(site.objectIds()[0], 'foo')
00694 
00695         self.assertEqual(len(foo.objectIds()), 2, site.foo.objectIds())
00696         self.assertEqual(foo.objectIds()[0], 'bar')
00697         self.assertEqual(foo.objectIds()[1], 'baz')
00698 

Here is the call graph for this function:

Definition at line 581 of file test_content.py.

00581 
00582     def test_import_site_with_subitem_unknown_portal_type(self):
00583         from faux_objects import KNOWN_INI
00584         self._setUpAdapters()
00585         ITEM_IDS = ('foo', 'bar', 'baz')
00586 
00587         site = _makeFolder('site')
00588 
00589         context = DummyImportContext(site)
00590         # We want to add 'baz' to 'foo', without losing 'bar'
00591         context._files['structure/.objects'] = '\n'.join(
00592                                 ['%s,Unknown Type' % x for x in ITEM_IDS])
00593         for index in range(len(ITEM_IDS)):
00594             id = ITEM_IDS[index]
00595             context._files[
00596                     'structure/%s.ini' % id] = KNOWN_INI % ('Title: %s' % id,
00597                                                             'xyzzy',
00598                                                            )
00599 
00600         importer = self._getImporter()
00601         importer(context)
00602 
00603         after = site.objectIds()
00604         self.assertEqual(len(after), 0)
00605         self.assertEqual(len(context._notes), len(ITEM_IDS))
00606         for level, component, message in context._notes:
00607             self.assertEqual(component, 'SFWA')
00608             self.failUnless(message.startswith("Couldn't make"))

Here is the call graph for this function:

Definition at line 524 of file test_content.py.

00524 
00525     def test_import_site_with_subitems(self):
00526         from Products.GenericSetup.utils import _getDottedName
00527         from faux_objects import KNOWN_INI
00528         from faux_objects import TestINIAware
00529         dotted = _getDottedName(TestINIAware)
00530         self._setUpAdapters()
00531         ITEM_IDS = ('foo', 'bar', 'baz')
00532 
00533         site = _makeFolder('site')
00534 
00535         context = DummyImportContext(site)
00536         # We want to add 'baz' to 'foo', without losing 'bar'
00537         context._files['structure/.objects'] = '\n'.join(
00538                             ['%s,%s' % (x, dotted) for x in ITEM_IDS])
00539         for index in range(len(ITEM_IDS)):
00540             id = ITEM_IDS[index]
00541             context._files[
00542                     'structure/%s.ini' % id] = KNOWN_INI % ('Title: %s' % id,
00543                                                             'xyzzy',
00544                                                            )
00545         importer = self._getImporter()
00546         importer(context)
00547 
00548         after = site.objectIds()
00549         self.assertEqual(len(after), len(ITEM_IDS))
00550         for found_id, expected_id in zip(after, ITEM_IDS):
00551             self.assertEqual(found_id, expected_id)

Here is the call graph for this function:

Definition at line 552 of file test_content.py.

00552 
00553     def test_import_site_with_subitems_and_blanklines_dotobjects(self):
00554         from Products.GenericSetup.utils import _getDottedName
00555         from faux_objects import KNOWN_INI
00556         from faux_objects import TestINIAware
00557         dotted = _getDottedName(TestINIAware)
00558         self._setUpAdapters()
00559         ITEM_IDS = ('foo', 'bar', 'baz')
00560 
00561         site = _makeFolder('site')
00562 
00563         context = DummyImportContext(site)
00564         # We want to add 'baz' to 'foo', without losing 'bar'
00565         correct = '\n'.join(['%s,%s' % (x, dotted) for x in ITEM_IDS])
00566         broken = correct + '\n\n'
00567         context._files['structure/.objects'] = broken
00568         for index in range(len(ITEM_IDS)):
00569             id = ITEM_IDS[index]
00570             context._files[
00571                     'structure/%s.ini' % id] = KNOWN_INI % ('Title: %s' % id,
00572                                                             'xyzzy',
00573                                                            )
00574         importer = self._getImporter()
00575         importer(context)
00576 
00577         after = site.objectIds()
00578         self.assertEqual(len(after), len(ITEM_IDS))
00579         for found_id, expected_id in zip(after, ITEM_IDS):
00580             self.assertEqual(found_id, expected_id)

Here is the call graph for this function:

Definition at line 609 of file test_content.py.

00609 
00610     def test_import_site_with_subitems_and_no_preserve(self):
00611         self._setUpAdapters()
00612         ITEM_IDS = ('foo', 'bar', 'baz')
00613 
00614         site = _makeFolder('site')
00615         for id in ITEM_IDS:
00616             site._setObject(id, _makeItem(id))
00617 
00618         context = DummyImportContext(site)
00619         # We want to add 'baz' to 'foo', without losing 'bar'
00620         context._files['structure/.objects'] = ''
00621 
00622         importer = self._getImporter()
00623         importer(context)
00624 
00625         self.assertEqual(len(site.objectIds()), 0)

Here is the call graph for this function:

Definition at line 626 of file test_content.py.

00626 
00627     def test_import_site_with_subitemss_and_preserve(self):
00628         self._setUpAdapters()
00629         ITEM_IDS = ('foo', 'bar', 'baz')
00630 
00631         site = _makeFolder('site')
00632         for id in ITEM_IDS:
00633             site._setObject(id, _makeItem(id))
00634 
00635         context = DummyImportContext(site)
00636         # We want to add 'baz' to 'foo', without losing 'bar'
00637         context._files['structure/.objects'] = ''
00638         context._files['structure/.preserve'] = '*'
00639 
00640         importer = self._getImporter()
00641         importer(context)
00642 
00643         after = site.objectIds()
00644         self.assertEqual(len(after), len(ITEM_IDS))
00645         for i in range(len(ITEM_IDS)):
00646             self.assertEqual(after[i], ITEM_IDS[i])

Here is the call graph for this function:

Definition at line 647 of file test_content.py.

00647 
00648     def test_import_site_with_subitemss_and_preserve_partial(self):
00649         self._setUpAdapters()
00650         ITEM_IDS = ('foo', 'bar', 'baz')
00651 
00652         site = _makeFolder('site')
00653         for id in ITEM_IDS:
00654             site._setObject(id, _makeItem(id))
00655 
00656         context = DummyImportContext(site)
00657         # We want to add 'baz' to 'foo', without losing 'bar'
00658         context._files['structure/.objects'] = ''
00659         context._files['structure/.preserve'] = 'b*'
00660 
00661         importer = self._getImporter()
00662         importer(context)
00663 
00664         after = site.objectIds()
00665         self.assertEqual(len(after), 2)
00666         self.assertEqual(after[0], 'bar')
00667         self.assertEqual(after[1], 'baz')

Here is the call graph for this function:


The documentation for this class was generated from the following file: