Exemple #1
0
    def _test_no_options(self, args, m_stdout, m_stderr, m_PythonLoggingObserver, m_basicConfig, m_FileType):

        opts = clargs.parse_args(args)

        self.checkCalls(m_stdout)
        self.checkCalls(m_stderr)

        self.checkCalls(
            m_basicConfig,
            call(stream=sys.stdout,
                 format=clargs.LogFormat,
                 datefmt=clargs.LogDateFormat,
                 level=logging.INFO))

        self.checkCalls(
            m_PythonLoggingObserver,
            call(),
            call().start())

        if len(args) == 0:
            args = ['-']

        self.assertEqual(len(args), 1)

        [path] = args

        self.assertIs(opts.SOURCE, m_FileType.return_value.return_value)
Exemple #2
0
def main(args = sys.argv[1:]):
    opts = clargs.parse_args(args)
    sim = simulator.Simulator()
    scr = script.Script.load(opts.SOURCE)
    scr.execute(sim)