[Checkins] SVN: GenericSetup/trunk/tests/test_events.py Add missing file

Wichert Akkerman wichert at wiggy.net
Sun Nov 4 13:49:49 EST 2007


Log message for revision 81477:
  Add missing file

Changed:
  A   GenericSetup/trunk/tests/test_events.py

-=-
Added: GenericSetup/trunk/tests/test_events.py
===================================================================
--- GenericSetup/trunk/tests/test_events.py	                        (rev 0)
+++ GenericSetup/trunk/tests/test_events.py	2007-11-04 18:49:49 UTC (rev 81477)
@@ -0,0 +1,41 @@
+import unittest
+from zope.interface.verify import verifyObject
+from Products.GenericSetup.events import BeforeProfileImportEvent
+from Products.GenericSetup.interfaces import IBeforeProfileImportEvent
+from Products.GenericSetup.events import ProfileImportedEvent
+from Products.GenericSetup.interfaces import IProfileImportedEvent
+
+class BaseEventTests(unittest.TestCase):
+    def testInterface(self):
+        event=self.klass("profile_id", "steps", "full_import")
+        verifyObject(self.iface, event)
+
+    def testNormalConstruction(self):
+        event=self.klass("profile_id", "steps", "full_import")
+        self.assertEqual(event.profile_id, "profile_id")
+        self.assertEqual(event.steps, "steps")
+        self.assertEqual(event.full_import, "full_import")
+
+    def testKeywordConstruction(self):
+        event=self.klass(profile_id="profile_id", steps="steps", full_import="full_import")
+        self.assertEqual(event.profile_id, "profile_id")
+        self.assertEqual(event.steps, "steps")
+        self.assertEqual(event.full_import, "full_import")
+
+
+class BeforeProfileImportEventTests(BaseEventTests):
+    klass = BeforeProfileImportEvent
+    iface = IBeforeProfileImportEvent
+
+
+class ProfileImportedEventTests(BaseEventTests):
+    klass = ProfileImportedEvent
+    iface = IProfileImportedEvent
+
+
+def test_suite():
+    suite = unittest.TestSuite()
+    suite.addTest(unittest.makeSuite(BeforeProfileImportEventTests))
+    suite.addTest(unittest.makeSuite(ProfileImportedEventTests))
+    return suite
+


Property changes on: GenericSetup/trunk/tests/test_events.py
___________________________________________________________________
Name: svn:eol-style
   + native



More information about the Checkins mailing list