/usr/lib/python2.7/dist-packages/dicom/test/test_unicode.py is in python-dicom 0.9.9-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | # test_unicode.py
# -*- coding: utf-8 -*-
import dicom
import sys
import unittest
class UnicodeFilenames(unittest.TestCase):
def testRead(self):
"""Unicode: Can read a file with unicode characters in name................"""
uni_name = u'test°'
# verify first that we could encode file name in this environment
try:
_ = uni_name.encode(sys.getfilesystemencoding())
except UnicodeEncodeError:
print("SKIP: Environment doesn't support unicode filenames")
return
try:
dicom.read_file(uni_name)
except UnicodeEncodeError:
self.fail("UnicodeEncodeError generated for unicode name")
# ignore file doesn't exist error
except IOError:
pass
if __name__ == "__main__":
unittest.main()
|