a ze5@sNddlZddlZddlZddlZddlZGdddejZedkrJe dS)Nc@seZdZddZddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ ddZddZddZddZdd Zd!S)" DictSetTestcCsvti}|t|i|t|ti}|t|i|t|ti}|t|i|t|dSN)typekeys assertRaises TypeErroritemsvalues)selfZktitZvtr G/opt/bitninja-python-dojo/embedded/lib/python3.9/test/test_dictviews.pytest_constructors_not_callable s     z*DictSetTest.test_constructors_not_callablecCsddd}|}|t|d|t|ddh||ddh||hd||ddh||dh||d |d||d||d||d ||||d d d}||||d=|||dS) N ABCarr>rrbr*Z def)r assertEquallensetassertNotEqualassertIn assertNotIn)r drer r r test_dict_keyss$       zDictSetTest.test_dict_keyscCs$ddd}|}|t|d|t|ddh||ddh||hd||ddh||dh||d |d||d||d ||d ||d ||d ||d|||||}|||d|d<|||dS)Nrrrrrrrr>r$Zjunkr#)rrr)rrrr )r)rrrr)rrrrrrrcopy)r r rr!r r r test_dict_items(s*         zDictSetTest.test_dict_itemscCs@ddd}ddd}||||||dS)Nr))rr)rrrrrr)rrrr)r r r!r r r test_dict_mixed_keys_items?s  z&DictSetTest.test_dict_mixed_keys_itemscCs:ddd}|}|t|ddh|t|ddS)Nrrrr)r rrr)r r r r r r test_dict_valuesEs zDictSetTest.test_dict_valuescCsddd}|t|tt|}||t||dkpD|dkt|}||t||dkpr|dkt|}||t||dkp|d kdS) Nrrrz#dict_items([('a', 'ABC'), (1, 10)])z#dict_items([(1, 10), ('a', 'ABC')])zdict_keys(['a', 1])zdict_keys([1, 'a'])zdict_values(['ABC', 10])zdict_values([10, 'ABC']))assertIsInstancereprstrr assertTruerr r r rr r r test_dict_reprKs"          zDictSetTest.test_dict_reprcsddd}ddd}ddd}d di}Gfd d d t|||@d d h|||@d h|||@t||t|@d d h||t|@d h||t|@t||t|@d d h|||@d h|||@d h||t|@d h||t|@t|t||@t|t||@t|t|g@t|tg|@t|||Bd d h|||Bhd|||Bhd||t|Bd d h||t|Bhd||t|Bhd||dBhd|||At|||Ad dh|||Ahd||t|At||t|Ad dh||t|Ahd||t|Ad dh|||t|||d h|||d d h||t|t||t|d h||t|d d h||dd d h|| ||| ||| t ||| t|| | hd| | gd| | tgd| | tddg| | ddg| | i| | |i}| | t| | g| | || | dgdS)Nrrrrr%)rcr r!r cseZdZfddZZS)z7DictSetTest.test_keys_set_operations..CustomSetcst|Sr)super intersectionr other) CustomSet __class__r r r9bszDDictSetTest.test_keys_set_operations..CustomSet.intersection)__name__ __module__ __qualname__r9 __classcell__r r<)r=r r<asr<rr>rr4r>rrr r!r)>rrrrr4)rryxzrErDrFrErD) rrrtupler, frozensetZassertIsr assertFalse isdisjointlistr/)r d1d2d3Zd4der rBr test_keys_set_operations[sz           z$DictSetTest.test_keys_set_operationscCsddd}ddd}ddd}|||@ddh|||@dh|||@t||t|@ddh||t|@dh||t|@t|||Bddh|||Bhd |||Bhd ||t|Bddh||t|Bhd ||t|Bhd |||At|||Add h|||Ahd |||t|||dh|||ddh||t|t||t|dh||t|ddh||||||||t|||t|||hd ||gd ||tgd ||tddg||i|||i}||t||g|||||dgdS)Nrrr3r5r6r7rrrr>rRrSrr>rR)r r5rS)r!r6rTrCrGrErD)rrrrJrKrLr/)r rMrNrOrPr r r test_items_set_operationssv    z%DictSetTest.test_items_set_operationscCsddd}||tddg@dh||tddgBhd||tddgAddh||tddgdh|}||tdg@dh||tdgAdh||tdgBddh||tdgdhdS) Nrr5)rr%r>rrr%r%r))r%r5)rriterr)r originrr r r !test_set_operations_with_iterators   z-DictSetTest.test_set_operations_with_iteratorcCs|tid@Wdn1s,0Y|tidBWdn1sb0Y|tidAWdn1s0Y|tidWdn1s0Y|tid@Wdn1s0Y|tidBWdn1s>0Y|tidAWdn1sv0Y|tidWdn1s0YdS)Nr)rrrrr r r r $test_set_operations_with_noniterables  * * * * , , , z0DictSetTest.test_set_operations_with_noniterablecCsHi}||d<t|}||t||d<t|}||tdS)Nr)r r-r,r.rr0r r r test_recursive_reprs   zDictSetTest.test_recursive_reprcCs8i}ttdD]}d|i}q|tt|dS)Ndr)rangesysgetrecursionlimitr rRecursionErrorr-)r r ir r r test_deeply_nested_reprsz#DictSetTest.test_deeply_nested_reprcCsJddd}|ttj||ttj||ttj|dS)Nrrr)rrr&rr rr r r r r test_copy s zDictSetTest.test_copycsGdddtGfddd}||}}||}}||i}||||||||||||f|||j|||j|||j||f||j||f|||vWdn1s0YdS)Nc@s eZdZdS)z+DictSetTest.test_compare_error..ExcN)r>r?r@r r r r Excsrecs eZdZddZfddZdS)z-DictSetTest.test_compare_error..BadEqcSsdS)Nr rYr r r __hash__sz6DictSetTest.test_compare_error..BadEq.__hash__csdSrr r:rer r __eq__sz4DictSetTest.test_compare_error..BadEq.__eq__N)r>r?r@rgrir rhr r BadEqsrj) Exceptionrrr rr __contains__)r rjZk1Zk2Zv1Zv2r r rhr test_compare_errors  zDictSetTest.test_compare_errorcCsvddd}ttjdD]X}|ttjftj|||ttjftj|||ttjftj| |qdS)Nrrrr) r]pickleHIGHEST_PROTOCOLrr PicklingErrordumpsrr r)r r protor r r test_pickle,s       zDictSetTest.test_picklecCs:tdd}||tjj||tjj||tjj||tjj||tjj ||tjj || tjj || tjj|| tjj|| tjj|| tjj|| tjj|| tjj|| tjj || tjj dS)Nr)r)dictr,r collectionsabcKeysView MappingViewSetSizedIterable Containerr ValuesViewr ItemsViewrcr r r test_abc_registry6s  zDictSetTest.test_abc_registryN)r>r?r@rr"r'r*r+r2rQrUrXrZr[rbrdrmrsrr r r r rs  F8   r__main__) collections.abcrur&rnr^ZunittestZTestCaserr>mainr r r r sG