a ze!%@sdddlZddlmZGdddejZGdddejZejGdddejZed kr`e dS) N)supportc@sTeZdZddZddZddZddZd d Zd d Zd dZ ddZ ddZ dS) TestMROEntrycstgGddd}Gfddd}|gGddd||}|d||ff|didS) Nc@s eZdZdS)z0TestMROEntry.test_mro_entry_signature..BN__name__ __module__ __qualname__rrJ/opt/bitninja-python-dojo/embedded/lib/python3.9/test/test_genericclass.pyBr cseZdZfddZdS)z0TestMROEntry.test_mro_entry_signature..Ccs||gfSNextend)selfargskwargsCtestedrr __mro_entries__ sz@TestMROEntry.test_mro_entry_signature..C.__mro_entries__Nrrrrrrrr r src@s eZdZdS)z0TestMROEntry.test_mro_entry_signature..DNrrrrr Dr rr) assertEqual)rr crrrr test_mro_entry_signatures z%TestMROEntry.test_mro_entry_signaturecsgGddd}Gddd}Gfddd}|}|gGddd|||}|d |||f||j|||f||j|||f||j||||tf|}Gd d d |}|d |f||j|fdS) Nc@s eZdZdS)z&TestMROEntry.test_mro_entry..ANrrrrr Ar rc@s eZdZdS)z&TestMROEntry.test_mro_entry..BNrrrrr r r r cseZdZfddZdS)z&TestMROEntry.test_mro_entry..Ccs||jfSr )append __class__rbasesrrr rs z6TestMROEntry.test_mro_entry..C.__mro_entries__Nrrr!rr rsrc@s eZdZdS)z&TestMROEntry.test_mro_entry..DNrrrrr rr rc@s eZdZdS)z&TestMROEntry.test_mro_entry..ENrrrrr E#r r#r __bases____orig_bases____mro__object)rrr rrrdr#rr!r test_mro_entrys zTestMROEntry.test_mro_entrycsgGddd}Gddd}Gfddd}|}|gGddd|||}|d |||f||j||f||j|||f||j|||tfGd d d |}|d |f||jtf||j|f||j|tfdS) Nc@s eZdZdS)z+TestMROEntry.test_mro_entry_none..ANrrrrr r)r rc@s eZdZdS)z+TestMROEntry.test_mro_entry_none..BNrrrrr r *r r cseZdZfddZdS)z+TestMROEntry.test_mro_entry_none..Ccs|dSNrrrr!rr r,s z;TestMROEntry.test_mro_entry_none..C.__mro_entries__Nrrr!rr r+src@s eZdZdS)z+TestMROEntry.test_mro_entry_none..DNrrrrr r1r rr"c@s eZdZdS)z+TestMROEntry.test_mro_entry_none..ENrrrrr r#6r r#r$)rrr rrrr#rr!r test_mro_entry_none's  z TestMROEntry.test_mro_entry_nonecsgGddd}Gfddd}|}|gGddd||}|d||f||j|tf||j||f||j||ttfdS)Nc@s eZdZdS)z4TestMROEntry.test_mro_entry_with_builtins..ANrrrrr r>r rcseZdZfddZdS)z4TestMROEntry.test_mro_entry_with_builtins..Ccs|tfSr )rdictrr!rr r@s zDTestMROEntry.test_mro_entry_with_builtins..C.__mro_entries__Nrrr!rr r?src@s eZdZdS)z4TestMROEntry.test_mro_entry_with_builtins..DNrrrrr rEr rr")rr%r.r&r'r()rrrrrrr!r test_mro_entry_with_builtins<s z)TestMROEntry.test_mro_entry_with_builtinscsgGfddd}|gGddd|t}|d|tf||jtf||j|tf||j|ttfdS)NcseZdZfddZdS)z6TestMROEntry.test_mro_entry_with_builtins_2..Ccs|fSr r,rrrr rNs zFTestMROEntry.test_mro_entry_with_builtins_2..C.__mro_entries__Nrrrrr rMsrc@s eZdZdS)z6TestMROEntry.test_mro_entry_with_builtins_2..DNrrrrr rSr rr")rr.r%r&r'r()rrrrrr test_mro_entry_with_builtins_2Ks z+TestMROEntry.test_mro_entry_with_builtins_2cCsGddd}|}|t Gddd|}Wdn1sD0YGddd}|}|t Gddd|}Wdn1s0YdS)Nc@seZdZddZdS)z6TestMROEntry.test_mro_entry_errors..C_too_manycSsdSr+r)rr Z somethingotherrrr r[szFTestMROEntry.test_mro_entry_errors..C_too_many.__mro_entries__Nrrrrr C_too_manyZsr2c@s eZdZdSz-TestMROEntry.test_mro_entry_errors..DNrrrrr r_r rc@seZdZddZdS)z5TestMROEntry.test_mro_entry_errors..C_too_fewcSsdSr+rrrrr raszETestMROEntry.test_mro_entry_errors..C_too_few.__mro_entries__Nrrrrr C_too_few`sr5c@s eZdZdSr3rrrrr rer  assertRaises TypeError)rr2rrr5r)rrr test_mro_entry_errorsYs . z"TestMROEntry.test_mro_entry_errorscCsGddd}|}|t Gddd|}Wdn1sD0YGddd}|}|t Gddd|}Wdn1s0YdS)Nc@seZdZdZdS)z.C_not_callable Surprise!Nrrrrr C_not_callablehsr;c@s eZdZdSz/TestMROEntry.test_mro_entry_errors_2..DNrrrrr rlr rc@seZdZddZdS)z9TestMROEntry.test_mro_entry_errors_2..C_not_tuplecSstSr )r(r4rrr rnszITestMROEntry.test_mro_entry_errors_2..C_not_tuple.__mro_entries__Nrrrrr C_not_tuplemsr=c@s eZdZdSr<rrrrr rrr r6)rr;rrr=rrr test_mro_entry_errors_2gs . z$TestMROEntry.test_mro_entry_errors_2csgGfdddt}GdddGfddd}|}Gddd||d }|d ||d d|d f|d dd ||jf||j|f||j|tf||j|dS)NcseZdZfddZZS)z3TestMROEntry.test_mro_entry_metaclass..Metacs$||||gt||||Sr )rsuper__new__)mclsnamer ns)r meta_argsrr r@wsz;TestMROEntry.test_mro_entry_metaclass..Meta.__new__)rrrr@ __classcell__r)rD)rr MetavsrFc@s eZdZdS)z0TestMROEntry.test_mro_entry_metaclass..ANrrrrr rzr rcseZdZfddZdS)z0TestMROEntry.test_mro_entry_metaclass..CcsfSr rrrrr r|sz@TestMROEntry.test_mro_entry_metaclass..C.__mro_entries__NrrrGrr r{src@seZdZdZdS)z0TestMROEntry.test_mro_entry_metaclass..DrN)rrrxrrrr rsr metaclassrrrH)typerr%r&r'r(r)rrFrrrr)rrDr test_mro_entry_metaclasstsz%TestMROEntry.test_mro_entry_metaclasscCsRGddd}|}|tdtd|fiWdn1sD0YdS)Nc@seZdZddZdS)z0TestMROEntry.test_mro_entry_type_call..CcSsdSr+rrrrr rsz@TestMROEntry.test_mro_entry_type_call..C.__mro_entries__Nrrrrr rsrz+MRO entry resolution; use types.new_class()ZBad)ZassertRaisesRegexr8rM)rrrrrr test_mro_entry_type_calls z%TestMROEntry.test_mro_entry_type_callN) rrrrr*r-r/r0r9r>rNrOrrrr rs  rc@sleZdZddZddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ ddZdS)TestClassGetitemcsNgGfddd}|ttf|d|ttff|didS)NcseZdZfddZdS)z.TestClassGetitem.test_class_getitem..Ccs||gdSr r )rrZ getitem_argsrr __class_getitem__sz@TestClassGetitem.test_class_getitem..C.__class_getitem__NrrrrRrrQrr rsrrr)intstrrrrrrQr test_class_getitems  z#TestClassGetitem.test_class_getitemcCs2Gddd}||td|||ddS)Nc@seZdZddZdS)z5TestClassGetitem.test_class_getitem_format..CcSsd|jdS)NzC[]rclsitemrrr rRszGTestClassGetitem.test_class_getitem_format..C.__class_getitem__NrSrrrr rsrC[int]zC[C]rrTrVrrr test_class_getitem_formatsz*TestClassGetitem.test_class_getitem_formatcCsBGddd}Gddd|}||td|||ddS)Nc@seZdZddZdS)z:TestClassGetitem.test_class_getitem_inheritance..CcSs|jd|jdSN[rXrYrZrrr rRszLTestClassGetitem.test_class_getitem_inheritance..C.__class_getitem__NrSrrrr rsrc@s eZdZdS)z:TestClassGetitem.test_class_getitem_inheritance..DNrrrrr rr rD[int]D[D]r^rrrrrr test_class_getitem_inheritancesz/TestClassGetitem.test_class_getitem_inheritancecCsBGddd}Gddd|}||td|||ddS)Nc@seZdZddZdS)z.CcSsdS)NzShould not see thisrrZrrr rRszNTestClassGetitem.test_class_getitem_inheritance_2..C.__class_getitem__NrSrrrr rsrc@seZdZddZdS)z.DcSs|jd|jdSr`rYrZrrr rRszNTestClassGetitem.test_class_getitem_inheritance_2..D.__class_getitem__NrSrrrr rsrrbrcr^rdrrr test_class_getitem_inheritance_2sz1TestClassGetitem.test_class_getitem_inheritance_2cCsBGddd}Gddd|}||td|||ddS)Nc@seZdZeddZdS)z:TestClassGetitem.test_class_getitem_classmethod..CcSs|jd|jdSr`rYrZrrr rRszLTestClassGetitem.test_class_getitem_classmethod..C.__class_getitem__N)rrr classmethodrRrrrr rsrc@s eZdZdS)z:TestClassGetitem.test_class_getitem_classmethod..DNrrrrr rr rrbrcr^rdrrr test_class_getitem_classmethodsz/TestClassGetitem.test_class_getitem_classmethodcCsBGddd}Gddd|}||td|||ddS)Nc@seZdZddZdS)z6TestClassGetitem.test_class_getitem_patched..CcSsdd}t||_dS)NcSs|jd|jdSr`rYrZrrr rRszcTestClassGetitem.test_class_getitem_patched..C.__init_subclass__..__class_getitem__)rgrR)r[rRrrr __init_subclass__szHTestClassGetitem.test_class_getitem_patched..C.__init_subclass__N)rrrrirrrr rsrc@s eZdZdS)z6TestClassGetitem.test_class_getitem_patched..DNrrrrr rr rrbrcr^rdrrr test_class_getitem_patchedsz+TestClassGetitem.test_class_getitem_patchedcCsHGdddt}Gddd|}||jd|t||jtdS)Nc@seZdZdZddZdS)z.ANcSs ||_dSr ) called_withrZrrr rRszNTestClassGetitem.test_class_getitem_with_builtins..A.__class_getitem__)rrrrkrRrrrr rsrc@s eZdZdS)z.BNrrrrr r sr )r.assertIsrkrT)rrr rrr test_class_getitem_with_builtinss z1TestClassGetitem.test_class_getitem_with_builtinscCsGddd}|t|tWdn1s60YGddd}|t|tWdn1sv0YdS)Nc@seZdZddZdS)z=TestClassGetitem.test_class_getitem_errors..C_too_fewcSsdSr r)r[rrr rRszOTestClassGetitem.test_class_getitem_errors..C_too_few.__class_getitem__NrSrrrr r5sr5c@seZdZddZdS)z>TestClassGetitem.test_class_getitem_errors..C_too_manycSsdSr r)r[ZoneZtworrr rRszPTestClassGetitem.test_class_getitem_errors..C_too_many.__class_getitem__NrSrrrr r2sr2)r7r8rT)rr5r2rrr test_class_getitem_errorss  & z*TestClassGetitem.test_class_getitem_errorscCsGddd}|t|tWdn1s80YGddd}|}dd|_|t|tWdn1s0YGddd}|t|tWdn1s0YdS) Nc@seZdZddZdS)z7TestClassGetitem.test_class_getitem_errors_2..CcSsdSr rrZrrr rRszITestClassGetitem.test_class_getitem_errors_2..C.__class_getitem__NrSrrrr rsrc@s eZdZdS)z7TestClassGetitem.test_class_getitem_errors_2..ENrrrrr r#r r#cSsdS)NzThis will not workrrZrrr r z>TestClassGetitem.test_class_getitem_errors_2..c@seZdZdZdS)zDTestClassGetitem.test_class_getitem_errors_2..C_not_callabler:NrSrrrr r;sr;)r7r8rTrR)rrr#er;rrr test_class_getitem_errors_2s (  & z,TestClassGetitem.test_class_getitem_errors_2cCs$Gdddt}||tddS)Nc@seZdZddZdS)z;TestClassGetitem.test_class_getitem_metaclass..MetacSs|jd|jdSr`rYrZrrr rRszMTestClassGetitem.test_class_getitem_metaclass..Meta.__class_getitem__NrSrrrr rFsrFz Meta[int]rMrrT)rrFrrr test_class_getitem_metaclasssz-TestClassGetitem.test_class_getitem_metaclasscCs6Gdddt}Gddd|d}||tddS)Nc@s eZdZdS)z@TestClassGetitem.test_class_getitem_with_metaclass..MetaNrrrrr rFr rFc@seZdZddZdS)z=TestClassGetitem.test_class_getitem_with_metaclass..CcSs|jd|jdSr`rYrZrrr rRszOTestClassGetitem.test_class_getitem_with_metaclass..C.__class_getitem__NrSrrrr rsrrIr]rrrrFrrrr !test_class_getitem_with_metaclasssz2TestClassGetitem.test_class_getitem_with_metaclasscCs6Gdddt}Gddd|d}||tddS)Nc@seZdZddZdS)zATestClassGetitem.test_class_getitem_metaclass_first..MetacSsdS)Nfrom metaclassrrZrrr __getitem__szMTestClassGetitem.test_class_getitem_metaclass_first..Meta.__getitem__N)rrrrwrrrr rFsrFc@seZdZddZdS)z>TestClassGetitem.test_class_getitem_metaclass_first..CcSsdS)Nzfrom __class_getitem__rrZrrr rRszPTestClassGetitem.test_class_getitem_metaclass_first..C.__class_getitem__NrSrrrr rsrrIrvrrrtrrr "test_class_getitem_metaclass_firstsz3TestClassGetitem.test_class_getitem_metaclass_firstN)rrrrWr_rerfrhrjrmrnrqrsrurxrrrr rPs      rPc@seZdZddZdS)CAPITestcCsddlm}m}||t||t}|t|||| dtfGddd|}||j tf||j |f||j |tt fdS)Nr)Generic GenericAliasrc@s eZdZdS)z CAPITest.test_c_class..CNrrrrr rsr)Z _testcapirzr{ZassertIsInstancerRrTrlrMrrr%r&r'r()rrzr{Z IntGenericrrrr test_c_classszCAPITest.test_c_classN)rrrr|rrrr ry sry__main__) ZunittesttestrZTestCaserrPZ cpython_onlyryrmainrrrr s v