@@ 144-168 (lines=25) @@ | ||
141 | assert helper.isclose(metadata['latitude'], 11.1111111111), metadata['latitude'] |
|
142 | assert helper.isclose(metadata['longitude'], 99.9999999999), metadata['longitude'] |
|
143 | ||
144 | def test_set_location_minus(): |
|
145 | temporary_folder, folder = helper.create_working_folder() |
|
146 | ||
147 | origin = '%s/audio.m4a' % folder |
|
148 | shutil.copyfile(helper.get_file('audio.m4a'), origin) |
|
149 | ||
150 | audio = Audio(origin) |
|
151 | origin_metadata = audio.get_metadata() |
|
152 | ||
153 | # Verify that original audio has different location info that what we |
|
154 | # will be setting and checking |
|
155 | assert not helper.isclose(origin_metadata['latitude'], 11.111111), origin_metadata['latitude'] |
|
156 | assert not helper.isclose(origin_metadata['longitude'], 99.999999), origin_metadata['longitude'] |
|
157 | ||
158 | status = audio.set_location(-11.111111, -99.999999) |
|
159 | ||
160 | assert status == True, status |
|
161 | ||
162 | audio_new = Audio(origin) |
|
163 | metadata = audio_new.get_metadata() |
|
164 | ||
165 | shutil.rmtree(folder) |
|
166 | ||
167 | assert helper.isclose(metadata['latitude'], -11.111111), metadata['latitude'] |
|
168 | assert helper.isclose(metadata['longitude'], -99.999999), metadata['longitude'] |
|
169 | ||
170 | def test_set_title(): |
|
171 | temporary_folder, folder = helper.create_working_folder() |
@@ 269-293 (lines=25) @@ | ||
266 | assert helper.isclose(metadata['latitude'], 11.1111111111), metadata['latitude'] |
|
267 | assert helper.isclose(metadata['longitude'], 99.9999999999), metadata['longitude'] |
|
268 | ||
269 | def test_set_location_minus(): |
|
270 | temporary_folder, folder = helper.create_working_folder() |
|
271 | ||
272 | origin = '%s/photo.jpg' % folder |
|
273 | shutil.copyfile(helper.get_file('plain.jpg'), origin) |
|
274 | ||
275 | photo = Photo(origin) |
|
276 | origin_metadata = photo.get_metadata() |
|
277 | ||
278 | # Verify that original photo has different location info that what we |
|
279 | # will be setting and checking |
|
280 | assert not helper.isclose(origin_metadata['latitude'], 11.1111111111), origin_metadata['latitude'] |
|
281 | assert not helper.isclose(origin_metadata['longitude'], 99.9999999999), origin_metadata['longitude'] |
|
282 | ||
283 | status = photo.set_location(-11.1111111111, -99.9999999999) |
|
284 | ||
285 | assert status == True, status |
|
286 | ||
287 | photo_new = Photo(origin) |
|
288 | metadata = photo_new.get_metadata() |
|
289 | ||
290 | shutil.rmtree(folder) |
|
291 | ||
292 | assert helper.isclose(metadata['latitude'], -11.1111111111), metadata['latitude'] |
|
293 | assert helper.isclose(metadata['longitude'], -99.9999999999), metadata['longitude'] |
|
294 | ||
295 | def test_set_title(): |
|
296 | temporary_folder, folder = helper.create_working_folder() |