def grammartest(l, expect_error=True): if expect_error: if not subprocess.call(l): raise Exception('grammartest: expected error, but no error') else: if subprocess.call(l): raise Exception( 'grammartest: expected no error, but received an error') if __name__ == '__main__': pythoninterpreter = 'python2.7' botsinit.generalinit('config') utilsunit.dummylogger() utilsunit.cleanoutputdir() botssys = botsglobal.ini.get('directories', 'botssys') botsinit.connect() #************************************************************************************************************************************** #test references ********************************************************************************************************************** utilsunit.RunTestCompareResults( [pythoninterpreter, 'bots-engine.py', 'testreference'], { 'status': 0, 'lastreceived': 1, 'lasterror': 0, 'lastdone': 1, 'lastok': 0, 'lastopen': 0, 'send': 1, 'processerrors': 0,
else: raise Exception('expect exception in test_partner_lookup') def grammartest(l,expect_error=True): if expect_error: if not subprocess.call(l): raise Exception('grammartest: expected error, but no error') else: if subprocess.call(l): raise Exception('grammartest: expected no error, but received an error') if __name__=='__main__': pythoninterpreter = 'python2.7' botsinit.generalinit('config') utilsunit.dummylogger() utilsunit.cleanoutputdir() botssys = botsglobal.ini.get('directories','botssys') botsinit.connect() #************************************************************************************************************************************** #test references ********************************************************************************************************************** utilsunit.RunTestCompareResults([pythoninterpreter,'bots-engine.py','testreference'], {'status':0,'lastreceived':1,'lasterror':0,'lastdone':1,'lastok':0,'lastopen':0,'send':1,'processerrors':0,'filesize':262}) ta_externout = utilsunit.getlastta(EXTERNOUT) if ta_externout['botskey'] != 'BOTSKEY01': raise Exception('testreference: botskey not OK') ta_externout = utilsunit.getlastta(PARSED) if ta_externout['reference'] != 'UNBREF01': raise Exception('testreference: unb ref not OK') ta_externout = utilsunit.getlastta(SPLITUP) if ta_externout['reference'] != 'BOTSKEY01':