o ƚRe@sdZddlmZddlmZmZmZmZmZm Z m Z m Z m Z ddZ ddZd d Zd d Zd dZddZddZddZddZdS)z webencodings.tests ~~~~~~~~~~~~~~~~~~ A basic test suite for Encoding. :copyright: Copyright 2012 by Simon Sapin :license: BSD, see LICENSE for details. )unicode_literals) lookupLABELSdecodeencode iter_decode iter_encodeIncrementalDecoderIncrementalEncoderUTF8cOs4z ||i|Wn |yYdSwtd|)NzDid not raise %s.)AssertionError) exceptionfunctionargskwargsr/builddir/build/BUILDROOT/alt-python310-pip-21.3.1-3.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/pip/_vendor/webencodings/tests.py assert_raisess   rcCs tdjdks JtdjdksJtdjdksJtdjdks$Jtdjdks-Jtdjdks6Jtdjdks?JtddusGJtddusOJtd jd ksXJtd jd ksaJtd jd ksjJtd jd kssJtddus{JtddusJdS)Nzutf-8zUtf-8zUTF-8utf8zutf8 z utf8 u8uutf-8 zUS-ASCIIz windows-1252z iso-8859-1latin1ZLATIN1zlatin-1uLATİN1)rnamerrrr test_labelssrcCstD]m}td|dt|fksJtd|dksJdD]"}tdg||\}}t|gks0Jttdg||gks>Jqt|}|ddksLJ|jddddksWJt|}|ddksdJ|jddddksoJqt t D] }t|j |ksJqvdS)N)rr T)final) rrrrrlistr r r setvaluesr)labelrepeatoutput_decoderencoderrrrrtest_all_labels0s r'cCsTtttddtttddtttgdtttgdtttdtttddS)Néinvalidé)r LookupErrorrrrr r r rrrrtest_invalid_labelCs  r,cCstdddtdfks JtdtddtdfksJtdddtdfks)Jtdtdtdfks6JtdddtdfksCJtd ddtdfksPJtd ddtd fks]Jtd ddtd fksjJtdddtd fkswJtdddtd fksJtdddtd fksJtdddtd fksJtdddtd fksJtdddtd fksJtdddtd fksJtdddtd fksJdS)Nru€érr*asciiér(utf-16beutf-16lesuszUTF-16BEzUTF-16LEzUTF-16)rrr rrrr test_decodeLs r7cCsptdddks JtdddksJtdddksJtdddks$Jtdddks-Jtdd d ks6JdS) Nr*rrr.utf-16r6r4r2r5)rrrrr test_encodebs r:cCsldd}|gddks J|dgddksJ|dgddks!J|dgdd ks+J|d d gdd ks6J|d d gdd ksAJ|dgddksKJ|dgddksUJ|gdddks`J|gdddkskJ|gdddksvJ|dgddksJ|dgddksJ|dgddksJ|dgddksJ|gdddksJ|gdddksJdS)NcSst||\}}d|S)Nr)rjoin)inputfallback_encodingr# _encodingrrriter_decode_to_stringls z/test_iter_decode..iter_decode_to_stringrrrr8r*shelloZhelloshelloshellor.r0r())rBarCua�)rrrsrDrBsuï»r1r3)rrrs)rshr@x-user-defineduhllor)r?rrrtest_iter_decodeksL rJcCsdtgddks JdtdgddksJdtdgddks&Jdtgdddks4JdtgdddksBJdtgdd dksPJdtgdd d ks^Jdtgd d dkslJdS)Nrrrr*r8)rr*rrr9r6r4r2r5)ruhrZllorIshllo)r;r rrrrtest_iter_encodes  rKcCs@d}d}d}d}t|d|tdfksJt|d|ksJdS)Ns2, O#ɻtϨu2, O#tsaaZaarI)rrr)encodeddecodedrrrtest_x_user_defineds rNN)__doc__ __future__rrrrrrrr r r r rrr'r,r7r:rJrKrNrrrrs ,