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


Python monitor.Monitor类代码示例

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


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

示例1: test_do_assemble_outputs_disassembly

    def test_do_assemble_outputs_disassembly(self):
        stdout = StringIO()
        mon = Monitor(stdout=stdout)
        mon.do_assemble('c000 lda #$ab')

        out = stdout.getvalue()
        self.assertEqual("$c000  a9 ab     LDA #$ab\n", out)
开发者ID:McNeight,项目名称:py65,代码行数:7,代码来源:test_monitor.py

示例2: test_do_add_label_syntax_error

 def test_do_add_label_syntax_error(self):
     stdout = StringIO()
     mon = Monitor(stdout=stdout)
     mon.do_add_label('should be label space value')
     out = stdout.getvalue()
     err = "Syntax error: should be label space value\n"
     self.assertTrue(out.startswith(err))
开发者ID:McNeight,项目名称:py65,代码行数:7,代码来源:test_monitor.py

示例3: test_tilde_shortcut_without_space_for_vice_compatibility

 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,代码行数:7,代码来源:test_monitor.py

示例4: test_shortcut_for_registers

    def test_shortcut_for_registers(self):
        stdout = StringIO()
        mon = Monitor(stdout=stdout)
        mon.do_help('r')

        out = stdout.getvalue()
        self.assertTrue(out.startswith('registers'))
开发者ID:McNeight,项目名称:py65,代码行数:7,代码来源:test_monitor.py

示例5: test_registers_updates_single_register

 def test_registers_updates_single_register(self):
     stdout = StringIO()
     mon = Monitor(stdout=stdout)
     mon.do_registers('x=42')
     out = stdout.getvalue()
     self.assertEqual("", out)
     self.assertEqual(0x42, mon._mpu.x)
开发者ID:McNeight,项目名称:py65,代码行数:7,代码来源:test_monitor.py

示例6: test_shortcut_for_mem

    def test_shortcut_for_mem(self):
        stdout = StringIO()
        mon = Monitor(stdout=stdout)
        mon.do_help('m')

        out = stdout.getvalue()
        self.assertTrue(out.startswith('mem <address_range>'))
开发者ID:McNeight,项目名称:py65,代码行数:7,代码来源:test_monitor.py

示例7: test_do_add_breakpoint_adds_number

 def test_do_add_breakpoint_adds_number(self):
     stdout = StringIO()
     mon = Monitor(stdout=stdout)
     mon.do_add_breakpoint('ffd2')
     out = stdout.getvalue()
     self.assertTrue(out.startswith("Breakpoint 0 added at $FFD2"))
     self.assertTrue(0xffd2 in mon._breakpoints)
开发者ID:McNeight,项目名称:py65,代码行数:7,代码来源:test_monitor.py

示例8: test_help_assemble

    def test_help_assemble(self):
        stdout = StringIO()
        mon = Monitor(stdout=stdout)
        mon.help_assemble()

        out = stdout.getvalue()
        self.assertTrue("assemble <address>" in out)
开发者ID:McNeight,项目名称:py65,代码行数:7,代码来源:test_monitor.py

示例9: test_help_cd

    def test_help_cd(self):
        stdout = StringIO()
        mon = Monitor(stdout=stdout)
        mon.help_cd()

        out = stdout.getvalue()
        self.assertTrue(out.startswith("cd <directory>"))
开发者ID:McNeight,项目名称:py65,代码行数:7,代码来源:test_monitor.py

示例10: test_do_assemble_passes_addr_for_relative_branch_calc

    def test_do_assemble_passes_addr_for_relative_branch_calc(self):
        stdout = StringIO()
        mon = Monitor(stdout=stdout)
        mon.do_assemble('4000 bvs $4005')

        out = stdout.getvalue()
        self.assertEqual("$4000  70 03     BVS $4005\n", out)
开发者ID:McNeight,项目名称:py65,代码行数:7,代码来源:test_monitor.py

示例11: test_do_assemble_constrains_address_to_valid_range

    def test_do_assemble_constrains_address_to_valid_range(self):
        stdout = StringIO()
        mon = Monitor(stdout=stdout)
        mon.do_assemble("-1 lda #$ab")

        out = stdout.getvalue()
        self.assertEqual("Overflow error: -1 lda #$ab\n", out)
开发者ID:McNeight,项目名称:py65,代码行数:7,代码来源:test_monitor.py

示例12: test_do_assemble_shows_overflow_error

    def test_do_assemble_shows_overflow_error(self):
        stdout = StringIO()
        mon = Monitor(stdout=stdout)
        mon.do_assemble('c000 lda #$fff')

        out = stdout.getvalue()
        self.assertEqual("Overflow error: c000 lda #$fff\n", out)
开发者ID:McNeight,项目名称:py65,代码行数:7,代码来源:test_monitor.py

示例13: test_do_assemble_shows_bad_syntax_error

    def test_do_assemble_shows_bad_syntax_error(self):
        stdout = StringIO()
        mon = Monitor(stdout=stdout)
        mon.do_assemble('c000 foo')

        out = stdout.getvalue()
        self.assertEqual("Syntax error: foo\n", out)
开发者ID:McNeight,项目名称:py65,代码行数:7,代码来源:test_monitor.py

示例14: test_do_assemble_shows_bad_label_error

    def test_do_assemble_shows_bad_label_error(self):
        stdout = StringIO()
        mon = Monitor(stdout=stdout)
        mon.do_assemble('nonexistant rts')

        out = stdout.getvalue()
        self.assertEqual("Bad label: nonexistant rts\n", out)
开发者ID:McNeight,项目名称:py65,代码行数:7,代码来源:test_monitor.py

示例15: test_goto_without_breakpoints_stops_execution_at_brk

 def test_goto_without_breakpoints_stops_execution_at_brk(self):
     stdout = StringIO()
     mon = Monitor(stdout=stdout)
     mon._breakpoints = []
     mon._mpu.memory = [ 0xEA, 0xEA, 0x00, 0xEA ]
     mon.do_goto('0')
     self.assertEqual(0x02, mon._mpu.pc)
开发者ID:McNeight,项目名称:py65,代码行数:7,代码来源:test_monitor.py


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