Code Duplication    Length = 26-27 lines in 2 locations

elodie/tests/elodie_test.py 2 locations

@@ 385-411 (lines=27) @@
382
    assert 'Success         0' in result.output, result.output
383
    assert 'Error           0' in result.output, result.output
384
385
@mock.patch('elodie.config.config_file', '%s/config.ini-import-file-with-multiple-config-exclude' % gettempdir())
386
def test_import_file_with_multiple_config_exclude():
387
    config_string = """
388
    [Exclusions]
389
    name1=notvalidatall
390
    name2=valid
391
            """
392
    with open('%s/config.ini-import-file-with-multiple-config-exclude' % gettempdir(), 'w') as f:
393
        f.write(config_string)
394
395
    if hasattr(load_config, 'config'):
396
        del load_config.config
397
398
    temporary_folder, folder = helper.create_working_folder()
399
    temporary_folder_destination, folder_destination = helper.create_working_folder()
400
401
    origin_valid = '%s/valid.jpg' % folder
402
    shutil.copyfile(helper.get_file('plain.jpg'), origin_valid)
403
404
    runner = CliRunner()
405
    result = runner.invoke(elodie._import, ['--destination', folder_destination, '--allow-duplicates', origin_valid, '--debug'])
406
407
    if hasattr(load_config, 'config'):
408
        del load_config.config
409
410
    assert 'Success         0' in result.output, result.output
411
    assert 'Error           0' in result.output, result.output
412
413
def test_update_location_on_audio():
414
    temporary_folder, folder = helper.create_working_folder()
@@ 358-383 (lines=26) @@
355
    assert 'Success         1' in result.output, result.output
356
    assert 'Error           0' in result.output, result.output
357
358
@mock.patch('elodie.config.config_file', '%s/config.ini-import-file-with-single-config-exclude' % gettempdir())
359
def test_import_file_with_single_config_exclude():
360
    config_string = """
361
    [Exclusions]
362
    name1=valid
363
            """
364
    with open('%s/config.ini-import-file-with-single-config-exclude' % gettempdir(), 'w') as f:
365
        f.write(config_string)
366
367
    if hasattr(load_config, 'config'):
368
        del load_config.config
369
370
    temporary_folder, folder = helper.create_working_folder()
371
    temporary_folder_destination, folder_destination = helper.create_working_folder()
372
373
    origin_valid = '%s/valid.jpg' % folder
374
    shutil.copyfile(helper.get_file('plain.jpg'), origin_valid)
375
376
    runner = CliRunner()
377
    result = runner.invoke(elodie._import, ['--destination', folder_destination, '--allow-duplicates', origin_valid, '--debug'])
378
379
    if hasattr(load_config, 'config'):
380
        del load_config.config
381
382
    assert 'Success         0' in result.output, result.output
383
    assert 'Error           0' in result.output, result.output
384
385
@mock.patch('elodie.config.config_file', '%s/config.ini-import-file-with-multiple-config-exclude' % gettempdir())
386
def test_import_file_with_multiple_config_exclude():