diff options
author | Ilya Etingof <etingof@gmail.com> | 2017-07-22 21:20:38 +0200 |
---|---|---|
committer | Ilya Etingof <etingof@gmail.com> | 2017-07-22 21:20:38 +0200 |
commit | f0cd6b98e10e176f0e6c8bee6970cc38d87497d0 (patch) | |
tree | d35f67e124fad8e8948d266729187cd44f6394e2 /tests | |
parent | b1558ad66012c408ffbdb18d5d7e2d9853a73979 (diff) | |
download | pyasn1-git-f0cd6b98e10e176f0e6c8bee6970cc38d87497d0.tar.gz |
test case fix: do not initialize optional SEQUENCE field
Diffstat (limited to 'tests')
-rw-r--r-- | tests/codec/ber/test_decoder.py | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/tests/codec/ber/test_decoder.py b/tests/codec/ber/test_decoder.py index 18d7f08..eb16c3f 100644 --- a/tests/codec/ber/test_decoder.py +++ b/tests/codec/ber/test_decoder.py @@ -484,10 +484,12 @@ class UTF8StringDecoderTestCase(unittest.TestCase): class SequenceDecoderTestCase(unittest.TestCase): def setUp(self): - self.s = univ.Sequence(componentType=namedtype.NamedTypes( - namedtype.NamedType('place-holder', univ.Null(null)), - namedtype.NamedType('first-name', univ.OctetString(null)), - namedtype.NamedType('age', univ.Integer(33))) + self.s = univ.Sequence( + componentType=namedtype.NamedTypes( + namedtype.NamedType('place-holder', univ.Null(null)), + namedtype.NamedType('first-name', univ.OctetString(null)), + namedtype.NamedType('age', univ.Integer(33)) + ) ) self.s.setComponentByPosition(0, univ.Null(null)) self.s.setComponentByPosition(1, univ.OctetString('quick brown')) @@ -543,11 +545,13 @@ class SequenceDecoderTestCase(unittest.TestCase): class GuidedSequenceDecoderTestCase(unittest.TestCase): def setUp(self): - self.s = univ.Sequence(componentType=namedtype.NamedTypes( - namedtype.NamedType('place-holder', univ.Null(null)), - namedtype.OptionalNamedType('first-name', univ.OctetString(null)), - namedtype.DefaultedNamedType('age', univ.Integer(33)), - )) + self.s = univ.Sequence( + componentType=namedtype.NamedTypes( + namedtype.NamedType('place-holder', univ.Null(null)), + namedtype.OptionalNamedType('first-name', univ.OctetString()), + namedtype.DefaultedNamedType('age', univ.Integer(33)), + ) + ) def __init(self): self.s.clear() @@ -677,11 +681,13 @@ class GuidedSequenceDecoderTestCase(unittest.TestCase): class ChoiceDecoderTestCase(unittest.TestCase): def setUp(self): - self.s = univ.Choice(componentType=namedtype.NamedTypes( - namedtype.NamedType('place-holder', univ.Null(null)), - namedtype.NamedType('number', univ.Integer(0)), - namedtype.NamedType('string', univ.OctetString()) - )) + self.s = univ.Choice( + componentType=namedtype.NamedTypes( + namedtype.NamedType('place-holder', univ.Null(null)), + namedtype.NamedType('number', univ.Integer(0)), + namedtype.NamedType('string', univ.OctetString()) + ) + ) def testBySpec(self): self.s.setComponentByPosition(0, univ.Null(null)) |