gh-27 Enable non-ascii tests for audio and video
This commit is contained in:
parent
cb52210077
commit
1bc13675da
|
@ -9,8 +9,6 @@ import tempfile
|
||||||
import time
|
import time
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
from nose.plugins.skip import SkipTest
|
|
||||||
|
|
||||||
sys.path.insert(0, os.path.abspath(os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.realpath(__file__)))))))
|
sys.path.insert(0, os.path.abspath(os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.realpath(__file__)))))))
|
||||||
sys.path.insert(0, os.path.abspath(os.path.dirname(os.path.dirname(os.path.realpath(__file__)))))
|
sys.path.insert(0, os.path.abspath(os.path.dirname(os.path.dirname(os.path.realpath(__file__)))))
|
||||||
|
|
||||||
|
@ -165,7 +163,6 @@ def test_set_title():
|
||||||
assert metadata['title'] == 'my audio title', metadata['title']
|
assert metadata['title'] == 'my audio title', metadata['title']
|
||||||
|
|
||||||
def test_set_title_non_ascii():
|
def test_set_title_non_ascii():
|
||||||
raise SkipTest('gh-27, non-ascii characters')
|
|
||||||
temporary_folder, folder = helper.create_working_folder()
|
temporary_folder, folder = helper.create_working_folder()
|
||||||
|
|
||||||
origin = '%s/audio.m4a' % folder
|
origin = '%s/audio.m4a' % folder
|
||||||
|
@ -174,7 +171,8 @@ def test_set_title_non_ascii():
|
||||||
audio = Audio(origin)
|
audio = Audio(origin)
|
||||||
origin_metadata = audio.get_metadata()
|
origin_metadata = audio.get_metadata()
|
||||||
|
|
||||||
status = audio.set_title('形声字 / 形聲字')
|
unicode_title = u'形声字 / 形聲字'
|
||||||
|
status = audio.set_title(unicode_title)
|
||||||
|
|
||||||
assert status == True, status
|
assert status == True, status
|
||||||
|
|
||||||
|
@ -183,4 +181,4 @@ def test_set_title_non_ascii():
|
||||||
|
|
||||||
shutil.rmtree(folder)
|
shutil.rmtree(folder)
|
||||||
|
|
||||||
assert metadata['title'] == '形声字 / 形聲字', metadata['title']
|
assert metadata['title'] == unicode_title, metadata['title']
|
||||||
|
|
|
@ -8,8 +8,6 @@ import tempfile
|
||||||
import time
|
import time
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
from nose.plugins.skip import SkipTest
|
|
||||||
|
|
||||||
sys.path.insert(0, os.path.abspath(os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.realpath(__file__)))))))
|
sys.path.insert(0, os.path.abspath(os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.realpath(__file__)))))))
|
||||||
sys.path.insert(0, os.path.abspath(os.path.dirname(os.path.dirname(os.path.realpath(__file__)))))
|
sys.path.insert(0, os.path.abspath(os.path.dirname(os.path.dirname(os.path.realpath(__file__)))))
|
||||||
|
|
||||||
|
@ -167,7 +165,6 @@ def test_set_title():
|
||||||
assert metadata['title'] == 'my video title', metadata['title']
|
assert metadata['title'] == 'my video title', metadata['title']
|
||||||
|
|
||||||
def test_set_title_non_ascii():
|
def test_set_title_non_ascii():
|
||||||
raise SkipTest('gh-27, non-ascii characters')
|
|
||||||
temporary_folder, folder = helper.create_working_folder()
|
temporary_folder, folder = helper.create_working_folder()
|
||||||
|
|
||||||
origin = '%s/video.mov' % folder
|
origin = '%s/video.mov' % folder
|
||||||
|
@ -176,7 +173,8 @@ def test_set_title_non_ascii():
|
||||||
video = Video(origin)
|
video = Video(origin)
|
||||||
origin_metadata = video.get_metadata()
|
origin_metadata = video.get_metadata()
|
||||||
|
|
||||||
status = video.set_title('形声字 / 形聲字')
|
unicode_title = u'形声字 / 形聲字'
|
||||||
|
status = video.set_title(unicode_title)
|
||||||
|
|
||||||
assert status == True, status
|
assert status == True, status
|
||||||
|
|
||||||
|
@ -185,4 +183,4 @@ def test_set_title_non_ascii():
|
||||||
|
|
||||||
shutil.rmtree(folder)
|
shutil.rmtree(folder)
|
||||||
|
|
||||||
assert metadata['title'] == '形声字 / 形聲字', metadata['title']
|
assert metadata['title'] == unicode_title, metadata['title']
|
||||||
|
|
Loading…
Reference in New Issue