Back to index

plone3  3.1.7
Public Member Functions | Static Public Attributes
CMFCore.exportimport.tests.test_typeinfo.exportTypesToolTests Class Reference
Inheritance diagram for CMFCore.exportimport.tests.test_typeinfo.exportTypesToolTests:
Inheritance graph
[legend]
Collaboration diagram for CMFCore.exportimport.tests.test_typeinfo.exportTypesToolTests:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def test_empty
def test_normal
def test_with_filenames

Static Public Attributes

 layer = ExportImportZCMLLayer

Detailed Description

Definition at line 336 of file test_typeinfo.py.


Member Function Documentation

Definition at line 340 of file test_typeinfo.py.

00340 
00341     def test_empty(self):
00342         from Products.CMFCore.exportimport.typeinfo import exportTypesTool
00343 
00344         site = self._initSite()
00345         context = DummyExportContext(site)
00346         exportTypesTool(context)
00347 
00348         self.assertEqual(len(context._wrote), 1)
00349         filename, text, content_type = context._wrote[0]
00350         self.assertEqual(filename, 'types.xml')
00351         self._compareDOM(text, _EMPTY_TOOL_EXPORT)
00352         self.assertEqual(content_type, 'text/xml')

Here is the call graph for this function:

Definition at line 353 of file test_typeinfo.py.

00353 
00354     def test_normal(self):
00355         from Products.CMFCore.exportimport.typeinfo import exportTypesTool
00356 
00357         site = self._initSite(1)
00358         context = DummyExportContext(site)
00359         exportTypesTool(context)
00360 
00361         self.assertEqual(len(context._wrote), 3)
00362         filename, text, content_type = context._wrote[0]
00363         self.assertEqual(filename, 'types.xml')
00364         self._compareDOM(text, _NORMAL_TOOL_EXPORT)
00365         self.assertEqual(content_type, 'text/xml')
00366 
00367         filename, text, content_type = context._wrote[2]
00368         self.assertEqual(filename, 'types/bar.xml')
00369         self._compareDOM(text, _BAR_EXPORT % 'bar')
00370         self.assertEqual(content_type, 'text/xml')
00371 
00372         filename, text, content_type = context._wrote[1]
00373         self.assertEqual(filename, 'types/foo.xml')
00374         self._compareDOM(text, _FOO_EXPORT % 'foo')
00375         self.assertEqual(content_type, 'text/xml')

Here is the call graph for this function:

Definition at line 376 of file test_typeinfo.py.

00376 
00377     def test_with_filenames(self):
00378         from Products.CMFCore.exportimport.typeinfo import exportTypesTool
00379 
00380         site = self._initSite(2)
00381         context = DummyExportContext(site)
00382         exportTypesTool(context)
00383 
00384         self.assertEqual(len(context._wrote), 3)
00385         filename, text, content_type = context._wrote[0]
00386         self.assertEqual(filename, 'types.xml')
00387         self._compareDOM(text, _FILENAME_EXPORT)
00388         self.assertEqual(content_type, 'text/xml')
00389         filename, text, content_type = context._wrote[2]
00390         self.assertEqual(filename, 'types/bar_object.xml')
00391         self._compareDOM(text, _BAR_EXPORT % 'bar object')
00392         self.assertEqual(content_type, 'text/xml')
00393         filename, text, content_type = context._wrote[1]
00394         self.assertEqual(filename, 'types/foo_object.xml')
00395         self._compareDOM(text, _FOO_EXPORT % 'foo object')
00396         self.assertEqual(content_type, 'text/xml')
00397 

Here is the call graph for this function:


Member Data Documentation

Definition at line 338 of file test_typeinfo.py.


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