[Checkins] SVN: Products.GenericSetup/branches/1.4/Products/GenericSetup/tests/test_tool.py Added a test for tool.listProfileInfo for_ parameter

Vincent Fretin vincent.fretin at gmail.com
Sun May 24 17:05:58 EDT 2009


Log message for revision 100351:
  Added a test for tool.listProfileInfo for_ parameter

Changed:
  U   Products.GenericSetup/branches/1.4/Products/GenericSetup/tests/test_tool.py

-=-
Modified: Products.GenericSetup/branches/1.4/Products/GenericSetup/tests/test_tool.py
===================================================================
--- Products.GenericSetup/branches/1.4/Products/GenericSetup/tests/test_tool.py	2009-05-24 20:44:58 UTC (rev 100350)
+++ Products.GenericSetup/branches/1.4/Products/GenericSetup/tests/test_tool.py	2009-05-24 21:05:58 UTC (rev 100351)
@@ -1013,8 +1013,26 @@
         self.failUnless(u'toolset' in result)
         self.failUnless(list(result).index(u'componentregistry') >
                         list(result).index(u'toolset'))
+    
+    def test_listProfileInfo_for_parameter(self):
+        from Products.GenericSetup.metadata import METADATA_XML
+        from Products.GenericSetup.tests.test_registry import ISite, IDerivedSite, IAnotherSite
 
+        self._makeFile(METADATA_XML, _METADATA_XML)
 
+        site = self._makeSite()
+        tool = self._makeOne('setup_tool').__of__( site )
+
+        profile_registry.registerProfile('foo', 'Foo', '', self._PROFILE_PATH,
+                                        for_=ISite)
+        # tool.listProfileInfo should call registry.listProfileInfo
+        # with the for_ parameter
+        self.assertEqual(len(tool.listProfileInfo()), 1)
+        self.assertEqual(len(tool.listProfileInfo(for_=ISite)), 1)
+        self.assertEqual(len(tool.listProfileInfo(for_=IDerivedSite)), 1)
+        self.assertEqual(len(tool.listProfileInfo(for_=IAnotherSite)), 0)
+
+
 _DEFAULT_STEP_REGISTRIES_EXPORT_XML = """\
 <?xml version="1.0"?>
 <export-steps>



More information about the Checkins mailing list