Ejemplo n.º 1
0
    def __init__(self):
        iv = InterfaceValidator(self)
        iv.expect_staticmethod("supports_multiple_processes()")
        iv.expect_method("shutdown(self, force=False)")
        iv.expect_get_property(
            "debugger_pid")  # the pid of the gdb/etc process or none
        iv.expect_get_property("status")
        iv.expect_get_property("status_changed")
        iv.expect_get_property("ptys")
        iv.expect_get_property("processes")
        iv.expect_get_property("threads")
        iv.expect_get_property("main_thread")
        iv.expect_get_property("thread_that_stopped")

        iv.expect_method("begin_launch_suspended(self, cmdline)")
        iv.expect_method("begin_attach_to_pid(self, pid, was_launched_hint)")

        iv.expect_method("kill_process(self, proc)")
        iv.expect_method("detach_process(self, proc)")

        iv.expect_method("begin_resume(self, thr)")
        iv.expect_method("begin_interrupt(self)")
        iv.expect_method("begin_step_over(self, thread)")
        iv.expect_method("begin_step_into(self, thread)")
        iv.expect_method("begin_step_out(self, thread)")

        iv.expect_method("new_breakpoint(self, location, hit_cb)")
        iv.expect_method("enable_breakpoint(self, id)")
        iv.expect_method("disable_breakpoint(self, id)")
        iv.expect_method("delete_breakpoint(self, id)")

        iv.expect_method("get_call_stack(self, thr)")
        iv.expect_method("get_frame(self, thr, frame)")

        iv.expect_method("get_expr_value_async(self, thr, expr, cb)")
Ejemplo n.º 2
0
    def test_args(self):
        e1 = Example1(1, 2)
        iv = InterfaceValidator(e1)
        self.assertRaises(Exception, iv.ensure_method("foo"))
        self.assertRaises(Exception, iv.ensure_method("foo (bar)"))
        self.assertRaises(Exception, iv.ensure_method("foo( bar)"))
        self.assertRaises(Exception, iv.ensure_method("foo(bar )"))
        self.assertRaises(Exception, iv.ensure_method("foo( bar )"))
        self.assertRaises(Exception, iv.ensure_method("foo(bar,baz)"))
        self.assertRaises(Exception, iv.ensure_method("foo(bar, baz)"))

        iv.ensure_method("foo()")  # should not raise exception
        iv.ensure_method("foo (bar)")  # should not raise exception
Ejemplo n.º 3
0
 def __init__(self):
     iv = InterfaceValidator(self)
Ejemplo n.º 4
0
 def setUp(self):
     self.iv = InterfaceValidator(Example1(1, 2), defer_validation=False)
Ejemplo n.º 5
0
 def test_constructor(self):
     iv = InterfaceValidator(Example1)
     iv.ensure_method("m1(self)")
     InterfaceValidator(Example1(1, 2))
     iv.ensure_method("m1(self)")
Ejemplo n.º 6
0
 def __init__(self):
     iv = InterfaceValidator(self)
     iv.expect_method("attach(self)")
     iv.expect_method("detach(self)")
     iv.expect_method("run_command_async(self, args, cb=None)")
     iv.expect_get_property("closed")