Skip to content

Commit 4b76630

Browse files
committed
asn1: Fix coverage for encoding getters
Signed-off-by: Facundo Tuesca <[email protected]>
1 parent 0a47aaa commit 4b76630

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/hazmat/asn1/test_api.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,3 +239,13 @@ def test_fields_of_variant_type(self) -> None:
239239
)
240240
opt = declarative_asn1.Type.Option(ann_type)
241241
assert opt._0 == ann_type
242+
243+
def test_fields_of_variant_encoding(self) -> None:
244+
from cryptography.hazmat.bindings._rust import declarative_asn1
245+
246+
# Needed for coverage of the `_0`, `_1`, etc fields generated
247+
# for tuple enum variants
248+
implicit = declarative_asn1.Encoding.Implicit(0)
249+
explicit = declarative_asn1.Encoding.Explicit(0)
250+
assert implicit._0 == 0
251+
assert explicit._0 == 0

0 commit comments

Comments
 (0)