+
    Dfj#                         ^ RI t ^ RIt^ RIHt ^ RIHt ^ RIHt ^ RIH	t	 ^ RI
Ht  ! R R]	P                  4      t^R	R^R	.^R	/.t ! R
 R4      t ! R R]P                   4      tR# )    N)dedent)sob)	Ephemeral)
components)unittestc                       ] tR t^tRtR# )Dummy N__name__
__module____qualname____firstlineno____static_attributes__r
       7/usr/lib/python3/dist-packages/twisted/test/test_sob.pyr	   r	          r   r	   helloc                       ] tR t^tRtR# )
FakeModuler
   Nr   r
   r   r   r   r      r   r   r   c                   b   a  ] tR t^ t o R tR tR tR tR tR t	R t
R tR	 tR
 tR tRtV tR# )PersistTestsc                .   \          F  p\        P                  ! VR 4      pRP                  4        F\  pVP	                  V4       VP                  RV,           R7       \        P                  ! RV,           V4      pV P                  W4       K^  	  K  	  R# ) source picklezpersisttest.filenameN)objectsr   
PersistentsplitsetStylesaveloadassertEqual)selfopstyleo1s   &    r   
testStylesPersistTests.testStyles!   sq    Aq"%A(..0

5! 67XXnu4e<  '	 1 r   c                L   \        4       p^Vn        VP                  \        P                  \        P
                  ! VR4      4       RP                  4        F  p\        P                  ! V4      P                  V4       \        P                  ! V4      P                  RV,           R7       \        P                  ! RV,           V4      pV P                  VP                  VP                  4       V P                  \        P                  ! V4      P                  V4       K  	  R# )   lalar   zlala.r   N)r	   foosetComponentr   IPersistabler   r    r!   r"   r#   r$   r(   )r%   r&   r(   r)   s   &   r   testStylesBeingSetPersistTests.testStylesBeingSet*   s    G	s''6)BC$**,EQ((/Q$$go$>'E/51BQUUBFF+S--b177? -r   c                z    \         P                  ! RR4      pV P                  \        VP                  RRR7       R# )z/
Calling save() with a passphrase is an error.
Nobjectzfilename.pickleabc)
passphrase)r   
PersistantassertRaises	TypeErrorr"   )r%   r'   s   & r   testPassphraseError PersistTests.testPassphraseError5   s0     NN4*)QVV->5Qr   c                   . ROp\         P                  ! VR4      pRP                  4        F  pVP                  V4       VP	                  4        \         P
                  ! RV^ ,          ,           V4      pV P                  W4       RP                  4        FX  pVP	                  V4       \         P
                  ! RV,           R,           V^ ,          ,           V4      pV P                  W4       KZ  	  K  	  R# )	   r5   r   z	object.taz	lala lolozobject-z.taNr>         )r   r   r    r!   r"   r#   r$   )r%   r&   r'   r(   r)   tags   &     r   	testNamesPersistTests.testNames<   s    NN1h'$**,EJJuFFH+a0%8BQ#"((*sXXi#o5a@%H  ' + -r   c                    \        R R4      ;_uu_ 4       pVP                  R4       RRR4       \        P                  ! R R4      pV P	                  V. RO4       R#   + '       g   i     L=; i)zpersisttest.pythonwzfoo=[1,2,3] Nr/   r?   )openwriter   loadValueFromFiler$   )r%   fr&   s   &  r   
testPythonPersistTests.testPythonI   sO    &,,GGN# -!!"6>I& -,s   AA,	c                d   V P                  \        \        P                  R 4       V P	                  R\        P                  ! R4      4       V P	                  R\        P                  ! R4      4       V P	                  R\        P                  ! R4      4       V P	                  R\        P                  ! R4      4       V P	                  R\        P                  ! R4      4       V P	                  R\        P                  ! R	4      4       V P	                  R\        P                  ! R
4      4       R# )z	file.blahpythonzfile.pyzfile.tacz	file.etacpicklezfile.tapz	file.etapsourcezfile.tasz	file.etasN)r9   KeyErrorr   	guessTyper$   r%   s   &r   testTypeGuesserPersistTests.testTypeGuesserO   s    (CMM;?3==#;<3==#<=3==#=>3==#<=3==#=>3==#<=3==#=>r   c                   ^V P                   n        V P                  4       p\        P                  ! V4       \        P
                  P                  VR4      pRs\        VR4      ;_uu_ 4       pVP                  \        R4      4       RRR4       \        P                  ! VR4      pV P                  V\        4       V P                  V^ ,          R4       V P                  V^,          R4       V P                  \        \         4       V P                  \        P"                  \         4       @R#   + '       g   i     L; i)z
