Pillow/Tests/test_locale.py

39 lines
809 B
Python
Raw Normal View History

2016-11-26 03:05:56 +03:00
from __future__ import print_function
2014-08-26 17:47:10 +04:00
from helper import unittest, PillowTestCase
2014-06-10 13:10:47 +04:00
from PIL import Image
import locale
# ref https://github.com/python-pillow/Pillow/issues/272
2014-06-10 13:10:47 +04:00
# on windows, in polish locale:
2014-06-10 13:10:47 +04:00
# import locale
# print(locale.setlocale(locale.LC_ALL, 'polish'))
2014-06-10 13:10:47 +04:00
# import string
# print(len(string.whitespace))
# print(ord(string.whitespace[6]))
2014-06-10 13:10:47 +04:00
# Polish_Poland.1250
# 7
# 160
# one of string.whitespace is not freely convertable into ascii.
path = "Tests/images/hopper.jpg"
2014-06-10 13:10:47 +04:00
class TestLocale(PillowTestCase):
def test_sanity(self):
Image.open(path)
try:
locale.setlocale(locale.LC_ALL, "polish")
2018-06-11 09:00:57 +03:00
except locale.Error:
2014-06-10 13:10:47 +04:00
unittest.skip('Polish locale not available')
Image.open(path)
if __name__ == '__main__':
unittest.main()