+
    Z4ieJ  ã                   óŒ   € ^ RI H t Ht ^ RIHt ^ RIHtHtHtHt ^ RI	H
t
Ht  ! R R]4      t ! R R]4      t ! R	 R
]4      tR# )é    )ÚdatetimeÚtimezone)ÚResourcedTestCase)ÚFakeLaunchpadÚFakeResourceÚFakeRootÚIntegrityError)ÚFakeLaunchpadResourceÚget_applicationc                   ó&   a € ] tR t^#t o R tRtV tR# )ÚFakeRootTestc                ój   € \        \        4       4      pV P                  \        V\        4      4       R # ©N)r   r   Ú
assertTrueÚ
isinstancer   )ÚselfÚroot_resources   & ÚK/usr/lib/python3/dist-packages/launchpadlib/testing/tests/test_launchpad.pyÚtest_create_root_resourceÚ&FakeRootTest.test_create_root_resource$   s"   € Ü ¤Ó!2Ó3ˆØ�‰œ
 =´,Ó?Ö@ó    © N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__r   Ú__static_attributes__Ú__classdictcell__©Ú__classdict__s   @r   r   r   #   s   ø‡ € ÷Að Ar   r   c                   óL   a € ] tR t^)t o R]! 4       3.tR tR tR tR t	Rt
V tR# )ÚFakeResourceTestÚ	launchpadc                óü   € \        4       p\        V.R7      V P                  n        \        V P                  P                  4      w  pV P	                  R\        \        V4      4      ,          \        V4      4       R# )z3A custom C{__repr__} is provided for L{FakeEntry}s.©Úentriesz<FakeEntry bug object at %s>N©Údictr#   ÚbugsÚlistÚassertEqualÚhexÚidÚrepr©r   Úbugs   & r   Útest_repr_entryÚ FakeResourceTest.test_repr_entry-   sV   € ä‹fˆÜ"¨C¨5Ô1ˆ�‰ÔÜ�T—^‘^×(Ñ(Ó)‰ˆØ×ÑØ*¬S´°C³«\Õ9¼4À»9ö	
r   c                ó  a€ \        RR7      o\        V3R lR7      V P                  n        V P                  P                  P                  . 4      o\	        \        S4      4      pV P                  RV,          \        S4      4       R# )z8A custom C{__repr__} is provided for L{FakeCollection}s.útest-branch©Ú
total_sizec                 ó   <€ S# r   r   ©ÚstatusesÚbranchess   &€r   Ú<lambda>Ú7FakeResourceTest.test_repr_collection.<locals>.<lambda>9   ó   ø€ ¹hr   ©ÚgetBranchesz2<FakeCollection branch-page-resource object at %s>N)r(   r#   Úmer?   r,   r-   r+   r.   )r   Úobj_idr:   s   & @r   Útest_repr_collectionÚ%FakeResourceTest.test_repr_collection6   sd   ø€ ä =Ô1ˆÜ Ô-FÔGˆ�‰ÔØ—>‘>×$Ñ$×0Ñ0°Ó4ˆÜ”R˜“\Ó"ˆØ×ÑØ@À6ÕIÜ�‹Nö	
r   c                óÐ   € \        RR7      V P                  n        V P                  P                  pV P                  R\	        \        V4      4      ,          \        V4      4       R# )zq
If the fake has a C{name} property it's included in the repr string to
make it easier to figure out what it is.
Úfoo©Únamez<FakeEntry person foo at %s>N)r(   r#   r@   r+   r,   r-   r.   ©r   Úpersons   & r   Útest_repr_with_nameÚ$FakeResourceTest.test_repr_with_nameA   sH   € ô
 ! eÔ,ˆ�‰ÔØ—‘×"Ñ"ˆØ×ÑØ*¬S´°F³«_Õ<¼dÀ6»lö	
r   c                ó  € \        RRR7      p\        V.R7      V P                  n        \        V P                  P                  4      w  pV P	                  R\        \        V4      4      ,          \        V4      4       R# )zp
If the fake has an C{id} property it's included in the repr string to
make it easier to figure out what it is.
Ú1úBug #1©r-   Útitler%   z<FakeEntry bug 1 at %s>Nr'   r/   s   & r   Útest_repr_with_idÚ"FakeResourceTest.test_repr_with_idL   s[   € ô
 �c Ô*ˆÜ"¨C¨5Ô1ˆ�‰ÔÜ�T—^‘^×(Ñ(Ó)‰ˆØ×ÑÐ2´S¼¸C»³\ÕAÄ4ÈÃ9ÖMr   r   N)r   r   r   r   r
   Ú	resourcesr1   rB   rJ   rQ   r   r   r   s   @r   r"   r"   )   s1   ø‡ € àÑ4Ó6Ð7Ð8€Iò
