@@ -616,7 +616,6 @@ def uts46_libdata(ucdata):
616616
617617
618618def uts46_tests (ucdata ):
619-
620619 skip_tests = [
621620 # These appear to be errors in the test vectors so we skip building tests for
622621 # them from UTS46 data. All relate to incorrectly applying bidi rules across
@@ -649,37 +648,34 @@ def uts46_tests(ucdata):
649648 "1.\uac7e 6.\U00010c41 \u06d0 " ,
650649 "1.\u1100 \u1165 \u11b5 6.\U00010c41 \u06d0 " ,
651650 "1.xn--6-945e.xn--glb1794k" ,
652-
653651 # Test vectors that expect an error when there is a trailing
654652 # dot.
655- 'a.b.c.d.' ,
656- 'xn--gl0as212a.i.' ,
657- '繱𑖿.i.' ,
658- '繱𑖿.I.' ,
659- 'xn--1ug6928ac48e.i.' ,
660- '繱𑖿\u200d .i.' ,
661- '繱𑖿\u200d .I.' ,
662- 'xn--9hb7344k.' ,
663- '𐫇١.' ,
664- '123456789012345678901234567890123456789012345678901234567890123.123456789012345678901234567890123456789012345678901234567890123.123456789012345678901234567890123456789012345678901234567890123.123456789012345678901234567890123456789012345678901234567890b.' ,
665- 'xn--rt6a.' ,
666- '鱊.' ,
667- 'xn--4-0bd15808a.' ,
668- '𞤺ߌ4.' ,
669- 'xn--hva754s.' ,
670- 'ⴖͦ.' ,
671- 'xn--ss-f4j.b.' ,
672- 'ss်.b.' ,
673- 'xn--gky8837e.' ,
674- '璼𝨭.' ,
675- 'xn--7zv.' ,
676- '梉.' ,
677- 'xn--ss-59d.' ,
678- 'ss۫.' ,
679- '123456789012345678901234567890123456789012345678901234567890123.1234567890ä123456789012345678901234567890123456789012345.123456789012345678901234567890123456789012345678901234567890123.123456789012345678901234567890123456789012345678901234567890b.' ,
680- '123456789012345678901234567890123456789012345678901234567890123.xn--1234567890123456789012345678901234567890123456789012345-kue.123456789012345678901234567890123456789012345678901234567890123.123456789012345678901234567890123456789012345678901234567890b.' ,
681-
682-
653+ "a.b.c.d." ,
654+ "xn--gl0as212a.i." ,
655+ "繱𑖿.i." ,
656+ "繱𑖿.I." ,
657+ "xn--1ug6928ac48e.i." ,
658+ "繱𑖿\u200d .i." ,
659+ "繱𑖿\u200d .I." ,
660+ "xn--9hb7344k." ,
661+ "𐫇١." ,
662+ "123456789012345678901234567890123456789012345678901234567890123.123456789012345678901234567890123456789012345678901234567890123.123456789012345678901234567890123456789012345678901234567890123.123456789012345678901234567890123456789012345678901234567890b." ,
663+ "xn--rt6a." ,
664+ "鱊." ,
665+ "xn--4-0bd15808a." ,
666+ "𞤺ߌ4." ,
667+ "xn--hva754s." ,
668+ "ⴖͦ." ,
669+ "xn--ss-f4j.b." ,
670+ "ss်.b." ,
671+ "xn--gky8837e." ,
672+ "璼𝨭." ,
673+ "xn--7zv." ,
674+ "梉." ,
675+ "xn--ss-59d." ,
676+ "ss۫." ,
677+ "123456789012345678901234567890123456789012345678901234567890123.1234567890ä123456789012345678901234567890123456789012345.123456789012345678901234567890123456789012345678901234567890123.123456789012345678901234567890123456789012345678901234567890b." ,
678+ "123456789012345678901234567890123456789012345678901234567890123.xn--1234567890123456789012345678901234567890123456789012345-kue.123456789012345678901234567890123456789012345678901234567890123.123456789012345678901234567890123456789012345678901234567890b." ,
683679 ]
684680
685681 yield "# This file is automatically generated by tools/idna-data\n "
@@ -697,11 +693,10 @@ def uts46_tests(ucdata):
697693 to_ascii_t ,
698694 to_ascii_t_status ,
699695 ) = fields
696+
700697 if source in skip_tests :
701698 continue
702- #if source[-1] == '.':
703- # Skip test vectors with a trailing dot
704- # continue
699+
705700 # Per UTS46 test vectors, if the result is "", expect a blank string, but
706701 # if the result is blank, expect the input string.
707702 if to_unicode == '""' :
@@ -737,24 +732,16 @@ def uts46_tests(ucdata):
737732
738733 if to_unicode_status == "[]" and not nv8 :
739734 yield (
740- ' self.assertEqual(idna.decode({}, uts46=True, strict=True), {})'
741- .format (repr (source ), repr (to_unicode ))
735+ " self.assertEqual(idna.decode({}, uts46=True, strict=True), {})" .format (repr (source ), repr (to_unicode ))
742736 )
743737 else :
744- yield (
745- ' self.assertRaises(idna.IDNAError, idna.decode, {}, strict=True)'
746- .format (repr (source ))
747- )
738+ yield (" self.assertRaises(idna.IDNAError, idna.decode, {}, strict=True)" .format (repr (source )))
748739 if to_ascii_status == "[]" and not nv8 :
749740 yield (
750- ' self.assertEqual(idna.encode({}, uts46=True, strict=True), b{})'
751- .format (repr (source ), repr (to_ascii ))
741+ " self.assertEqual(idna.encode({}, uts46=True, strict=True), b{})" .format (repr (source ), repr (to_ascii ))
752742 )
753743 else :
754- yield (
755- ' self.assertRaises(idna.IDNAError, idna.encode, {}, strict=True)'
756- .format (repr (source ))
757- )
744+ yield (" self.assertRaises(idna.IDNAError, idna.encode, {}, strict=True)" .format (repr (source )))
758745 yield ""
759746
760747
0 commit comments