コード例 #1
0
def test_tracer_uninstall(fakesys):
    """
    Tracer's install method will uninstall itself as well.
    """
    t = Tracer()
    t.install()
    t.uninstall()
    assert fakesys.tracer is None
コード例 #2
0
def test_tracer_uninstall(fakesys):
    """
    Tracer's install method will uninstall itself as well.
    """
    t = Tracer()
    t.install()
    t.uninstall()
    assert fakesys.tracer is None
コード例 #3
0
def test_tracer_uninstall_with_other_hook_previously_installed(fakesys):
    """
    If another profile hook was installed before the Tracer was installed, then
    the profile hook will be restored to that profile hook.
    """
    t = Tracer()
    fakesys.tracer = sentinel = object()
    t.install()
    t.uninstall()
    assert fakesys.tracer is sentinel
コード例 #4
0
def test_tracer_uninstall_with_other_hook(fakesys):
    """
    If another profile hook was installed after the Tracer was installed, then
    the profile hook will remain unchanged.
    """
    t = Tracer()
    t.install()
    fakesys.tracer = sentinel = object()
    t.uninstall()
    assert fakesys.tracer is sentinel
コード例 #5
0
def test_tracer_uninstall_with_other_hook_previously_installed(fakesys):
    """
    If another profile hook was installed before the Tracer was installed, then
    the profile hook will be restored to that profile hook.
    """
    t = Tracer()
    fakesys.tracer = sentinel = object()
    t.install()
    t.uninstall()
    assert fakesys.tracer is sentinel
コード例 #6
0
def test_tracer_uninstall_with_other_hook(fakesys):
    """
    If another profile hook was installed after the Tracer was installed, then
    the profile hook will remain unchanged.
    """
    t = Tracer()
    t.install()
    fakesys.tracer = sentinel = object()
    t.uninstall()
    assert fakesys.tracer is sentinel