Code Duplication    Length = 21-21 lines in 2 locations

elodie/tests/media/video_test.py 1 location

@@ 92-112 (lines=21) @@
89
90
    assert not video.is_valid()
91
92
def test_set_album():
93
    temporary_folder, folder = helper.create_working_folder()
94
95
    origin = '%s/video.mov' % folder
96
    shutil.copyfile(helper.get_file('video.mov'), origin)
97
98
    video = Video(origin)
99
    metadata = video.get_metadata()
100
101
    assert metadata['album'] is None, metadata['album']
102
103
    status = video.set_album('Test Album')
104
105
    assert status == True, status
106
107
    video_new = Video(origin)
108
    metadata_new = video_new.get_metadata()
109
110
    shutil.rmtree(folder)
111
112
    assert metadata_new['album'] == 'Test Album', metadata_new['album']
113
114
def test_set_date_taken():
115
    temporary_folder, folder = helper.create_working_folder()

elodie/tests/media/photo_test.py 1 location

@@ 186-206 (lines=21) @@
183
184
    assert photo.is_valid() == False
185
186
def test_set_album():
187
    temporary_folder, folder = helper.create_working_folder()
188
189
    origin = '%s/photo.jpg' % folder
190
    shutil.copyfile(helper.get_file('plain.jpg'), origin)
191
192
    photo = Photo(origin)
193
    metadata = photo.get_metadata()
194
195
    assert metadata['album'] is None, metadata['album']
196
197
    status = photo.set_album('Test Album')
198
199
    assert status == True, status
200
201
    photo_new = Photo(origin)
202
    metadata_new = photo_new.get_metadata()
203
204
    shutil.rmtree(folder)
205
206
    assert metadata_new['album'] == 'Test Album', metadata_new['album']
207
208
def test_set_date_taken_with_missing_datetimeoriginal():
209
    # When datetimeoriginal (or other key) is missing we have to add it gh-74