Commits

Boris FELD  committed 031e86c

Add first unittest

  • Participants
  • Parent commits ad6c914

Comments (0)

Files changed (5)

File lib/core/EventDispatcher.py

         if name in self.events.keys():
             return False
         self.events[name] = []
+
+    def declaredEvents(self):
+        return self.events.keys()

File test/__init__.py

+__author__="lothiraldan"
+__date__ ="$1 juil. 2010 19:52:00$"

File test/lib/__init__.py

+__author__="lothiraldan"
+__date__ ="$1 juil. 2010 19:52:09$"

File test/lib/core/EventDispatcherTest.py

+import sys
+import os.path
+sys.path.append(os.path.realpath('../../..'))
+
+from lib.core.EventDispatcher import EventDispatcher
+import unittest
+
+class EventDispatcherTest(unittest.TestCase):
+
+    def setUp(self):
+        self.eventDispatcher = EventDispatcher()
+
+    def tearDown(self):
+        self.eventDispatcher = None
+
+    def testEventDeclaration(self):
+        eventName = 'eventTest'
+        
+        self.eventDispatcher.declare(eventName)
+        assert eventName in self.eventDispatcher.declaredEvents()
+
+unittest.main()

File test/lib/core/__init__.py

+__author__="lothiraldan"
+__date__ ="$1 juil. 2010 19:52:15$"