示例#1
0
    def test_add_private_transfer_syntax(self):
        """Test adding private transfer syntaxes"""
        pc = PresentationContext(1)
        pc.add_transfer_syntax('2.16.840.1.113709.1.2.2')
        self.assertTrue('2.16.840.1.113709.1.2.2' in pc._transfer_syntax)

        pc.TransferSyntax = ['2.16.840.1.113709.1.2.1']
        self.assertTrue('2.16.840.1.113709.1.2.1' in pc._transfer_syntax)
示例#2
0
    def test_add_transfer_syntax(self):
        """Test adding transfer syntaxes"""
        pc = PresentationContext(1)
        pc.add_transfer_syntax('1.2.840.10008.1.2')
        pc.add_transfer_syntax(b'1.2.840.10008.1.2.1')
        pc.add_transfer_syntax(UID('1.2.840.10008.1.2.2'))
        pc.add_transfer_syntax(UID(''))

        with self.assertRaises(TypeError):
            pc.add_transfer_syntax([])

        with self.assertRaises(ValueError):
            pc.add_transfer_syntax('1.2.3.')

        with self.assertRaises(ValueError):
            pc.add_transfer_syntax('1.2.840.10008.1.1')