def _try_config_test(self, logcfg, epattern, foundTest=None ):
import ossie.utils.log4py.config
with stdout_redirect(cStringIO.StringIO()) as new_stdout:
ossie.utils.log4py.config.strConfig(logcfg,None)
new_stdout.seek(0)
found = []
epats=[]
if type(epattern) == str:
epats.append(epattern)
else:
epats = epattern
if foundTest == None:
foundTest = len(epats)*[True]
for x in new_stdout.readlines():
for epat in epats:
m=re.search( epat, x )
if m :
found.append( True )
self.assertEqual(found, foundTest )
评论列表
文章目录