ò	
ò	
÷Nð Nr   r"   c                   ó0  a € ] tR t^Wt o R]! 4       3.tR tR tR tR t	R t
R tR tR	 tR
 tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR t R t!R t"R t#R  t$R! t%R" t&R# t'R$ t(R% t)R& t*R' t+R( t,R) t-R* t.R+ t/R,t0V t1R-# ).ÚFakeLaunchpadTestr#   c                ó®   € \        4       p\        V4      pV P                  WP                  4       V P                  \	        4       VP
                  4       R# )za
The builtin WADL definition is used if the C{application} is not
provided during instantiation.
N)Úobjectr   r+   Úcredentialsr   Ú_application©r   rX   r#   s   &  r   Ú'test_wb_instantiate_without_applicationÚ9FakeLaunchpadTest.test_wb_instantiate_without_application[   sB   € ô
 “hˆÜ! +Ó.ˆ	Ø×Ñ˜×&;Ñ&;Ô<Ø×ÑœÓ*¨I×,BÑ,BÖCr   c           	     ó‚   € \        4       p\        VRRRR\        4       R7      pV P                  WP                  4       R# )zÌ
L{FakeLaunchpad} takes the same parameters as L{Launchpad} during
instantiation, with the addition of an C{application} parameter.  The
optional parameters are discarded when the object is instantiated.
N)Úservice_rootÚcacheÚtimeoutÚ
proxy_infoÚapplication©rW   r   r   r+   rX   rZ   s   &  r   Ú test_instantiate_with_everythingÚ2FakeLaunchpadTest.test_instantiate_with_everythinge   s@   € ô “hˆÜ!ØØØØØÜ'Ó)ô
ˆ	ð 	×Ñ˜×&;Ñ&;Ö<r   c                óz   € \        4       p\        V\        4       R7      pV P                  WP                  4       R# )z8A L{FakeLaunchpad} can be instantiated with credentials.)rb   Nrc   rZ   s   &  r   Ú!test_instantiate_with_credentialsÚ3FakeLaunchpadTest.test_instantiate_with_credentialsv   s,   € ä“hˆÜ! +¼?Ó;LÔMˆ	Ø×Ñ˜×&;Ñ&;Ö<r   c                óP   € V P                  V P                  P                  4       R# )zf
A L{FakeLaunchpad} instantiated without credentials has its
C{credentials} attribute set to C{None}.
N)ÚassertIsNoner#   rX   ©r   s   &r   Ú$test_instantiate_without_credentialsÚ6FakeLaunchpadTest.test_instantiate_without_credentials|   s   € ð
 	×Ñ˜$Ÿ.™.×4Ñ4Ö5r   c                óT   € V P                  \        \        V P                  RR4       R# )z�
An L{IntegrityError} is raised if an attribute is set on a
L{FakeLaunchpad} instance that isn't present in the WADL definition.
rE   ÚbarN)ÚassertRaisesr	   Úsetattrr#   rk   s   &r   Útest_set_undefined_propertyÚ-FakeLaunchpadTest.test_set_undefined_propertyƒ   s!   € ð
 	×ÑÜœG T§^¡^°U¸Eö	
r   c                óœ   € \        RR7      V P                  n        V P                  \        \
        V P                  P                  R4       R# )zo
