Пример #1
0
class Test_Log_LineNumber(Test_Log_Base):
    def setUp(self):
        self.log = Log()
        self.log.config = OrderedDict([('linenum',5)]) 
        self.log.cacheflag=True
        self.log.startlog()
    
    def test_(self):
        def myfunc(arg1,arg2):
            self.log.log(PRIORITY.SUCCESS,msg="this is a test")            
        myfunc('foo','bar')
        
        # not testing for a specific line number as it will be too brittle a test
        self.assertTrue(isint(self.log.cache[0][0]))
Пример #2
0
class Test_Log_Names(Test_Log_Base):
    def setUp(self):        
        self.log = Log()
        self.log.pidlogname=True
        self.log.proclogname=True  
        self.log.startlog()
        #super(Test_Log_Names,self).setUp()
  
        
        @logger(self.log)
        def func1(*args,**kwargs):
            return(100)
        
        self.func1  = func1
        
    def test_(self):
        
        logname = os.path.basename(self.log.logname).split(".")
        self.assertEquals(logname[3],'test_misc_utils_log')