Exemple #1
0
 def testLog2(self):
     self.f.write('hi there <:info "ding dong %s" `4`:>')
     self.f.close()
     logger=getUserLogger()
     logger.setLevel(logging.DEBUG)
     sio=cStringIO.StringIO()
     logger.addHandler(logging.StreamHandler(sio))
     res=C.stringcomp(self.fname)
     self.failUnless('hi there' in res)
     v=sio.getvalue()
     self.failUnless('ding dong 4' in v)
Exemple #2
0
 def testLog1(self):
     self.f.write('hi there <:debug "about to compile the borkoscape":>')
     self.f.close()
     logger=getUserLogger()
     logger.setLevel(logging.DEBUG)
     sio=cStringIO.StringIO()
     logger.addHandler(logging.StreamHandler(sio))
     res=C.stringcomp(self.fname)
     self.failUnless('hi there' in res)
     v=sio.getvalue()
     self.failUnless('borkoscape' in v)
Exemple #3
0
 def testLog3(self):
     self.f.write('hi there <:try:><:raise `ValueError`:><:except:><:exception "ding dong %s" `4`:><:/try:>')
     self.f.close()
     logger=getUserLogger()
     logger.setLevel(logging.DEBUG)
     sio=cStringIO.StringIO()
     logger.addHandler(logging.StreamHandler(sio))
     res=C.stringcomp(self.fname)
     self.failUnless('hi there' in res)
     v=sio.getvalue()
     print v
     self.failUnless('ding dong 4' in v)