summaryrefslogtreecommitdiff
path: root/test/codec/ber/test_decoder.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/codec/ber/test_decoder.py')
-rw-r--r--test/codec/ber/test_decoder.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/test/codec/ber/test_decoder.py b/test/codec/ber/test_decoder.py
index 92b7aa3..85915d9 100644
--- a/test/codec/ber/test_decoder.py
+++ b/test/codec/ber/test_decoder.py
@@ -1,4 +1,4 @@
-from pyasn1.type import tag, namedtype, univ
+from pyasn1.type import tag, namedtype, univ, char
from pyasn1.codec.ber import decoder, eoo
from pyasn1.compat.octets import ints2octs, str2octs, null
from pyasn1.error import PyAsn1Error
@@ -397,6 +397,18 @@ class RealDecoderTestCase(unittest.TestCase):
else:
assert 0, 'accepted too-short real'
+class UniversalStringDecoderTestCase(unittest.TestCase):
+ def testDecoder(self):
+ assert decoder.decode(ints2octs((28, 12, 0, 0, 0, 97, 0, 0, 0, 98, 0, 0, 0, 99))) == (char.UniversalString(u'abc'), null)
+
+class BMPStringDecoderTestCase(unittest.TestCase):
+ def testDecoder(self):
+ assert decoder.decode(ints2octs((30, 6, 0, 97, 0, 98, 0, 99))) == (char.BMPString(u'abc'), null)
+
+class UTF8StringDecoderTestCase(unittest.TestCase):
+ def testDecoder(self):
+ assert decoder.decode(ints2octs((12, 3, 97, 98, 99))) == (char.UTF8String(u'abc'), null)
+
class SequenceDecoderTestCase(unittest.TestCase):
def setUp(self):
self.s = univ.Sequence(componentType=namedtype.NamedTypes(