gh-27 Add unit test for non-ascii title characters and mark as skipped
This commit is contained in:
parent
7375d392af
commit
32360fa3fa
|
@ -1,3 +1,4 @@
|
||||||
|
# -*- coding: utf-8
|
||||||
# Project imports
|
# Project imports
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
@ -153,3 +154,28 @@ def test_set_title():
|
||||||
shutil.rmtree(folder)
|
shutil.rmtree(folder)
|
||||||
|
|
||||||
assert metadata['title'] == 'my photo title', metadata['title']
|
assert metadata['title'] == 'my photo title', metadata['title']
|
||||||
|
|
||||||
|
def test_set_title_non_ascii():
|
||||||
|
raise SkipTest('gh-27, non-ascii characters')
|
||||||
|
temporary_folder, folder = helper.create_working_folder()
|
||||||
|
|
||||||
|
origin = '%s/photo.jpg' % folder
|
||||||
|
shutil.copyfile(helper.get_file('plain.jpg'), origin)
|
||||||
|
|
||||||
|
photo = Photo(origin)
|
||||||
|
origin_metadata = photo.get_metadata()
|
||||||
|
|
||||||
|
# Verify that original photo has no location information
|
||||||
|
assert origin_metadata['latitude'] is None, origin_metadata['latitude']
|
||||||
|
assert origin_metadata['longitude'] is None, origin_metadata['longitude']
|
||||||
|
|
||||||
|
status = photo.set_title('形声字 / 形聲字')
|
||||||
|
|
||||||
|
assert status == True, status
|
||||||
|
|
||||||
|
photo_new = Photo(origin)
|
||||||
|
metadata = photo_new.get_metadata()
|
||||||
|
|
||||||
|
shutil.rmtree(folder)
|
||||||
|
|
||||||
|
assert metadata['title'] == '形声字 / 形聲字', metadata['title']
|
||||||
|
|
Loading…
Reference in New Issue