values = {}
for name, spec in self.specs.items():
if spec.optional and (
- (lenindef and v[:EOC_LEN].tobytes() == EOC) or
- len(v) == 0
+ (lenindef and v[:EOC_LEN].tobytes() == EOC) or
+ len(v) == 0
):
continue
sub_decode_path = decode_path + (name,)
with assertRaisesRegex(self, DecodeError, "unallowed BER"):
BitString(impl=tag_encode(impl)).decode(encoded_indefinite)
for lenindef_expected, encoded in (
- (True, encoded_indefinite),
- (False, encoded_definite),
+ (True, encoded_indefinite),
+ (False, encoded_definite),
):
obj, tail = BitString(impl=tag_encode(impl)).decode(
encoded, ctx={"bered": True}
with assertRaisesRegex(self, DecodeError, "unallowed BER"):
OctetString(impl=tag_encode(impl)).decode(encoded_indefinite)
for lenindef_expected, encoded in (
- (True, encoded_indefinite),
- (False, encoded_definite),
+ (True, encoded_indefinite),
+ (False, encoded_definite),
):
obj, tail = OctetString(impl=tag_encode(impl)).decode(
encoded, ctx={"bered": True}