U .e@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_encodeIncrementalDecoderIncrementalEncoderUTF8cOs6z|||Wn|k r$YdSXtd|dS)NzDid not raise %s.)AssertionError)Z exceptionZfunctionargskwargsrB/usr/lib/python3.8/site-packages/pip/_vendor/webencodings/tests.py assert_raisess rcCsdSNrrrrr test_labelssrcCsNtD]2}dD]}tdg||\}}q t|}t|}qttD]}qDdS)N)rr )rrr r setvalues)Zlabelrepeatoutput_decoderencodernamerrrtest_all_labels0srcCsTtttddtttddtttgdtttgdtttdtttddS)NséZinvalidé)r LookupErrorrrrr r r rrrrtest_invalid_labelCs  r"cCsdSrrrrrr test_decodeLsr#cCsdSrrrrrr test_encodebsr$cCs dd}dS)NcSst||\}}d|S)N)rjoin)inputZfallback_encodingrZ _encodingrrriter_decode_to_stringlsz/test_iter_decode..iter_decode_to_stringr)r(rrrtest_iter_decodeksr)cCsdSrrrrrrtest_iter_encodesr*cCsd}d}d}d}dS)Ns2, O#ɻtϨu2, O#tsaaZaar)ZencodedZdecodedrrrtest_x_user_defineds r+N)__doc__Z __future__rr%rrrrrr r r r rrrr"r#r$r)r*r+rrrrs ,