Code Duplication    Length = 9-10 lines in 2 locations

tests/test_charts_builder.py 2 locations

@@ 216-225 (lines=10) @@
213
    readfunc = read(override=dict(view))
214
    monkeypatch.setattr(charts_builder.adapter, 'read', readfunc)
215
    res = test.get(
216
        url_for('jsondash.view', c_id='123'),
217
        follow_redirects=True)
218
    assert 'Invalid configuration - missing modules.' in res.data
219
220
221
def test_get_view_valid_modules_count_and_inputs(monkeypatch, ctx, client):
222
    app, test = client
223
    monkeypatch.setattr(charts_builder, 'auth', auth_ok)
224
    view = get_json_config('inputs.json')
225
    readfunc = read(override=dict(view))
226
    monkeypatch.setattr(charts_builder.adapter, 'read', readfunc)
227
    res = test.get(url_for('jsondash.view', c_id=view['id']))
228
    dom = pq(res.data)
@@ 228-236 (lines=9) @@
225
    readfunc = read(override=dict(view))
226
    monkeypatch.setattr(charts_builder.adapter, 'read', readfunc)
227
    res = test.get(url_for('jsondash.view', c_id=view['id']))
228
    dom = pq(res.data)
229
    assert len(dom.find('.item')) == len(view['modules'])
230
    assert len(dom.find('.charts-input-icon')) == 1
231
232
233
def test_get_view_valid_modules_valid_dash_title(monkeypatch, ctx, client):
234
    app, test = client
235
    monkeypatch.setattr(charts_builder, 'auth', auth_ok)
236
    view = get_json_config('inputs.json')
237
    readfunc = read(override=dict(view))
238
    monkeypatch.setattr(charts_builder.adapter, 'read', readfunc)
239
    res = test.get(url_for('jsondash.view', c_id=view['id']))