Code Duplication    Length = 11-13 lines in 2 locations

test/test_buffer.py 1 location

@@ 102-114 (lines=13) @@
99
    assert vim.current.buffer[:] == ['alpha', 'beta']
100
101
102
def test_options(vim):
103
    assert vim.current.buffer.options['shiftwidth'] == 8
104
    vim.current.buffer.options['shiftwidth'] = 4
105
    assert vim.current.buffer.options['shiftwidth'] == 4
106
    # global-local option
107
    vim.current.buffer.options['define'] = 'test'
108
    assert vim.current.buffer.options['define'] == 'test'
109
    # Doesn't change the global value
110
    assert vim.options['define'] == r'^\s*#\s*define'
111
112
    with pytest.raises(KeyError) as excinfo:
113
        vim.current.buffer.options['doesnotexist']
114
    assert excinfo.value.args == ("Invalid option name: 'doesnotexist'",)
115
116
117
def test_number(vim):

test/test_window.py 1 location

@@ 59-69 (lines=11) @@
56
    assert vim.current.window.vars.get('python', 'default') == 'default'
57
58
59
def test_options(vim):
60
    vim.current.window.options['colorcolumn'] = '4,3'
61
    assert vim.current.window.options['colorcolumn'] == '4,3'
62
    # global-local option
63
    vim.current.window.options['statusline'] = 'window-status'
64
    assert vim.current.window.options['statusline'] == 'window-status'
65
    assert vim.options['statusline'] == ''
66
67
    with pytest.raises(KeyError) as excinfo:
68
        vim.current.window.options['doesnotexist']
69
    assert excinfo.value.args == ("Invalid option name: 'doesnotexist'",)
70
71
72
def test_position(vim):