Exemple #1
0
 def testLoad(self):
     xeml = XmlEventManagerLoader()
     em = EventManager()
     xeml.load('resource/sample.xml', em)
     
     em.push(BanEvent())
     
     try: 
         em.push(KickEvent())
     except Exception:
         pass
     else:
         self.fail("expected an exception from ExceptionListener")
Exemple #2
0
	def testInjection(self):
		f = open('scrutator/tests/tool.fakepy', 'r')
		
		content = f.read()
		
		bus = EventManager()
		bus.bind(FileContent().getType(),FileContentListener())
		#bus.bind('all',PrintListener())
		
		
		bus.push(FileContent(filename="hello/world/nimp/__init__.py",content="print \"init\""))
		bus.push(FileContent(filename="fake/__init__.py",content="print \"init\""))
		bus.push(FileContent(filename="fake/fake.py",content=content))
		
		bus.push(DieEvent(test="hello"))
		import fake.fake