/usr/lib/python2.7/dist-packages/dicom/test/test_dictionary.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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | # test_dictionary.py
"""Test suite for dicom_dictionary.py"""
# Copyright (c) 2008 Darcy Mason
# This file is part of pydicom, released under a modified MIT license.
# See the file license.txt included with this distribution, also
# available at http://pydicom.googlecode.com
import unittest
from dicom.tag import Tag
from dicom.datadict import CleanName, all_names_for_tag, dictionary_description
class DictTests(unittest.TestCase):
def testCleanName(self):
"""dicom_dictionary: CleanName returns correct strings............."""
self.assertTrue(CleanName(0x00100010) == "PatientsName")
self.assertTrue(CleanName(Tag((0x0010, 0x0010))) == "PatientsName")
def testTagNotFound(self):
"""dicom_dictionary: CleanName returns blank string for unknown tag"""
self.assertTrue(CleanName(0x99991111) == "")
def testNameFinding(self):
"""dicom_dictionary: get long and short names for a data_element name"""
names = all_names_for_tag(Tag(0x300a00b2)) # Treatment Machine Name
expected = ['TreatmentMachineName']
self.assertEqual(names, expected, "Expected %s, got %s" % (expected, names))
names = all_names_for_tag(Tag(0x300A0120))
expected = ['BeamLimitingDeviceAngle', 'BLDAngle']
self.assertEqual(names, expected, "Expected %s, got %s" % (expected, names))
def testRepeaters(self):
"""dicom_dictionary: Tags with "x" return correct dict info........"""
self.assertEqual(dictionary_description(0x280400), 'Transform Label')
self.assertEqual(dictionary_description(0x280410), 'Rows For Nth Order Coefficients')
class PrivateDictTests(unittest.TestCase):
def testPrivate1(self):
"""private dict: """
self.assertTrue(CleanName(0x00100010) == "PatientsName")
self.assertTrue(CleanName(Tag((0x0010, 0x0010))) == "PatientsName")
if __name__ == "__main__":
unittest.main()
|