当前位置: 首页>>代码示例>>Python>>正文


Python Monitor.onecmd方法代码示例

本文整理汇总了Python中py65.monitor.Monitor.onecmd方法的典型用法代码示例。如果您正苦于以下问题:Python Monitor.onecmd方法的具体用法?Python Monitor.onecmd怎么用?Python Monitor.onecmd使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在py65.monitor.Monitor的用法示例。


在下文中一共展示了Monitor.onecmd方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_tilde_shortcut_without_space_for_vice_compatibility

# 需要导入模块: from py65.monitor import Monitor [as 别名]
# 或者: from py65.monitor.Monitor import onecmd [as 别名]
 def test_tilde_shortcut_without_space_for_vice_compatibility(self):
     stdout = StringIO()
     mon = Monitor(stdout=stdout)
     mon.onecmd('~$10')
     out = stdout.getvalue()
     expected = "+16\n$10\n0020\n00010000\n"
     self.assertTrue(out.startswith(expected))
开发者ID:McNeight,项目名称:py65,代码行数:9,代码来源:test_monitor.py

示例2: test_tilde_shortcut_with_space

# 需要导入模块: from py65.monitor import Monitor [as 别名]
# 或者: from py65.monitor.Monitor import onecmd [as 别名]
 def test_tilde_shortcut_with_space(self):
     stdout = StringIO()
     mon = Monitor(stdout=stdout)
     mon.onecmd("~ $10")
     out = stdout.getvalue()
     expected = "+16\n$10\n0020\n00010000\n"
     self.assertTrue(out.startswith(expected))
开发者ID:biappi,项目名称:Swift6502,代码行数:9,代码来源:test_monitor.py

示例3: test_tilde_shortcut_with_space

# 需要导入模块: from py65.monitor import Monitor [as 别名]
# 或者: from py65.monitor.Monitor import onecmd [as 别名]
 def test_tilde_shortcut_with_space(self):
     stdout = StringIO()
     mon = Monitor(stdout=stdout)
     mon.onecmd('~ $10')
     out = stdout.getvalue()  
     expected = "+16\n$10\n0020\n00010000\n"
     self.assertEqual(expected, out)
开发者ID:BigEd,项目名称:py65,代码行数:9,代码来源:test_monitor.py

示例4: test_help_with_args_shows_command_help

# 需要导入模块: from py65.monitor import Monitor [as 别名]
# 或者: from py65.monitor.Monitor import onecmd [as 别名]
    def test_help_with_args_shows_command_help(self):
        stdout = StringIO()
        mon = Monitor(stdout=stdout)
        mon.onecmd('help assemble')
        out = stdout.getvalue()
        self.assertTrue("assemble <address>" in out)

        stdout.truncate(0)
        mon.onecmd('h a')
        out = stdout.getvalue()
        self.assertTrue("assemble <address>" in out)
开发者ID:McNeight,项目名称:py65,代码行数:13,代码来源:test_monitor.py

示例5: test_help_accepts_command_shortcuts

# 需要导入模块: from py65.monitor import Monitor [as 别名]
# 或者: from py65.monitor.Monitor import onecmd [as 别名]
    def test_help_accepts_command_shortcuts(self):
        stdout = StringIO()
        mon = Monitor(stdout=stdout)
        
        mon.onecmd("help assemble \t ")
        help_for_command = stdout.getvalue()

        stdout.truncate(0)
        mon.onecmd("help a \t ")
        help_for_shortcut = stdout.getvalue()

        self.assertEqual(help_for_command, help_for_shortcut)
开发者ID:BigEd,项目名称:py65,代码行数:14,代码来源:test_monitor.py

示例6: test_help_without_args_shows_documented_commands

# 需要导入模块: from py65.monitor import Monitor [as 别名]
# 或者: from py65.monitor.Monitor import onecmd [as 别名]
    def test_help_without_args_shows_documented_commands(self):
        stdout = StringIO()
        mon = Monitor(stdout=stdout)
        mon.onecmd('help')
        out = stdout.getvalue()
        self.assertTrue("Documented commands" in out)

        stdout.truncate(0)
        mon.onecmd('h')
        out = stdout.getvalue()
        self.assertTrue("Documented commands" in out)

        stdout.truncate(0)
        mon.onecmd('?')
        out = stdout.getvalue()
        self.assertTrue("Documented commands" in out)
开发者ID:McNeight,项目名称:py65,代码行数:18,代码来源:test_monitor.py

示例7: test_help_with_invalid_args_shows_error

# 需要导入模块: from py65.monitor import Monitor [as 别名]
# 或者: from py65.monitor.Monitor import onecmd [as 别名]
 def test_help_with_invalid_args_shows_error(self):
     stdout = StringIO()
     mon = Monitor(stdout=stdout)
     mon.onecmd('help foo')
     out = stdout.getvalue()
     self.assertTrue(out.startswith("*** No help on foo"))
开发者ID:McNeight,项目名称:py65,代码行数:8,代码来源:test_monitor.py

示例8: test_goto_without_args_shows_command_help

# 需要导入模块: from py65.monitor import Monitor [as 别名]
# 或者: from py65.monitor.Monitor import onecmd [as 别名]
 def test_goto_without_args_shows_command_help(self):
     stdout = StringIO()
     mon = Monitor(stdout=stdout)
     mon.onecmd('goto')
     out = stdout.getvalue()
     self.assertTrue("goto <address>" in out)
开发者ID:McNeight,项目名称:py65,代码行数:8,代码来源:test_monitor.py


注:本文中的py65.monitor.Monitor.onecmd方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。