# (c): Matti J. Katila import os, string, re allowedFiles = [ 'org/fenfire/demo/mm.py', 'org/fenfire/fenpdf/BUGS', ] def testAnimationIsCalledOnlyRigthPlace(): """ This test greps the source files and looks after special method call 'AbstractUpdateManager.chg()' which should be done trough the api which is added in near future. """ str = 'grep -sr AbstractUpdateManager\.chg * | grep -v \{arch\} > animation.test.log' #print str os.system(str) buf = open('animation.test.log').read() lines = string.split(buf, '\n') for i in range(len(lines)): lines[i] = string.split(lines[i], ':') #for i in lines: print i for i in range(len(lines)): if not lines[i][0] in allowedFiles: raise 'The following code: \''+ lines[i][1]+ '\' '\ 'was found from file: \''+ lines[i][0]+ '\' '\ 'an it\'s *NOT* allowed operation!' os.system('rm animation.test.log')