@@ -392,6 +392,7 @@ def test_boolean(self):
392
392
dec .start (buf )
393
393
tag = dec .peek ()
394
394
assert tag == (asn1 .Numbers .Boolean , asn1 .Types .Primitive , asn1 .Classes .Universal )
395
+ assert str (tag ) == "Tag(nr=<Numbers.Boolean: 0x01>, typ=<Types.Primitive: 0x00>, cls=<Classes.Universal: 0x00>)"
395
396
tag , val = dec .read ()
396
397
assert isinstance (val , int )
397
398
assert val
@@ -412,6 +413,7 @@ def test_integer(self):
412
413
dec .start (buf )
413
414
tag = dec .peek ()
414
415
assert tag == (asn1 .Numbers .Integer , asn1 .Types .Primitive , asn1 .Classes .Universal )
416
+ assert str (tag ) == "Tag(nr=<Numbers.Integer: 0x02>, typ=<Types.Primitive: 0x00>, cls=<Classes.Universal: 0x00>)"
415
417
tag , val = dec .read ()
416
418
assert isinstance (val , int )
417
419
assert val == 1
@@ -462,6 +464,7 @@ def test_octet_string(self):
462
464
dec .start (buf )
463
465
tag = dec .peek ()
464
466
assert tag == (asn1 .Numbers .OctetString , asn1 .Types .Primitive , asn1 .Classes .Universal )
467
+ assert str (tag ) == "Tag(nr=<Numbers.OctetString: 0x04>, typ=<Types.Primitive: 0x00>, cls=<Classes.Universal: 0x00>)"
465
468
tag , val = dec .read ()
466
469
assert val == b'foo'
467
470
@@ -471,6 +474,7 @@ def test_printable_string(self):
471
474
dec .start (buf )
472
475
tag = dec .peek ()
473
476
assert tag == (asn1 .Numbers .PrintableString , asn1 .Types .Primitive , asn1 .Classes .Universal )
477
+ assert str (tag ) == "Tag(nr=<Numbers.PrintableString: 0x13>, typ=<Types.Primitive: 0x00>, cls=<Classes.Universal: 0x00>)"
474
478
tag , val = dec .read ()
475
479
assert val == u'foo'
476
480
@@ -480,6 +484,7 @@ def test_bitstring(self):
480
484
dec .start (buf )
481
485
tag = dec .peek ()
482
486
assert tag == (asn1 .Numbers .BitString , asn1 .Types .Primitive , asn1 .Classes .Universal )
487
+ assert str (tag ) == "Tag(nr=<Numbers.BitString: 0x03>, typ=<Types.Primitive: 0x00>, cls=<Classes.Universal: 0x00>)"
483
488
tag , val = dec .read ()
484
489
assert val == b'\x12 \x34 \x56 '
485
490
@@ -489,6 +494,7 @@ def test_bitstring_unused_bits(self):
489
494
dec .start (buf )
490
495
tag = dec .peek ()
491
496
assert tag == (asn1 .Numbers .BitString , asn1 .Types .Primitive , asn1 .Classes .Universal )
497
+ assert str (tag ) == "Tag(nr=<Numbers.BitString: 0x03>, typ=<Types.Primitive: 0x00>, cls=<Classes.Universal: 0x00>)"
492
498
tag , val = dec .read ()
493
499
assert val == b'\x01 \x23 \x45 '
494
500
@@ -498,6 +504,7 @@ def test_unicode_printable_string(self):
498
504
dec .start (buf )
499
505
tag = dec .peek ()
500
506
assert tag == (asn1 .Numbers .PrintableString , asn1 .Types .Primitive , asn1 .Classes .Universal )
507
+ assert str (tag ) == "Tag(nr=<Numbers.PrintableString: 0x13>, typ=<Types.Primitive: 0x00>, cls=<Classes.Universal: 0x00>)"
501
508
tag , val = dec .read ()
502
509
assert val == u'fooé'
503
510
@@ -507,6 +514,7 @@ def test_null(self):
507
514
dec .start (buf )
508
515
tag = dec .peek ()
509
516
assert tag == (asn1 .Numbers .Null , asn1 .Types .Primitive , asn1 .Classes .Universal )
517
+ assert str (tag ) == "Tag(nr=<Numbers.Null: 0x05>, typ=<Types.Primitive: 0x00>, cls=<Classes.Universal: 0x00>)"
510
518
tag , val = dec .read ()
511
519
assert val is None
512
520
@@ -552,6 +560,7 @@ def test_enumerated(self):
552
560
dec .start (buf )
553
561
tag = dec .peek ()
554
562
assert tag == (asn1 .Numbers .Enumerated , asn1 .Types .Primitive , asn1 .Classes .Universal )
563
+ assert str (tag ) == "Tag(nr=<Numbers.Enumerated: 0x0a>, typ=<Types.Primitive: 0x00>, cls=<Classes.Universal: 0x00>)"
555
564
tag , val = dec .read ()
556
565
assert isinstance (val , int )
557
566
assert val == 1
@@ -562,6 +571,7 @@ def test_sequence(self):
562
571
dec .start (buf )
563
572
tag = dec .peek ()
564
573
assert tag == (asn1 .Numbers .Sequence , asn1 .Types .Constructed , asn1 .Classes .Universal )
574
+ assert str (tag ) == "Tag(nr=<Numbers.Sequence: 0x10>, typ=<Types.Constructed: 0x20>, cls=<Classes.Universal: 0x00>)"
565
575
dec .enter ()
566
576
tag , val = dec .read ()
567
577
assert val == 1
@@ -574,6 +584,7 @@ def test_sequence_of(self):
574
584
dec .start (buf )
575
585
tag = dec .peek ()
576
586
assert tag == (asn1 .Numbers .Sequence , asn1 .Types .Constructed , asn1 .Classes .Universal )
587
+ assert str (tag ) == "Tag(nr=<Numbers.Sequence: 0x10>, typ=<Types.Constructed: 0x20>, cls=<Classes.Universal: 0x00>)"
577
588
dec .enter ()
578
589
tag , val = dec .read ()
579
590
assert val == 1
@@ -586,6 +597,7 @@ def test_set(self):
586
597
dec .start (buf )
587
598
tag = dec .peek ()
588
599
assert tag == (asn1 .Numbers .Set , asn1 .Types .Constructed , asn1 .Classes .Universal )
600
+ assert str (tag ) == "Tag(nr=<Numbers.Set: 0x11>, typ=<Types.Constructed: 0x20>, cls=<Classes.Universal: 0x00>)"
589
601
dec .enter ()
590
602
tag , val = dec .read ()
591
603
assert val == 1
@@ -598,6 +610,7 @@ def test_set_of(self):
598
610
dec .start (buf )
599
611
tag = dec .peek ()
600
612
assert tag == (asn1 .Numbers .Set , asn1 .Types .Constructed , asn1 .Classes .Universal )
613
+ assert str (tag ) == "Tag(nr=<Numbers.Set: 0x11>, typ=<Types.Constructed: 0x20>, cls=<Classes.Universal: 0x00>)"
601
614
dec .enter ()
602
615
tag , val = dec .read ()
603
616
assert val == 1
@@ -610,6 +623,7 @@ def test_context(self):
610
623
dec .start (buf )
611
624
tag = dec .peek ()
612
625
assert tag == (1 , asn1 .Types .Constructed , asn1 .Classes .Context )
626
+ assert str (tag ) == "Tag(nr=1, typ=<Types.Constructed: 0x20>, cls=<Classes.Context: 0x80>)"
613
627
dec .enter ()
614
628
tag , val = dec .read ()
615
629
assert val == 1
@@ -620,6 +634,7 @@ def test_application(self):
620
634
dec .start (buf )
621
635
tag = dec .peek ()
622
636
assert tag == (1 , asn1 .Types .Constructed , asn1 .Classes .Application )
637
+ assert str (tag ) == "Tag(nr=1, typ=<Types.Constructed: 0x20>, cls=<Classes.Application: 0x40>)"
623
638
dec .enter ()
624
639
tag , val = dec .read ()
625
640
assert val == 1
@@ -630,6 +645,7 @@ def test_private(self):
630
645
dec .start (buf )
631
646
tag = dec .peek ()
632
647
assert tag == (1 , asn1 .Types .Constructed , asn1 .Classes .Private )
648
+ assert str (tag ) == "Tag(nr=1, typ=<Types.Constructed: 0x20>, cls=<Classes.Private: 0xc0>)"
633
649
dec .enter ()
634
650
tag , val = dec .read ()
635
651
assert val == 1
0 commit comments