def vTestCreated(oCtx): lCmdLine = [] # get command line arguments from oCtx.config.userdata if oCtx.config.userdata: for sKey, gVal in oCtx.config.userdata.items(): # check the argparser instance lCmdLine += ['--' + sKey, gVal] oCtx.userdata['oMain'] = OTCmd2.oMain(lCmdLine) oCtx.userdata['oMain'].onecmd('set echo True') sOut, sErr = lCheckStdoutStdErr(oCtx) assert sOut assert 'True' in sOut
def vTestCreated(oCtx): lCmdLine = [] # get command line arguments from oCtx.config.userdata if oCtx.config.userdata: for sKey, gVal in oCtx.config.userdata.items(): # check the argparser instance lCmdLine += ['--'+sKey, gVal] oCtx.userdata['oMain'] = OTCmd2.oMain(lCmdLine) oCtx.userdata['oMain'].onecmd('set echo True') sOut, sErr = lCheckStdoutStdErr(oCtx) assert sOut assert 'True' in sOut
def oMain(): sIni = os.path.join(os.path.dirname(OpenTrader.__file__), 'OTCmd2.ini') lCmdLine = ['-c', sIni] oMain = OTCmd2.oMain(lCmdLine) return oMain