Code Duplication    Length = 19-20 lines in 2 locations

elodie/tests/media/photo_test.py 2 locations

@@ 324-343 (lines=20) @@
321
322
    assert metadata['title'] == 'my photo title', metadata['title']
323
324
def test_set_title_non_ascii():
325
    temporary_folder, folder = helper.create_working_folder()
326
327
    origin = '%s/photo.jpg' % folder
328
    shutil.copyfile(helper.get_file('plain.jpg'), origin)
329
330
    photo = Photo(origin)
331
    origin_metadata = photo.get_metadata()
332
333
    unicode_title = u'形声字 / 形聲字'
334
335
    status = photo.set_title(unicode_title)
336
    assert status == True, status
337
338
    photo_new = Photo(origin)
339
    metadata = photo_new.get_metadata()
340
341
    shutil.rmtree(folder)
342
343
    assert metadata['title'] == unicode_title, metadata['title']
344
345
# This is a test generator that will test reading and writing to
346
# various RAW formats. Each sample file has a different date which
@@ 304-322 (lines=19) @@
301
    assert helper.isclose(metadata['latitude'], -11.1111111111), metadata['latitude']
302
    assert helper.isclose(metadata['longitude'], -99.9999999999), metadata['longitude']
303
304
def test_set_title():
305
    temporary_folder, folder = helper.create_working_folder()
306
307
    origin = '%s/photo.jpg' % folder
308
    shutil.copyfile(helper.get_file('plain.jpg'), origin)
309
310
    photo = Photo(origin)
311
    origin_metadata = photo.get_metadata()
312
313
    status = photo.set_title('my photo title')
314
315
    assert status == True, status
316
317
    photo_new = Photo(origin)
318
    metadata = photo_new.get_metadata()
319
320
    shutil.rmtree(folder)
321
322
    assert metadata['title'] == 'my photo title', metadata['title']
323
324
def test_set_title_non_ascii():
325
    temporary_folder, folder = helper.create_working_folder()