An L{AttributeError} is raised if an attribute is accessed on a
L{FakeLaunchpad} instance that doesn't exist.
ÚFoo)Údisplay_namerG   N)r(   r#   r@   rp   ÚAttributeErrorÚgetattrrk   s   &r   Útest_get_undefined_resourceÚ-FakeLaunchpadTest.test_get_undefined_resourceŒ   s3   € ô
 !¨eÔ4ˆ�‰ÔØ×Ñœ.¬'°4·>±>×3DÑ3DÀfÖMr   c                óœ   € \        RR7      V P                  n        V P                  RV P                  P                  P                  4       R# )z 
Sample data can be created by setting L{FakeLaunchpad} attributes with
dicts that represent objects.  Plain string values can be represented
as C{str} values.
rE   rF   N©r(   r#   r@   r+   rG   rk   s   &r   Útest_string_propertyÚ&FakeLaunchpadTest.test_string_property”   ó5   € ô ! eÔ,ˆ�‰ÔØ×Ñ˜ §¡× 1Ñ 1× 6Ñ 6Ö7r   c                óœ   € \        RR7      V P                  n        V P                  RV P                  P                  P                  4       R# )z¥
Sample data can be created by setting L{FakeLaunchpad} attributes with
dicts that represent objects.  Plain string values can be represented
as C{unicode} strings.
rE   rF   Nr|   rk   s   &r   Útest_unicode_propertyÚ'FakeLaunchpadTest.test_unicode_property�   r   r   c                óâ   € \         P                  ! \        P                  4      p\	        VR7      V P
                  n        V P                  WP
                  P                  P                  4       R# )zE
Attributes that represent dates are set with C{datetime} instances.
©Údate_createdN)	r   Únowr   Úutcr(   r#   r@   r+   r…   )r   r†   s   & r   Útest_datetime_propertyÚ(FakeLaunchpadTest.test_datetime_property¦   sE   € ô �lŠlœ8Ÿ<™<Ó(ˆÜ ¨cÔ2ˆ�‰ÔØ×Ñ˜Ÿn™n×/Ñ/×<Ñ<Ö=r   c           
     óh   € V P                  \        \        V P                  R\	        RR7      4       R# )zg
Only C{datetime} values can be set on L{FakeLaunchpad} instances for
attributes that represent dates.
r@   r†   r„   N©rp   r	   rq   r#   r(   rk   s   &r   Útest_invalid_datetime_propertyÚ0FakeLaunchpadTest.test_invalid_datetime_property®   s*   € ð
 	×ÑÜÜØ�N‰NØÜ˜eÔ$ö	
r   c                óþ   € \        RRR7      V P                  n        V P                  RV P                  P                  P                  4       V P                  RV P                  P                  P
                  4       R# )zf
Sample data can be created by setting L{FakeLaunchpad} attributes with
dicts that represent objects.
rE   ru   )rG   rv   N)r(   r#   r@   r+   rG   rv   rk   s   &r   Útest_multiple_string_propertiesÚ1FakeLaunchpadTest.test_multiple_string_properties»   sW   € ô
 ! e¸%Ô@ˆ�‰ÔØ×Ñ˜ §¡× 1Ñ 1× 6Ñ 6Ô7Ø×Ñ˜ §¡× 1Ñ 1× >Ñ >Ö?r   c           
     óh   € V P                  \        \        V P                  R\	        RR7      4       R# )zÅ
Sample data set on a L{FakeLaunchpad} instance is validated against
the WADL definition.  If a key is defined on a resource that doesn't
match a related parameter, an L{IntegrityError} is raised.
r@   ro   ©rE   Nr‹   rk   s   &r   Útest_invalid_property_nameÚ,FakeLaunchpadTest.test_invalid_property_nameÄ   s%   € ð 	×ÑÜœG T§^¡^°T¼4ÀE¼?ö	
r   c           
     óh   € V P                  \        \        V P                  R\	        ^fR7      4       R# )z
The types of sample data values set on L{FakeLaunchpad} instances are
validated against types defined in the WADL definition.
r@   rF   Nr‹   rk   s   &r   Útest_invalid_property_valueÚ-FakeLaunchpadTest.test_invalid_property_valueÎ   s%   € ð
 	×ÑÜœG T§^¡^°T¼4ÀS¼>ö	
r   c                óÈ   a€ \        RR7      o\        V3R lR7      V P                  n        V P                  RV P                  P                  P	                  . 4      4       R# )z€
A callable set on a L{FakeLaunchpad} instance is validated against the
WADL definition, to make sure a matching method exists.
r4   r5   c                 ó   <€ S# r   r   r8   s   &€r   r;   Ú1FakeLaunchpadTest.test_callable.<locals>.<lambda>Ý   r=   r   r>   N)r(   r#   r@   ÚassertNotEqualr?   ©r   r:   s   &@r   Útest_callableÚFakeLaunchpadTest.test_callable×   sF   ø€ ô
  =Ô1ˆÜ Ô-FÔGˆ�‰ÔØ×Ñ˜D $§.¡.×"3Ñ"3×"?Ñ"?ÀÓ"CÖDr   c           
     ój   € V P                  \        \        V P                  R\	        R R7      4       R# )z�
An L{IntegrityError} is raised if a method is defined on a resource
that doesn't match a method defined in the WADL definition.
r@   c                  ó   € R # r   r   r   r   r   r;   Ú>FakeLaunchpadTest.test_invalid_callable_name.<locals>.<lambda>ê   s   € ™Tr   r’   Nr‹   rk   s   &r   Útest_invalid_callable_nameÚ,FakeLaunchpadTest.test_invalid_callable_nameà   s*   € ð
 	×ÑÜÜØ�N‰NØÜ‘\Ô"ö	
r   c                ó  a€ \        RR7      o\        V3R lR7      V P                  n        V P                  P                  P                  . 4      oV P	                  \        S\        4      4       V P                  RSP                  4       R# )z{
The result of a fake method is a L{FakeResource}, automatically
created from the object used to define the return object.
Ú8r5   c                 ó   <€ S# r   r   r8   s   &€r   r;   ÚDFakeLaunchpadTest.test_callable_object_return_type.<locals>.<lambda>ó   r=   r   r>   N)	r(   r#   r@   r?   r   r   r   r+   r6   rœ   s   &@r   Ú test_callable_object_return_typeÚ2FakeLaunchpadTest.test_callable_object_return_typeí   sd   ø€ ô
  3Ô'ˆÜ Ô-FÔGˆ�‰ÔØ—>‘>×$Ñ$×0Ñ0°Ó4ˆØ�‰œ
 8¬\Ó:Ô;Ø×Ñ˜˜h×1Ñ1Ö2r   c                óÈ   a€ \        ^R7      o\        V3R lR7      V P                  n        V P                  \        V P                  P                  P
                  . 4       R# )zG
An L{IntegrityError} is raised if a method returns an invalid result.
r5   c                 ó   <€ S# r   r   r8   s   &€r   r;   ÚLFakeLaunchpadTest.test_invalid_callable_object_return_type.<locals>.<lambda>ý   r=   r   r>   N)r(   r#   r@   rp   r	   r?   rœ   s   &@r   Ú(test_invalid_callable_object_return_typeÚ:FakeLaunchpadTest.test_invalid_callable_object_return_typeø   sC   ø€ ô  1Ô%ˆÜ Ô-FÔGˆ�‰ÔØ×Ñœ.¨$¯.©.×*;Ñ*;×*GÑ*GÈÖLr   c                ó¦   € \        R R7      V P                  n        V P                  V P                  P                  P	                  R4      4       R# )ze
A fake method passes through a return value of None rather than
trying to create a L{FakeResource}.
c                 ó   € R # r   r   rF   s   &r   r;   ÚDFakeLaunchpadTest.test_callable_object_return_None.<locals>.<lambda>  s   € ÁDr   ©ÚgetByUniqueNamerE   N)r(   r#   r:   rj   r³   rk   s   &r   Ú test_callable_object_return_NoneÚ2FakeLaunchpadTest.test_callable_object_return_None   s9   € ô
 #'Ñ7HÔ"Iˆ�‰ÔØ×Ñ˜$Ÿ.™.×1Ñ1×AÑAÀ%ÓHÖIr   c                óè   a€ \        R R7      o\        V3R lR7      V P                  n        V P                  P                  P                  R4      oV P	                  SP                  4       4       R# )z–
If the WADL definition of a method does not include a response
representation, then fake versions of that method just pass through
the return value.
c                  ó   € R # )Tr   r   r   r   r;   ÚSFakeLaunchpadTest.test_callable_object_no_response_representation.<locals>.<lambda>  s   € ©4r   )ÚcanBeDeletedc                 ó   <€ S# r   r   ©rG   Úbranchs   &€r   r;   r¸     ó   ø€ ÁFr   r²   rE   N)r(   r#   r:   r³   r   r¹   ©r   r¼   s   &@r   Ú/test_callable_object_no_response_representationÚAFakeLaunchpadTest.test_callable_object_no_response_representation  sP   ø€ ô ¡<Ô0ˆÜ"&Ô7JÔ"Kˆ�‰ÔØ—‘×(Ñ(×8Ñ8¸Ó?ˆØ�‰˜×+Ñ+Ó-Ö.r   c                óð   € \        \        RR7      R7      p\        V.R7      V P                  n        V P                  P                  ^ ,          pV P                  RVP                  P
                  4       R# )z`
Attributes that represent links to other objects are set using a
dict representing the object.
ztest-personrF   ©Úownerr%   N)r(   r#   r)   r+   rÃ   rG   r/   s   & r   Útest_entry_propertyÚ%FakeLaunchpadTest.test_entry_property  sR   € ô
 œ =Ô1Ô2ˆÜ"¨C¨5Ô1ˆ�‰ÔØ�n‰n×!Ñ! !Õ$ˆØ×Ñ˜¨¯	©	¯©Ö7r   c           
     ó–   € \        \        RR7      R7      pV P                  \        \        V P                  R\        V.R7      4       R# )z.
Sample data for linked entries is validated.
ro   r’   rÂ   r)   r%   N©r(   rp   r	   rq   r#   r/   s   & r   Útest_invalid_entry_propertyÚ-FakeLaunchpadTest.test_invalid_entry_property  s:   € ô œ %œÔ)ˆØ×ÑÜÜØ�N‰NØÜ˜#˜Ôö	
r   c                óà   a€ \        RR7      o\        V3R lR7      V P                  n        V P                  P                  P                  R4      oV P	                  RSP
                  4       R# )z‰
Sample top-level collections can be set on L{FakeLaunchpad}
instances.  They are validated the same way other sample data is
validated.
rE   rF   c                 ó   <€ S# r   r   r»   s   &€r   r;   ÚFFakeLaunchpadTest.test_top_level_collection_property.<locals>.<lambda>1  r½   r   r²   N)r(   r#   r:   r³   r+   rG   r¾   s   &@r   Ú"test_top_level_collection_propertyÚ4FakeLaunchpadTest.test_top_level_collection_property*  sO   ø€ ô ˜5Ô!ˆÜ"&Ô7JÔ"Kˆ�‰ÔØ—‘×(Ñ(×8Ñ8¸Ó?ˆØ×Ñ˜ §¡Ö,r   c                ó<  a€ \        RR7      p\        \        V.R7      R7      o\        V3R lR7      V P                  n        V P                  P                  P                  R4      o\	        SP
                  4      w  pV P                  RVP                  4       R# )	zs
Attributes that represent links to collections of other objects are
set using a dict representing the collection.
rM   )r-   r%   ©Úlinked_bugsc                 ó   <€ S# r   r   r»   s   &€r   r;   Ú<FakeLaunchpadTest.test_collection_property.<locals>.<lambda><  r½   r   r²   rE   N)r(   r#   r:   r³   r*   rÑ   r+   r-   ©r   r0   r¼   s   & @r   Útest_collection_propertyÚ*FakeLaunchpadTest.test_collection_property5  sq   ø€ ô
 �cŒlˆÜ¤$°¨uÔ"5Ô6ˆÜ"&Ô7JÔ"Kˆ�‰ÔØ—‘×(Ñ(×8Ñ8¸Ó?ˆÜ�V×'Ñ'Ó(‰ˆØ×Ñ˜˜cŸf™fÖ%r   c                óN  € \        RRR7      p\        V.R7      V P                  n        \        V P                  P                  4      pV P	                  ^\        V4      4       V^ ,          pV P	                  RVP                  4       V P	                  RVP                  4       R# )zw
