本文整理汇总了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))
示例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))
示例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)
示例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)
示例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)
示例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)
示例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"))
示例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)