Ejemplo n.º 1
0
def testDefaultSuccess(klass, argDict, requirement, msg=None):
    klass.trace(requirement)   
    commandString = '-e %s -x %s -i %s' % (argDict['env'].name, argDict['external'], argDict['implantable'])
    setCommandLine(commandString)    
    resultTestContext = komodors.getTestContext()
    klass.verifyEqual(resultTestContext['pgsim'], False, msg=msg)
    klass.verifyEqual(resultTestContext['brwsr'], komodors.BROWSER_DEFAULT, msg=msg)
    from komodors import logger as komodorslogger
    klass.verifyEqual(komodorslogger.getEffectiveLevel(), 0, msg=msg) # 0 = NOTSET
Ejemplo n.º 2
0
def testSuccess(klass, argDict, requirement='default', msg=None):
    klass.trace(requirement)   
    commandString = '-e %s -x %s -i %s' % (argDict['env'].name, argDict['external'], argDict['implantable'])
    if 'pgsim' in argDict or 'brwsr' in argDict:
        commandString += ' -p '
        if 'pgsim' in argDict:
            commandString += 'pgsim=%s' % argDict['pgsim']
        if 'brwsr' in argDict:
            commandString += 'brwsr=%s' % argDict['brwsr']            
    if 'debug' in argDict:
        commandString += ' '+argDict['debug']
        
    setCommandLine(commandString)    
    resultTestContext = komodors.getTestContext()
    for arg, val in argDict.iteritems():
        if arg == 'debug': #special case: not checking a value
            from komodors import logger as komodorslogger
            klass.verifyEqual(komodorslogger.getEffectiveLevel(), 10, msg=msg) # 10 - DEBUG
            
        elif val.__class__ in (str, int, long, dict, list): # check builtin types
            klass.verifyEqual(val, resultTestContext[arg], msg=msg)
            
        else: # check KomodoRS objects
            klass.verifyEqual(type(val), type(resultTestContext[arg]), msg=msg)