ϪfdZddlZddlmZej5ej deddlmZm Z m Z m Z m Z m Z dddGddeZGd d ZGd d eeZGd deeZGddZGddeeeZGddeeZGddeeZGddeeZGddeeZGddeZGdde ZGdd e ZGd!d"e ZGd#d$e ZGd%d&eZy#1swYxYw)'z- Unit tests for L{twisted.python.constants}. N)TestCaseignore)category) FlagConstantFlags NamedConstantNames ValueConstantValuesc4eZdZdZdZdZdZdZdZdZ y) NamedConstantTestszy Tests for the L{twisted.python.constants.NamedConstant} class which is used to represent individual values. c0Gddt}||_y)zN Create a dummy container into which constants can be placed. c eZdZy)%NamedConstantTests.setUp..fooN)__name__ __module__ __qualname__D/usr/lib/python3/dist-packages/twisted/python/test/test_constants.pyfoor$s rrN)r container)selfrs rsetUpzNamedConstantTests.setUps  % rct}|j|jdd|jd|jy)z The C{name} attribute of a L{NamedConstant} refers to the value passed for the C{name} parameter to C{_realize}. barN)r_realizer assertEqualnamerrs r test_namezNamedConstantTests.test_name)s3  dnneT2  *rct}|j|jdd|jdt |y)z The string representation of an instance of L{NamedConstant} includes the container the instances belongs to as well as the instance's name. rNz )rrrrreprr s rtest_representationz&NamedConstantTests.test_representation2s3  dnneT2 d4j1rct}|j|jdd|j||k(|j ||k7y)zG A L{NamedConstant} instance compares equal to itself. rN)rrr assertTrue assertFalser s r test_equalityz NamedConstantTests.test_equality;sA dnneT2  % &rct}|j|jddt}|j|jdd|j||k(|j ||k7y)zf Two different L{NamedConstant} instances do not compare equal to each other. rN)rrrr'r&rfirstseconds rtest_nonequalityz#NamedConstantTests.test_nonequalityDs\  t~~ud3t4 &) (rct}|j|jddt}|j|jdd|jt |t |y)z Because two different L{NamedConstant} instances do not compare as equal to each other, they also have different hashes to avoid collisions when added to a C{dict} or C{set}. rN)rrrassertNotEqualhashr*s r test_hashzNamedConstantTests.test_hashPsR  t~~ud3t4 DKf6rN) rrr__doc__rr!r$r(r-r1rrrr r s% +2' ) 7rr ceZdZdZdZdZy)_ConstantsTestsMixinz\ Mixin defining test helpers common to multiple types of constants collections. cl|jt|}|j|dzt|y)z Assert that an attempt to instantiate the constants class raises C{TypeError}. @param name: A C{str} giving the name of the constants collection. @param cls: The constants class to test. z may not be instantiated.N) assertRaises TypeErrorrstr)rrclsexcs r_notInstantiableTestz)_ConstantsTestsMixin._notInstantiableTestcs0 3/  ;;SXFrcp|j}t|||j}|j||y)aX Assert that C{container._enumerants} does not change as a side-effect of one of its attributes being accessed. @param container: A L{_ConstantsContainer} subclass which will be tested. @param constantName: The name of one of the constants which is an attribute of C{container}. N) _enumerantsgetattrassertIs)rr constantNamer+r,s r_initializedOnceTestz)_ConstantsTestsMixin._initializedOnceTestns4%%  <(&& eV$rN)rrrr2r;rArrrr4r4]s G%rr4cpeZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd ZdZdZdZdZy) NamesTestszn Tests for L{twisted.python.constants.Names}, a base class for containers of related constraints. c0Gddt}||_y)z Create a fresh new L{Names} subclass for each unit test to use. Since L{Names} is stateful, re-using the same subclass across test methods makes exercising all of the implementation code paths difficult. cVeZdZdZeZeZeZeZe Z y) NamesTests.setUp..METHODzm A container for some named constants to use in unit tests for L{Names}. N) rrrr2rGETPUTPOSTDELETEobjectextrarrrMETHODrFs,   /C/C ?D"_FHErrMN)r rM)rrMs rrzNamesTests.setUps U  rc<|jd|jy)zm A subclass of L{Names} raises C{TypeError} if an attempt is made to instantiate it. rMN)r;rMrs rtest_notInstantiablezNamesTests.test_notInstantiable !!(DKK8rc,|jt|jd|jt|jd|jt|jd|jt|jdy)z Each name associated with a L{NamedConstant} instance in the definition of a L{Names} subclass is available as an attribute on the resulting class. rGrHrIrJN)r&hasattrrMrOs rtest_symbolicAttributesz"NamesTests.test_symbolicAttributess`  U34  U34  V45  X67rcN|jt|jdy)z As usual, names not defined in the class scope of a L{Names} subclass are not available as attributes on the resulting class. rN)r'rSrMrOs rtest_withoutOtherAttributesz&NamesTests.test_withoutOtherAttributes e45rcb|jdt|jjy)z The string representation of a constant on a L{Names} subclass includes the name of the L{Names} subclass and the name of the constant itself. z N)rr#rMrGrOs rr$zNamesTests.test_representations! dkkoo)>?rc|jjd}|j|jj|y)zQ Constants can be looked up by name using L{Names.lookupByName}. rGN)rM lookupByNamer?rGrmethods rtest_lookupByNamezNamesTests.test_lookupByNames.))%0 dkkoov.rc\|jt|jjd|jt|jjd|jt|jjd|jt|jjdy)z} Names not defined with a L{NamedConstant} instance cannot be looked up using L{Names.lookupByName}. rZ__init__rrLN)r6 ValueErrorrMrZrOs rtest_notLookupMissingByNamez&NamesTests.test_notLookupMissingByNamest *dkk&>&>O *dkk&>&> K *dkk&>&>F *dkk&>&>Hrcd|jd|jjjy)zi The C{name} attribute of one of the named constants gives that constant's name. rGN)rrMrGrrOs rr!zNamesTests.test_names"   4 45rcx|j|jj|jjy)z Repeated access of an attribute associated with a L{NamedConstant} value in a L{Names} subclass results in the same object. N)r?rMrGrOs rtest_attributeIdentityz!NamesTests.test_attributeIdentitys" dkkoot{{7rct|jj}|j|jj|jj |jj |jjg|y)z L{Names.iterconstants} returns an iterator over all of the constants defined in the class, in the order they were defined. N)listrM iterconstantsrrGrHrIrJr constantss rtest_iterconstantszNamesTests.test_iterconstantss\ 2245   [[__dkkoot{{/?/?ASAS T  rct|jj}|j|jj|d|j|jj |d|j|jj |d|j|jj|dy)z The constants returned from L{Names.iterconstants} are identical to the constants accessible using attributes. rN)rfrMrgr?rGrHrIrJrhs r#test_attributeIterconstantsIdentityz.NamesTests.test_attributeIterconstantsIdentitys 2245  dkkooy|4 dkkooy|4 dkk&& ! 5 dkk(()A,7rcPt|jj}t|jj}|j|d|d|j|d|d|j|d|d|j|d|dy)zw The constants returned from L{Names.iterconstants} are identical on each call to that method. rrlrmrnN)rfrMrgr?rriagains rtest_iterconstantsIdentityz%NamesTests.test_iterconstantsIdentitys 2245 T[[..01 eAh ! - eAh ! - eAh ! - eAh ! -rc<|j|jdy)zn L{Names._enumerants} is initialized once and its value re-used on subsequent access. rGN)rArMrOs rtest_initializedOncezNamesTests.test_initializedOnces !!$++u5rc~Gfdd}jjj|jy)z A constant defined on a L{Names} subclass may be set as an attribute of another class and then retrieved using that attribute. c<eZdZWjjZy)8NamesTests.test_asForeignClassAttribute..AnotherNrrrrMrG somethingrOsrAnotherrx  Irr{Nr?rMrGrzrr{s` rtest_asForeignClassAttributez'NamesTests.test_asForeignClassAttributes+  ( ( dkkoow'8'89rcGfdd}jjj|jy)z A constant defined on a L{Names} subclass may be set as an attribute of another class and then retrieved from an instance of that class using that attribute. c<eZdZWjjZy)CNamesTests.test_asForeignClassAttributeViaInstance..AnotherNryrOsrr{rr|rr{Nr}r~s` r'test_asForeignClassAttributeViaInstancez2NamesTests.test_asForeignClassAttributeViaInstances- ( ( dkkoowy':':;rcrfd}jt|}jdt|y)z It is explicitly disallowed (via a L{ValueError}) to use a constant defined on a L{Names} subclass as the value of an attribute of another L{Names} subclass. c(Gfddt}y)Nc<eZdZWjjZy)XNamesTests.test_notAsAlternateContainerAttribute..defineIt..AnotherNamesNryrOsr AnotherNamesr%s KKOO rr)r )rrs rdefineItzBNamesTests.test_notAsAlternateContainerAttribute..defineIt$s ,u ,rzDCannot use as the value of an attribute on AnotherNamesN)r6r`rr8)rrr:s` r%test_notAsAlternateContainerAttributez0NamesTests.test_notAsAlternateContainerAttributes4 , H5  U H rN)rrrr2rrPrTrVr$r]rar!rdrjrorsrurrrrrrrCrCsY ,9 86@/I68   8 .6 : < rrCcpeZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd ZdZdZdZdZy) ValuesTestsz Tests for L{twisted.python.constants.Names}, a base class for containers of related constraints with arbitrary values. c0Gddt}||_y)z Create a fresh new L{Values} subclass for each unit test to use. Since L{Values} is stateful, re-using the same subclass across test methods makes exercising all of the implementation code paths difficult. c,eZdZedZedZy)!ValuesTests.setUp..STATUS200404N)rrrr OK NOT_FOUNDrrrSTATUSr<su%B%e,IrrN)r r)rrs rrzValuesTests.setUp5s -V - rc<|jd|jy)zn A subclass of L{Values} raises C{TypeError} if an attempt is made to instantiate it. rN)r;rrOs rrPz ValuesTests.test_notInstantiableBrQrc|jt|jd|jt|jdy)z Each name associated with a L{ValueConstant} instance in the definition of a L{Values} subclass is available as an attribute on the resulting class. rrN)r&rSrrOs rrTz#ValuesTests.test_symbolicAttributesIs2  T23  [9:rcN|jt|jdy)z As usual, names not defined in the class scope of a L{Values} subclass are not available as attributes on the resulting class. rN)r'rSrrOs rrVz'ValuesTests.test_withoutOtherAttributesRrWrcb|jdt|jjy)z The string representation of a constant on a L{Values} subclass includes the name of the L{Values} subclass and the name of the constant itself. z N)rr#rrrOs rr$zValuesTests.test_representationYs! T[[^^(<=rc|jjd}|j|jj|y)zR Constants can be looked up by name using L{Values.lookupByName}. rN)rrZr?rr[s rr]zValuesTests.test_lookupByNameas.))$/ dkknnf-rc|jt|jjd|jt|jjd|jt|jjdy)z~ Names not defined with a L{ValueConstant} instance cannot be looked up using L{Values.lookupByName}. rZr_rN)r6r`rrZrOs rraz'ValuesTests.test_notLookupMissingByNamehsX *dkk&>&>O *dkk&>&> K *dkk&>&>Frc|jjd}|j|jj|y)z Constants can be looked up by their associated value, defined by the argument passed to L{ValueConstant}, using L{Values.lookupByValue}. rN)r lookupByValuer?r)rstatuss rtest_lookupByValuezValuesTests.test_lookupByValueqs. **51 dkknnf-rcxGddt}|j|jd|jy)z If more than one constant is associated with a particular value, L{Values.lookupByValue} returns whichever of them is defined first. c0eZdZdZedZedZy)BValuesTests.test_lookupDuplicateByValue..TRANSPORT_MESSAGEzF Message types supported by an SSH transport. N)rrrr2r KEX_DH_GEX_REQUEST_OLD KEXDH_INITrrrTRANSPORT_MESSAGErs &32%6 "&r*JrrrN)r r?rr)rrs rtest_lookupDuplicateByValuez'ValuesTests.test_lookupDuplicateByValueys3  + +  + +B /  4 4 rc|jt|jjd|jt|jjd|jt|jjdy)z L{Values.lookupByValue} raises L{ValueError} when called with a value with which no constant is associated. rz200.1N)r6r`rrrOs rtest_notLookupMissingByValuez(ValuesTests.test_notLookupMissingByValuesX *dkk&?&?F *dkk&?&?E *dkk&?&?Ircd|jd|jjjy)c The C{name} attribute of one of the constants gives that constant's name. rN)rrrrrOs rr!zValuesTests.test_names" t{{~~223rcx|j|jj|jjy)z Repeated access of an attribute associated with a L{ValueConstant} value in a L{Values} subclass results in the same object. N)r?rrrOs rrdz"ValuesTests.test_attributeIdentitys" dkknndkknn5rct|jj}|j|jj|jj g|y)z L{Values.iterconstants} returns an iterator over all of the constants defined in the class, in the order they were defined. N)rfrrgrrrrhs rrjzValuesTests.test_iterconstantssB 2245  $++..$++*?*?@)Lrct|jj}|j|jj|d|j|jj |dy)z The constants returned from L{Values.iterconstants} are identical to the constants accessible using attributes. rrlN)rfrrgr?rrrhs rroz/ValuesTests.test_attributeIterconstantsIdentitysQ 2245  dkknnil3 dkk++Yq\:rct|jj}t|jj}|j|d|d|j|d|dy)zx The constants returned from L{Values.iterconstants} are identical on each call to that method. rrlN)rfrrgr?rqs rrsz&ValuesTests.test_iterconstantsIdentitys^ 2245 T[[..01 eAh ! - eAh ! -rc<|j|jdy)zo L{Values._enumerants} is initialized once and its value re-used on subsequent access. rN)rArrOs rruz ValuesTests.test_initializedOnces !!$++t4rN)rrrr2rrPrTrVr$r]rarrrr!rdrjrorsrurrrrr/sZ 9;6>.G. &J46M;.5rrceZdZdZdZy)_FlagsTestsMixinz Mixin defining setup code for any tests for L{Flags} subclasses. @ivar FXF: A L{Flags} subclass created for each test method. c0Gddt}||_y)z Create a fresh new L{Flags} subclass for each unit test to use. Since L{Flags} is stateful, re-using the same subclass across test methods makes exercising all of the implementation code paths difficult. cTeZdZeZeZeZedZeZy)#_FlagsTestsMixin.setUp..FXF N) rrrrREADWRITEAPPEND EXCLUSIVETEXTrrrFXFrs,>D NE!^F%T*I >DrrN)rr)rrs rrz_FlagsTestsMixin.setUps "% "rN)rrrr2rrrrrrs  rrcjeZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd ZdZdZdZy) FlagsTestsz Tests for L{twisted.python.constants.Flags}, a base class for containers of related, combinable flag or bitvector-like constants. c<|jd|jy)zm A subclass of L{Flags} raises L{TypeError} if an attempt is made to instantiate it. rN)r;rrOs rrPzFlagsTests.test_notInstantiables !!%2rcv|jt|jd|jt|jd|jt|jd|jt|jd|jt|jdy)z Each name associated with a L{FlagConstant} instance in the definition of a L{Flags} subclass is available as an attribute on the resulting class. rrrrrN)r&rSrrOs rrTz"FlagsTests.test_symbolicAttributessw &12 '23 (34 +67 &12rcN|jt|jdy)z As usual, names not defined in the class scope of a L{Flags} subclass are not available as attributes on the resulting class. rN)r'rSrrOs rrVz&FlagsTests.test_withoutOtherAttributess 512rcb|jdt|jjy)z The string representation of a constant on a L{Flags} subclass includes the name of the L{Flags} subclass and the name of the constant itself. z N)rr#rrrOs rr$zFlagsTests.test_representations! tDHHMM':;rc|jjd}|j|jj|y)zQ Constants can be looked up by name using L{Flags.lookupByName}. rN)rrZr?rrflags rr]zFlagsTests.test_lookupByName s.xx$$V, dhhmmT*rc|jt|jjd|jt|jjd|jt|jjdy)z| Names not defined with a L{FlagConstant} instance cannot be looked up using L{Flags.lookupByName}. rZr_rN)r6r`rrZrOs rraz&FlagsTests.test_notLookupMissingByNamesX *dhh&;&;^L *dhh&;&;ZH *dhh&;&;UCrc|jjd}|j||jj|jjd}|j||jj|jjd}|j||jj |jjd}|j||jj |jjd}|j||jjy)z Constants can be looked up by their associated value, defined implicitly by the position in which the constant appears in the class definition or explicitly by the argument passed to L{FlagConstant}. rlrmr@N)rrr?rrrrrrs rrzFlagsTests.test_lookupByValues xx%%d+ dDHHMM*xx%%d+ dDHHNN+xx%%d+ dDHHOO,xx%%d+ dDHH../xx%%d+ dDHHMM*rcxGddt}|j|jd|jy)z If more than one constant is associated with a particular value, L{Flags.lookupByValue} returns whichever of them is defined first. c,eZdZedZedZy)5FlagsTests.test_lookupDuplicateByValue..TIMEXrlN)rrrr ADJ_OFFSET MOD_OFFSETrrrTIMEXr6s%f-J&f-JrrrlN)rr?rr)rrs rrz&FlagsTests.test_lookupDuplicateByValue0s/  .E . e))&153C3CDrcZ|jt|jjdy)z L{Flags.lookupByValue} raises L{ValueError} when called with a value with which no constant is associated. N)r6r`rrrOs rrz'FlagsTests.test_notLookupMissingByValue?s *dhh&<&N)rrrrr#rs rr$z-FlagConstantSimpleOrTests.test_representations3 xx}}txx~~- -tDz:rc|jt|jj|jjzt|jt|jj|jjh|jt|jj|jj z|jj|jj hy)z A L{FlagConstant} instance which results from C{|} can be iterated upon to yield the original constants. N)rsetrrrrrOs r test_iteratez&FlagConstantSimpleOrTests.test_iterates TXX^^dhhmm;?  !3!33 4 XX^^TXX// 0 rc|jj|jjz}|j|jj||j |jj |y)zj A L{FlagConstant} instance which results from C{|} can be tested for membership. N)rrrassertIn assertNotInr)rflagss rtest_membershipz)FlagConstantSimpleOrTests.test_membershipsN !3!33 dhhnne, .rc>|j|jj|j|jj|jjz|j |jj|jjzy)z@ Empty flags is false, non-empty flags is true. N)r&rrrr'rOs rtest_truthinessz)FlagConstantSimpleOrTests.test_truthinesss` ' ););;< $((*<*<<=rN) rrrr2rr!r$rrrrrrrrs& Q4;  />rrc"eZdZdZdZdZdZy)FlagConstantSimpleAndTestsz Tests for the C{&} operator as defined for L{FlagConstant} instances, used to create new L{FlagConstant} instances representing the common parts of two existing L{FlagConstant} instances from the same L{Flags} class. c6|jj|jjz}|jj|jjz}||z}|j |jjj |j y)z The value of the L{FlagConstant} which results from C{&} has all of the bits set which were set in both of the values of the two original constants. Nrrrrrrr readWrite writeAppendrs rrz%FlagConstantSimpleAndTests.test_valuesd HHMMDHHNN2 hhnntxx6 ;& --tzz:rc|jj|jjz}|jj|jjz}||z}|j d|j y)z The name of the L{FlagConstant} instance which results from C{&} includes the names of only the flags which were set in both of the two original constants. rNrrrrrrrs rr!z$FlagConstantSimpleAndTests.test_namesV HHMMDHHNN2 hhnntxx6 ;& $)),rc|jj|jjz}|jj|jjz}||z}|j dt |y)z The string representation of a L{FlagConstant} instance which results from C{&} includes the names of only the flags which were set in both both of the two original constants. z Nrrrrrr#rs rr$z.FlagConstantSimpleAndTests.test_representationsV HHMMDHHNN2 hhnntxx6 ;& T 3rNrrrr2rr!r$rrrrrs ; - 4rrc"eZdZdZdZdZdZy)"FlagConstantSimpleExclusiveOrTestsz Tests for the C{^} operator as defined for L{FlagConstant} instances, used to create new L{FlagConstant} instances representing the uncommon parts of two existing L{FlagConstant} instances from the same L{Flags} class. cx|jj|jjz}|jj|jjz}||z }|j |jjj |jjj z|j y)z The value of the L{FlagConstant} which results from C{^} has all of the bits set which were set in exactly one of the values of the two original constants. Nrrs rrz-FlagConstantSimpleExclusiveOrTests.test_valuesw HHMMDHHNN2 hhnntxx6 ;& ,,txx/D/DDdjjQrc|jj|jjz}|jj|jjz}||z }|j d|j y)z The name of the L{FlagConstant} instance which results from C{^} includes the names of only the flags which were set in exactly one of the two original constants. z {APPEND,READ}Nrrs rr!z,FlagConstantSimpleExclusiveOrTests.test_namesV HHMMDHHNN2 hhnntxx6 ;& $))4rc|jj|jjz}|jj|jjz}||z }|j dt |y)z The string representation of a L{FlagConstant} instance which results from C{^} includes the names of only the flags which were set in exactly one of the two original constants. zNrrs rr$z6FlagConstantSimpleExclusiveOrTests.test_representation sW HHMMDHHNN2 hhnntxx6 ;& .T ;rNrrrrrrs R 5 N)rrrr#rs rr$z-FlagConstantNegationTests.test_representation=s(  =tDzJrNrrrrrrs  .DKrrceZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd ZdZdZdZdZdZdZdZdZy)OrderedConstantsTestsz Tests for the ordering of constants. All constants are ordered by the order in which they are defined in their container class. The ordering of constants that are not in the same container is not defined. cd|jtjtjky)zs L{twisted.python.constants.NamedConstant} preserves definition order in C{<} comparisons. Nr& NamedLettersalphabetarOs rtest_orderedNameConstants_ltz2OrderedConstantsTests.test_orderedNameConstants_ltOs!  **\->->>?rc|jtjtjk|jtjtjky)zt L{twisted.python.constants.NamedConstant} preserves definition order in C{<=} comparisons. NrrOs rtest_orderedNameConstants_lez2OrderedConstantsTests.test_orderedNameConstants_leVs>  **l.@.@@A  **l.?.??@rcd|jtjtjkDy)zs L{twisted.python.constants.NamedConstant} preserves definition order in C{>} comparisons. N)r&rrrrOs rtest_orderedNameConstants_gtz2OrderedConstantsTests.test_orderedNameConstants_gt^s!  ))L,>,>>?rc|jtjtjk\|jtjtjk\y)zt L{twisted.python.constants.NamedConstant} preserves definition order in C{>=} comparisons. NrrOs rtest_orderedNameConstants_gez2OrderedConstantsTests.test_orderedNameConstants_gees>  **l.@.@@A  ))\-?-??@rc|jtjtjk|jtjtjky)zs L{twisted.python.constants.ValueConstant} preserves definition order in C{<} comparisons. Nr& ValuedLettersrdigammazetarOs rtest_orderedValueConstants_ltz3OrderedConstantsTests.test_orderedValueConstants_ltms>  ++m.C.CCD  -- 0B0BBCrc$|jtjtjk|jtjtjk|jtjtjky)zt L{twisted.python.constants.ValueConstant} preserves definition order in C{<=} comparisons. NrrOs rtest_orderedValueConstants_lez3OrderedConstantsTests.test_orderedValueConstants_leus[  ++}/B/BBC  ++}/D/DDE  --1C1CCDrc|jtjtjkD|jtjtjkDy)zs L{twisted.python.constants.ValueConstant} preserves definition order in C{>} comparisons. N)r&rrrrrOs rtest_orderedValueConstants_gtz3OrderedConstantsTests.test_orderedValueConstants_gt~s>  -- 0C0CCD  **]-B-BBCrc$|jtjtjk\|jtjtjk\|jtjtjk\y)zt L{twisted.python.constants.ValueConstant} preserves definition order in C{>=} comparisons. NrrOs rtest_orderedValueConstants_gez3OrderedConstantsTests.test_orderedValueConstants_ges[  ++}/B/BBC  --1D1DDE  **m.C.CCDrc|jtjtjk|jtjtjky)zr L{twisted.python.constants.FlagConstant} preserves definition order in C{<} comparisons. Nr& PizzaToppings mozzarellapesto pepperonirOs rtest_orderedFlagConstants_ltz2OrderedConstantsTests.test_orderedFlagConstants_lts>  00=3F3FFG  ++m.E.EEFrc$|jtjtjk|jtjtjk|jtjtjky)zs L{twisted.python.constants.FlagConstant} preserves definition order in C{<=} comparisons. NrrOs rtest_orderedFlagConstants_lez2OrderedConstantsTests.test_orderedFlagConstants_les[  00M4L4LLM  00M4G4GGH  ++}/F/FFGrc|jtjtjkD|jtjtjkDy)zr L{twisted.python.constants.FlagConstant} preserves definition order in C{>} comparisons. N)r&rrrrrOs rtest_orderedFlagConstants_gtz2OrderedConstantsTests.test_orderedFlagConstants_gts>  ++m.F.FFG  //-2E2EEFrc$|jtjtjk\|jtjtjk\|jtjtjk\y)zs L{twisted.python.constants.FlagConstant} preserves definition order in C{>=} comparisons. NrrOs rtest_orderedFlagConstants_gez2OrderedConstantsTests.test_orderedFlagConstants_ges[  00M4L4LLM  ++}/G/GGH  //=3F3FFGrc|jttjj t jy)z L{twisted.python.constants._Constant.__lt__} returns C{NotImplemented} when comparing constants of different types. N)rNotImplementedrr__lt__rrOs r!test_orderedDifferentConstants_ltz7OrderedConstantsTests.test_orderedDifferentConstants_lt+ ););)B)B=CVCV)WXrc|jttjj t jy)z L{twisted.python.constants._Constant.__le__} returns C{NotImplemented} when comparing constants of different types. N)rr'rr__le__rrOs r!test_orderedDifferentConstants_lez7OrderedConstantsTests.test_orderedDifferentConstants_ler*rc|jttjj t jy)z L{twisted.python.constants._Constant.__gt__} returns C{NotImplemented} when comparing constants of different types. N)rr'rr__gt__rrOs r!test_orderedDifferentConstants_gtz7OrderedConstantsTests.test_orderedDifferentConstants_gtr*rc|jttjj t jy)z L{twisted.python.constants._Constant.__ge__} returns C{NotImplemented} when comparing constants of different types. N)rr'rr__ge__rrOs r!test_orderedDifferentConstants_gez7OrderedConstantsTests.test_orderedDifferentConstants_ger*rc|jttjj t j y)z L{twisted.python.constants._Constant.__lt__} returns C{NotImplemented} when comparing constants belonging to different containers. N)rr'rrr(MoreNamedLettersrrOs r"test_orderedDifferentContainers_ltz8OrderedConstantsTests.test_orderedDifferentContainers_lt/  L..556F6N6NO rc|jttjj t j y)z L{twisted.python.constants._Constant.__le__} returns C{NotImplemented} when comparing constants belonging to different containers. N)rr'rrr,r5rrOs r"test_orderedDifferentContainers_lez8OrderedConstantsTests.test_orderedDifferentContainers_ler7rc|jttjj t j y)z L{twisted.python.constants._Constant.__gt__} returns C{NotImplemented} when comparing constants belonging to different containers. N)rr'rrr/r5rrOs r"test_orderedDifferentContainers_gtz8OrderedConstantsTests.test_orderedDifferentContainers_gtr7rc|jttjj t j y)z L{twisted.python.constants._Constant.__ge__} returns C{NotImplemented} when comparing constants belonging to different containers. N)rr'rrr2r5rrOs r"test_orderedDifferentContainers_gez8OrderedConstantsTests.test_orderedDifferentContainers_ger7rN)rrrr2rrr r rrrrrr!r#r%r)r-r0r3r6r9r;r=rrrrrGs{@A@ADEDEGHGHYYYY    rrc,eZdZdZeZeZy)rz Some letters, named. N)rrrr2rrrrrrrrs OE ?Drrc,eZdZdZeZeZy)r5z# Some more letters, named. N)rrrr2rrrrrrr5r5soG ?Drr5c@eZdZdZedZedZedZy)rz? Some more letters, with corresponding unicode values. uΑuϜuΖN)rrrr2r rrrrrrrrs' ( #EH%G  "Drrc@eZdZdZedZedZedZy)rzH Some pizza toppings, with obviously meaningful bitwise values. rmrrN)rrrr2rrrrrrrrrs'f%J  EV$IrrceZdZdZdZy)ConstantsDeprecationTestsz4 L{twisted.python.constants} is deprecated. cddlm}||j|jg}|j dt ||j d|ddy)zO L{twisted.python.constants} is deprecated since Twisted 16.5. r)rirlzctwisted.python.constants was deprecated in Twisted 16.5.0: Please use constantly from PyPI instead.messageN)twisted.pythonri flushWarningstest_constantsDeprecationrlen)rri warningsShowns rrHz3ConstantsDeprecationTests.test_constantsDeprecation$sZ -**D,J,J+KL  C ./ ; ! Y '  rN)rrrr2rHrrrrCrCs  rrC)r2warningstwisted.trial.unittestrcatch_warnings simplefilterDeprecationWarningtwisted.python.constantsrrrr r r r r4rCrrrrrrrrrr5rrrCrrrrQs= +X H(-?@ A7A7H"%"%Jj /j ZT5(0T5n<_4!8-A_4D;> 0(;>|&4!18&4R&<)98&