diff options
author | Ilya Etingof <etingof@gmail.com> | 2017-09-13 01:10:42 +0200 |
---|---|---|
committer | Ilya Etingof <etingof@gmail.com> | 2017-09-13 01:10:42 +0200 |
commit | c40b8c22c9679e017871617d7cf558b1b7f0ff84 (patch) | |
tree | ea0c3a608294cb740c2a9e6b15f776143c8f2c27 /tests | |
parent | 789a4e2f4f921fdac37f28df557319b89df3050c (diff) | |
download | pyasn1-c40b8c22c9679e017871617d7cf558b1b7f0ff84.tar.gz |
refactored OpenType() into a mutable object
Diffstat (limited to 'tests')
-rw-r--r-- | tests/codec/ber/test_decoder.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/codec/ber/test_decoder.py b/tests/codec/ber/test_decoder.py index 85c71fb..c1ced34 100644 --- a/tests/codec/ber/test_decoder.py +++ b/tests/codec/ber/test_decoder.py @@ -823,12 +823,12 @@ class SequenceDecoderWithSchemaTestCase(unittest.TestCase): ) == (self.s, null) -class SequenceDecoderWithIntegerHoleTypesTestCase(unittest.TestCase): +class SequenceDecoderWithIntegerOpenTypesTestCase(unittest.TestCase): def setUp(self): openType = opentype.OpenType( 'id', - [(1, univ.Integer()), - (2, univ.OctetString())] + {1: univ.Integer(), + 2: univ.OctetString()} ) self.s = univ.Sequence( componentType=namedtype.NamedTypes( @@ -837,7 +837,7 @@ class SequenceDecoderWithIntegerHoleTypesTestCase(unittest.TestCase): ) ) - def testChoiceOneDecodeHoles(self): + def testDecodeOpenTypesChoiceOne(self): s, r = decoder.decode( ints2octs((48, 6, 2, 1, 1, 2, 1, 12)), asn1Spec=self.s, decodeOpenTypes=True @@ -846,7 +846,7 @@ class SequenceDecoderWithIntegerHoleTypesTestCase(unittest.TestCase): assert s[0] == 1 assert s[1] == 12 - def testChoiceTwoDecodeHoles(self): + def testDecodeOpenTypesChoiceTwo(self): s, r = decoder.decode( ints2octs((48, 16, 2, 1, 2, 4, 11, 113, 117, 105, 99, 107, 32, 98, 114, 111, 119, 110)), asn1Spec=self.s, decodeOpenTypes = True @@ -855,7 +855,7 @@ class SequenceDecoderWithIntegerHoleTypesTestCase(unittest.TestCase): assert s[0] == 2 assert s[1] == univ.OctetString('quick brown') - def testChoiceOneDontDecodeHoles(self): + def testDontDecodeOpenTypesChoiceOne(self): s, r = decoder.decode( ints2octs((48, 6, 2, 1, 1, 2, 1, 12)), asn1Spec=self.s ) @@ -863,7 +863,7 @@ class SequenceDecoderWithIntegerHoleTypesTestCase(unittest.TestCase): assert s[0] == 1 assert s[1] == ints2octs((2, 1, 12)) - def testChoiceTwoDontDecodeHoles(self): + def testDontDecodeOpenTypesChoiceTwo(self): s, r = decoder.decode( ints2octs((48, 16, 2, 1, 2, 4, 11, 113, 117, 105, 99, 107, 32, 98, 114, 111, 119, 110)), asn1Spec=self.s ) |