Data for a sample collection set on a L{FakeLaunchpad} instance can be
iterated over if an C{entries} key is defined.
rM   rN   rO   r%   N)r(   r#   r)   r*   r+   Úlenr-   rP   )r   r0   r)   s   &  r   Útest_iterate_collectionÚ)FakeLaunchpadTest.test_iterate_collectionA  s|   € ô
 �c Ô*ˆÜ"¨C¨5Ô1ˆ�‰ÔÜ�D—N‘N×'Ñ'Ó(ˆØ×Ñ˜œC ›IÔ&Ø�1�gˆØ×Ñ˜˜cŸf™fÔ%Ø×Ñ˜ 3§9¡9Ö-r   c           
     ó‚   € \        RR7      pV P                  \        \        V P                  R\        V.R7      4       R# )zg
Sample data for each entry in a collection is validated when it's set
on a L{FakeLaunchpad} instance.
ro   r’   r)   r%   NrÇ   r/   s   & r   Ú.test_top_level_collection_with_invalid_entriesÚ@FakeLaunchpadTest.test_top_level_collection_with_invalid_entriesN  s5   € ô
 �uŒoˆØ×ÑÜÜØ�N‰NØÜ˜#˜Ôö	
r   c                óö   a€ \        RR7      p\        \        V.R7      R7      o\        V3R lR7      V P                  n        V P                  \        V P                  P                  P
                  R4       R# )	z‡