L{_EverythingEphermal.__getattr__} will proxy the __main__ module as an
L{Ephemeral} object, and during load will be transparent, but after
load will return L{Ephemeral} objects from any accessed attributes.
zpersisttest.ee_getattrNrF   a  
            app = []
            import __main__
            app.append(__main__.testMainModGetattr == 1)
            try:
                __main__.somethingElse
            except AttributeError:
                app.append(True)
            else:
                app.append(False)
            from twisted.test import test_sob
            test_sob.mainWhileLoading = __main__
            rP   zExpected attribute not set.zUnexpected attribute set.)fakeMaintestMainModGetattrmktemposmkdirpathjoinmainWhileLoadingrG   rH   r   r   r#   assertIsInstancelist
assertTruer   somethingElse)r%   dirnamer   rJ   loadeds   &    r   testEverythingEphemeralGetattr+PersistTests.testEverythingEphemeralGetattrY   s     ,-(++-
77<<)AB  (C  AGG !& (H-fd+q	#@Aq	#>?.	:.<<iH3 ! s   .D11E	c                   ^V P                   n        V P                  4       p\        P                  ! V4       \        P
                  P                  VR4      p\        VR4      ;_uu_ 4       pVP                  R4       VP                  R4       VP                  R4       RRR4       \        P                  ! VR4       V P                  V P                   P                  ^4       R#   + '       g   i     LO; i)zE
Verify that _EverythingEphemeral.__setattr__ won't affect __main__.
zpersisttest.ee_setattrrF   zimport __main__
z __main__.testMainModSetattr = 2
zapp = None
NrP   )rW   testMainModSetattrrY   rZ   r[   r\   r]   rG   rH   r   r#   r$   r%   rc   r   rJ   s   &   r   testEverythingEphemeralSetattr+PersistTests.testEverythingEphemeralSetattr   s     ,-(++-
77<<)AB(C  AGG'(GG78GGN# !
 	8$991= ! s   ,4C''C7	c                   V P                  4       p\        P                  ! V4       \        P                  P	                  VR4      p\        VR4      ;_uu_ 4       pVP                  R4       RRR4       V P                  \        \        P                  VR4       V P                  \        \        P                  R,          4      \        4       R#   + '       g   i     Ll; i)zG
Test that an exception during load() won't cause _EE to mask __main__
zpersisttest.ee_exceptionrF   zraise ValueError
NrP   __main__)rY   rZ   r[   r\   r]   rG   rH   r9   
ValueErrorr   r#   r$   typesysmodulesr   ri   s   &   r    testEverythingEphemeralException-PersistTests.testEverythingEphemeralException   s     ++-
77<<)CD(C  AGG() ! 	*chh(Cckk*56
C	 ! s   CC!	c                    \         P                  R,          V n        \        4       ;V n        \         P                  R&   R# )zQ
Replace the __main__ module with a fake one, so that it can be mutated
in tests
rm   N)rp   rq   realMainr   rW   rS   s   &r   setUpPersistTests.setUp   s+    
 J/2<,>J/r   c                @    V P                   \        P                  R&   R# )z(
Restore __main__ to its original value
rm   N)ru   rp   rq   rS   s   &r   tearDownPersistTests.tearDown   s     #'--Jr   )rW   ru   N)r   r   r   r   r*   r2   r;   rC   rK   rT   re   rj   rr   rv   ry   r   __classdictcell__)__classdict__s   @r   r   r       sE     (	@R('?(T>&D?0 0r   r   )r>   r   )rZ   rp   textwrapr   twisted.persistedr   twisted.persisted.stylesr   twisted.pythonr   twisted.trialr   Componentizedr	   r   r   TestCaser   r
   r   r   <module>r      sl   
 
 
  ! . % "	J$$ 	
 LL	 	P08$$ P0r   