# Path: OpenTrader/OTCmd2.py
# class Mt4Timeout(RuntimeError):
# class CmdLineApp(Cmd, PLogMixin):
# class TestMyAppCase(Cmd2TestCase):
#     def __init__(self, oConfig, lArgs):
#     def G(self, gVal=None):
#     def vConfigOp(self, lArgs, dConfig):
#     def eSendOnSpeaker(self, sChartId, sMsgType, sMsg):
#     def eSendMessage(self, sMsgType, sChartId, sMark, *lArgs):
#     def gWaitForMessage(self, sMsgType, sChartId, sMark, *lArgs):
#     def do_csv(self, oArgs, oOpts=None):
#     def do_chart(self, oArgs, oOpts=None):
#     def do_subscribe(self, oArgs, oOpts=None):
#     def do_publish(self, oArgs, oOpts=None):
#     def do_order(self, oArgs, oOpts=None):
#     def do_backtest(self, oArgs, oOpts=None):
#     def do_make(self, oArgs, oOpts=None):
#     def do_rabbit(self, oArgs, oOpts=None):
#     def vAtexit(self):
# def vNullifyLocalhostProxy(sHost):
# def oParseOptions():
# def oParseConfig(sConfigFile):
# def oMergeConfig(oConfig, oOptions):
# def iMain(lCmdLine):


import os
import sys
import pdb
import OpenTrader
from OpenTrader import OTCmd2
from support import tools
    sOut = ""
    if hasattr(oCtx, 'stdout_capture'):
        sOut = oCtx.stdout_capture.getvalue().strip()
        iLen = len(sOut)
        if sOut and iLen > iLEN_STDOUT:
            sOut = sOut[iLEN_STDOUT:]
            iLEN_STDOUT = iLen
            assert 'Traceback (most recent call last):' not in sOut
            assert not sOut.startswith('ERR')
            
    sErr = ""
    global iLEN_STDERR
    if hasattr(oCtx, 'stderr_capture'):
        sErr = oCtx.stderr_capture.getvalue().strip()
        iLen = len(sErr)
        if sErr and iLen > iLEN_STDERR:
            sOut = sOut[iLEN_STDERR:]
            iLEN_STDERR = iLen
            assert 'Traceback (most recent call last):' not in sErr
            assert not sErr.startswith('ERR')
    return (sOut, sErr,)

@step('Create the OTCmd2 instance')
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]

# Path: OpenTrader/OTCmd2.py
# class Mt4Timeout(RuntimeError):
# class CmdLineApp(Cmd, PLogMixin):
# class TestMyAppCase(Cmd2TestCase):
#     def __init__(self, oConfig, lArgs):
#     def G(self, gVal=None):
#     def vConfigOp(self, lArgs, dConfig):
#     def eSendOnSpeaker(self, sChartId, sMsgType, sMsg):
#     def eSendMessage(self, sMsgType, sChartId, sMark, *lArgs):
#     def gWaitForMessage(self, sMsgType, sChartId, sMark, *lArgs):
#     def do_csv(self, oArgs, oOpts=None):
#     def do_chart(self, oArgs, oOpts=None):
#     def do_subscribe(self, oArgs, oOpts=None):
#     def do_publish(self, oArgs, oOpts=None):
#     def do_order(self, oArgs, oOpts=None):
#     def do_backtest(self, oArgs, oOpts=None):
#     def do_make(self, oArgs, oOpts=None):
#     def do_rabbit(self, oArgs, oOpts=None):
#     def vAtexit(self):
# def vNullifyLocalhostProxy(sHost):
# def oParseOptions():
# def oParseConfig(sConfigFile):
# def oMergeConfig(oConfig, oOptions):
# def iMain(lCmdLine):


# Path: tests/features/steps/behave_OTCmd2.py
import os
import sys
import pdb
import OpenTrader
from OpenTrader import OTCmd2
from support import tools

    sOut = ""
    if hasattr(oCtx, 'stdout_capture'):
        sOut = oCtx.stdout_capture.getvalue().strip()
        iLen = len(sOut)
        if sOut and iLen > iLEN_STDOUT:
            sOut = sOut[iLEN_STDOUT:]
            iLEN_STDOUT = iLen
            assert 'Traceback (most recent call last):' not in sOut
            assert not sOut.startswith('ERR')
            
    sErr = ""
    global iLEN_STDERR
    if hasattr(oCtx, 'stderr_capture'):
        sErr = oCtx.stderr_capture.getvalue().strip()
        iLen = len(sErr)
        if sErr and iLen > iLEN_STDERR:
            sOut = sOut[iLEN_STDERR:]
            iLEN_STDERR = iLen
            assert 'Traceback (most recent call last):' not in sErr
            assert not sErr.startswith('ERR')
    return (sOut, sErr,)

@step('Create the OTCmd2 instance')
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)