Sample data for each entry in a collection is validated when it's set
on an attribute representing a link to a collection of objects.
ro   r’   r%   rÐ   c                 ó   <€ S# r   r   r»   s   &€r   r;   ÚHFakeLaunchpadTest.test_collection_with_invalid_entries.<locals>.<lambda>c  r½   r   r²   rE   N)r(   r#   r:   rp   r	   r³   rÔ   s   & @r   Ú$test_collection_with_invalid_entriesÚ6FakeLaunchpadTest.test_collection_with_invalid_entries\  sX   ø€ ô
 �uŒoˆÜ¤$°¨uÔ"5Ô6ˆÜ"&Ô7JÔ"Kˆ�‰ÔØ×ÑÜØ�N‰N×#Ñ#×3Ñ3Øö	
r   c                óŠ  € \        RRR7      p\        RRR7      p\        RRR7      p\        WV.R7      V P                  n        V P                  P                  R	,          pV P                  ^\	        V4      4       V P                  RV^ ,          P
                  4       V P                  RV^,          P
                  4       R
# )zp
Data for a sample collection set on a L{FakeLaunchpad} instance can be
sliced if an C{entries} key is defined.
rM   rN   rO   Ú2úBug #2Ú3zBug #3r%   :é   é   NN)r(   r#   r)   r+   rØ   r-   )r   Úbug1Úbug2Úbug3r)   s   &    r   Útest_slice_collectionÚ'FakeLaunchpadTest.test_slice_collectionj  s–   € ô
 �s (Ô+ˆÜ�s (Ô+ˆÜ�s (Ô+ˆÜ"¨D¸Ð+=Ô>ˆ�‰ÔØ�~‰~×"Ñ" 3Õ'ˆØ×Ñ˜œC ›IÔ&Ø×Ñ˜˜d 1�gŸj™jÔ)Ø×Ñ˜˜d 1�gŸj™jÖ)r   c                óÜ   a € \        RRR7      p\        RRR7      p\        W.R7      S P                  n        S P                  \        V 3R l4       S P                  \        V 3R l4       R	# )
z‚
A C{ValueError} is raised if a negative start value is used when
slicing a sample collection set on a L{FakeLaunchpad} instance.
rM   rN   rO   rä   rå   r%   c                  ó6   <€ S P                   P                  RR # )rç   Néÿÿÿÿ©r#   r)   rk   s   €r   r;   ÚMFakeLaunchpadTest.test_slice_collection_with_negative_start.<locals>.<lambda>€  s   ø€ ¨d¯n©n×.AÑ.AÀ"À#Ñ.Fr   c                  ó6   <€ S P                   P                  R^ # )rç   rð   rñ   rk   s   €r   r;   rò   �  s   ø€ ¨d¯n©n×.AÑ.AÀ"ÀQÑ.Gr   N©r(   r#   r)   rp   Ú
ValueError©r   ré   rê   s   f  r   Ú)test_slice_collection_with_negative_startÚ;FakeLaunchpadTest.test_slice_collection_with_negative_startx  óR   ø€ ô
 �s (Ô+ˆÜ�s (Ô+ˆÜ"¨D¨<Ô8ˆ�‰ÔØ×Ñœ*Ô&FÔGØ×Ñœ*Ô&GÖHr   c                óÜ   a € \        RRR7      p\        RRR7      p\        W.R7      S P                  n        S P                  \        V 3R l4       S P                  \        V 3R l4       R	# )
z�
A C{ValueError} is raised if a negative stop value is used when
slicing a sample collection set on a L{FakeLaunchpad} instance.
rM   rN   rO   rä   rå   r%   c                  ó6   <€ S P                   P                  R R # )Nrð   rñ   rk   s   €r   r;   ÚLFakeLaunchpadTest.test_slice_collection_with_negative_stop.<locals>.<lambda>‹  s   ø€ ¨d¯n©n×.AÑ.AÀ#À2Ñ.Fr   c                  ó6   <€ S P                   P                  ^ R # )r   rð   rñ   rk   s   €r   r;   rü   Œ  s   ø€ ¨d¯n©n×.AÑ.AÀ!ÀBÑ.Gr   Nrô   rö   s   f  r   Ú(test_slice_collection_with_negative_stopÚ:FakeLaunchpadTest.test_slice_collection_with_negative_stopƒ  rù   r   c                óŽ   a € \        RRR7      p\        V.R7      S P                  n        S P                  \        V 3R l4       R# )zg
An C{IndexError} is raised if an invalid index is used when retrieving
data from a sample collection.
rM   rN   rO   r%   c                  ó>   <€ S P                   P                  ^,          # )é   rñ   rk   s   €r   r;   ÚHFakeLaunchpadTest.test_subscript_operator_out_of_range.<locals>.<lambda>•  s   ø€ ¨d¯n©n×.AÑ.AÀ!Ö.Dr   N)r(   r#   r)   rp   Ú
IndexError)r   ré   s   f r   Ú$test_subscript_operator_out_of_rangeÚ6FakeLaunchpadTest.test_subscript_operator_out_of_rangeŽ  s5   ø€ ô
 �s (Ô+ˆÜ"¨D¨6Ô2ˆ�‰ÔØ×Ñœ*Ô&DÖEr   c                óF  € \        RR7      V P                  n        V P                  P                  pV P                  RVP                  4       RVn        V P                  RVP                  4       V P                  RV P                  P                  P                  4       R# )z<Values already set on fake resource objects can be replaced.rE   rF   ro   Nr|   rH   s   & r   Útest_replace_propertyÚ'FakeLaunchpadTest.test_replace_property—  sq   € ä  eÔ,ˆ�‰ÔØ—‘×"Ñ"ˆØ×Ñ˜ §¡Ô,ØˆŒØ×Ñ˜ §¡Ô,Ø×Ñ˜ §¡× 1Ñ 1× 6Ñ 6Ö7r   c                ó<  aa€ \        RRR7      o\        RRR7      o\        V3R lR7      V P                  n        V3R lV P                  P                  n        V P                  P                  P                  R4      pV P	                  RVP
                  4       R# )	z=Methods already set on fake resource objects can be replaced.rE   zlp:~user/project/branch1)rG   Úbzr_identityzlp:~user/project/branch2c                 ó   <€ S# r   r   )rG   Úbranch1s   &€r   r;   Ú7FakeLaunchpadTest.test_replace_method.<locals>.<lambda>¤  s   ø€ ÁGr   r²   c                 ó   <€ S# r   r   )rG   Úbranch2s   &€r   r;   r  ¥  s   ø€ ¹wr   N)r(   r#   r:   r³   r+   r  )r   r¼   r  r  s   & @@r   Útest_replace_methodÚ%FakeLaunchpadTest.test_replace_method   sr   ù€ ä˜EÐ0JÔKˆÜ˜EÐ0JÔKˆÜ"&Ô7KÔ"Lˆ�‰ÔÜ2Fˆ�‰×ÑÔ/Ø—‘×(Ñ(×8Ñ8¸Ó?ˆØ×ÑÐ3°V×5HÑ5HÖIr   c                ó¢   € \        RR7      V P                  n        V P                  P                  pV P                  \        \
        VR^4       R# )z2Values set on fake resource objects are validated.rE   rF   rG   N)r(   r#   r@   rp   r	   rq   rH   s   & r   Ú(test_replace_property_with_invalid_valueÚ:FakeLaunchpadTest.test_replace_property_with_invalid_value©  s8   € ä  eÔ,ˆ�‰ÔØ—‘×"Ñ"ˆØ×Ñœ.¬'°6¸6À1ÖEr   c                ó2  € \        RR7      V P                  n        V P                  RV P                  P                  P                  4       \        RR7      V P                  n        V P                  RV P                  P                  P                  4       R# )z:Resources already set on L{FakeLaunchpad} can be replaced.rE   rF   ro   Nr|   rk   s   &r   Útest_replace_resourceÚ'FakeLaunchpadTest.test_replace_resource¯  sd   € ä  eÔ,ˆ�‰ÔØ×Ñ˜ §¡× 1Ñ 1× 6Ñ 6Ô7Ü  eÔ,ˆ�‰ÔØ×Ñ˜ §¡× 1Ñ 1× 6Ñ 6Ö7r   c                ó¦  € \        RR7      V P                  n        V P                  P                  pRVn        V P	                  RVP
                  4       V P	                  RVP                  4       V P	                  RV P                  P                  P
                  4       V P	                  RV P                  P                  P                  4       R# )z?Sample data set on a L{FakeLaunchpad} instance can be added to.rE   rF   ru   N)r(   r#   r@   rv   r+   rG   rH   s   & r   Útest_add_propertyÚ#FakeLaunchpadTest.test_add_property¶  s”   € ä  eÔ,ˆ�‰ÔØ—‘×"Ñ"ˆØ#ˆÔØ×Ñ˜ §¡Ô,Ø×Ñ˜ × 3Ñ 3Ô4Ø×Ñ˜ §¡× 1Ñ 1× 6Ñ 6Ô7Ø×Ñ˜ §¡× 1Ñ 1× >Ñ >Ö?r   c                ó.  € \        4       V P                  n        V P                  \        \
        V P                  P                  R4       RV P                  P                  n        V P                  RV P                  P                  P                  4       R# )z6An empty object can be used when creating sample data.rG   rE   N)r(   r#   r@   rp   rw   rx   rG   r+   rk   s   &r   Ú!test_add_property_to_empty_objectÚ3FakeLaunchpadTest.test_add_property_to_empty_objectÀ  s`   € ä ›Fˆ�‰ÔØ×Ñœ.¬'°4·>±>×3DÑ3DÀfÔMØ!&ˆ�‰×ÑÔØ×Ñ˜ §¡× 1Ñ 1× 6Ñ 6Ö7r   c                ót   € \         P                  ! RRR4      pV P                  \        V\         4      4       R# )zm
L{FakeLaunchpad.login} ignores all parameters and returns a new
instance using the builtin WADL definition.
rG   ÚtokenÚsecretN)r   Úloginr   r   ©r   r#   s   & r   Ú
test_loginÚFakeLaunchpadTest.test_loginÇ  s+   € ô
 "×'Ò'¨°¸ÓBˆ	Ø�‰œ
 9¬mÓ<Ö=r   c                óp   € \         P                  ! R4      pV P                  \        V\         4      4       R# )z{
L{FakeLaunchpad.get_token_and_login} ignores all parameters and
returns a new instance using the builtin WADL definition.
rG   N)r   Úget_token_and_loginr   r   r#  s   & r   Útest_get_token_and_loginÚ*FakeLaunchpadTest.test_get_token_and_loginÏ  s'   € ô
 "×5Ò5°fÓ=ˆ	Ø�‰œ
 9¬mÓ<Ö=r   c                óp   € \         P                  ! R4      pV P                  \        V\         4      4       R# )zr
L{FakeLaunchpad.login_with} ignores all parameters and returns a new
instance using the builtin WADL definition.
rG   N)r   Ú
login_withr   r   r#  s   & r   Útest_login_withÚ!FakeLaunchpadTest.test_login_with×  s'   € ô
 "×,Ò,¨VÓ4ˆ	Ø�‰œ
 9¬mÓ<Ö=r   c                ó¢   € \        RR7      V P                  n        V P                  V P                  P                  P	                  4       4       R# )zE
Sample object have an C{lp_save} method that is a no-op by default.
rE   rF   N)r(   r#   r@   r   Úlp_saverk   s   &r   Útest_lp_saveÚFakeLaunchpadTest.test_lp_saveß  s4   € ô ! eÔ,ˆ�‰ÔØ�‰˜Ÿ™×)Ñ)×1Ñ1Ó3Ö4r   c                ó¨   € \        RR R7      V P                  n        V P                  RV P                  P                  P	                  4       4       R# )z;A custom C{lp_save} method can be set on a L{FakeResource}.rE   c                  ó   € R # ©Úcustomr   r   r   r   r;   Ú7FakeLaunchpadTest.test_custom_lp_save.<locals>.<lambda>è  s   € ¹Xr   )rG   r/  r5  N)r(   r#   r@   r+   r/  rk   s   &r   Útest_custom_lp_saveÚ%FakeLaunchpadTest.test_custom_lp_saveæ  s9   € ä  eÑ5EÔFˆ�‰ÔØ×Ñ˜ 4§>¡>×#4Ñ#4×#<Ñ#<Ó#>Ö?r   c                óÜ   € \        RR7      V P                  n        R V P                  P                  n        V P	                  RV P                  P                  P                  4       4       R# )zT
A custom C{lp_save} method can be set on a L{FakeResource} after its
been created.
rE   rF   c                  ó   € R # r4  r   r   r   r   r;   Ú;FakeLaunchpadTest.test_set_custom_lp_save.<locals>.<lambda>ñ  s   € ©Hr   r5  N)r(   r#   r@   r/  r+   rk   s   &r   Útest_set_custom_lp_saveÚ)FakeLaunchpadTest.test_set_custom_lp_saveë  sJ   € ô
 ! eÔ,ˆ�‰ÔÙ$4ˆ�‰×ÑÔ!Ø×Ñ˜ 4§>¡>×#4Ñ#4×#<Ñ#<Ó#>Ö?r   r   N)2r   r   r   r   r
   rS   r[   rd   rg   rl   rr   ry   r}   r�   rˆ   rŒ   r�   r“   r–   r�   r¢   r¨   r­   r´   r¿   rÄ   rÈ   rÍ   rÕ   rÙ   rÜ   rá   rì   r÷   rþ   r  r  r  r  r  r  r  r$  r(  r,  r0  r7  r<  r   r   r   s   @r   rU   rU   W   sü   ø‡ € àÑ4Ó6Ð7Ð8€IòDò=ò"=ò6ò
òNò8ò8ò>ò
ò@ò
ò
òEò
ò	3òMòJò	/ò8ò
ò	-ò
&ò.ò
ò
ò*ò	Iò	IòFò8òJòFò8ò@ò8ò>ò>ò>ò5ò@÷
@ð @r   rU   N)r   r   Útestresourcesr   Úlaunchpadlib.testing.launchpadr   r   r   r	   Úlaunchpadlib.testing.resourcesr
   r   r   r"   rU   r   r   r   Ú<module>rA     sL   ð÷& (å +÷ó ÷ôAÐ$ô Aô+NÐ(ô +Nô\[@Ð)ö [@r   