예제 #1
0
def test_debug_on_stack():
    """
    Ensure the expected locals dict is passed to the view so the object
    inspector is updated properly.
    """
    editor = mock.MagicMock()
    view = mock.MagicMock()
    dm = DebugMode(editor, view)
    stack = [
        (
            1,
            {
                'locals': {
                    'a': 'frame1',
                    'b': 'frame1',
                }
            }
        ),
        (
            2,
            {
                'locals': {
                    'b': 'frame2',
                    'c': 'frame2',
                }
            }
        )
    ]
    dm.debug_on_stack(stack)
    view.update_debug_inspector.assert_called_once_with({
        'a': 'frame1',
        'b': 'frame2',
        'c': 'frame2',
    })
예제 #2
0
def test_debug_on_stack():
    """
    Ensure the expected locals dict is passed to the view so the object
    inspector is updated properly.
    """
    editor = mock.MagicMock()
    view = mock.MagicMock()
    dm = DebugMode(editor, view)
    stack = [
        (
            1,
            {
                'locals': {
                    'a': 'frame1',
                    'b': 'frame1',
                }
            }
        ),
        (
            2,
            {
                'locals': {
                    'b': 'frame2',
                    'c': 'frame2',
                }
            }
        )
    ]
    dm.debug_on_stack(stack)
    view.update_debug_inspector.assert_called_once_with({
        'a': 'frame1',
        'b': 'frame2',
        'c': 'frame2',
    })
예제 #3
0
def test_debug_on_stack():
    """
    Ensure the expected locals dict is passed to the view so the object
    inspector is updated properly.
    """
    editor = mock.MagicMock()
    view = mock.MagicMock()
    dm = DebugMode(editor, view)
    stack = [
        (1, {
            "locals": {
                "a": "frame1",
                "b": "frame1"
            }
        }),
        (2, {
            "locals": {
                "b": "frame2",
                "c": "frame2"
            }
        }),
    ]
    dm.debug_on_stack(stack)
    view.update_debug_inspector.assert_called_once_with({
        "a": "frame1",
        "b": "frame2",
        "c": "frame2"
    })
예제 #4
0
def test_debug_on_stack_no_stack():
    """
    In certain rare situations the runner could send an empty stack.

    ToDo: Look into this.
    """
    editor = mock.MagicMock()
    view = mock.MagicMock()
    dm = DebugMode(editor, view)
    dm.debug_on_stack([])
    assert view.update_debug_inspector.call_count == 0
예제 #5
0
def test_debug_on_stack_no_stack():
    """
    In certain rare situations the runner could send an empty stack.

    ToDo: Look into this.
    """
    editor = mock.MagicMock()
    view = mock.MagicMock()
    dm = DebugMode(editor, view)
    dm.debug_on_stack([])
    assert view.update_debug_inspector.call_count == 0