+
    Dfj                          R t ^ RIHt ^ RIHt ^ RIHt ^ RIHtH	t	H
t
HtHt ^ RIHt ^ RIHt ]! ]
4       ! R R4      4       t ! R	 R
]4      t ! R R]4      tR# )z+
Tests for L{twisted.application.service}.
)implementer)BrokenImplementation)verifyObject)ApplicationIProcessIServiceIServiceCollectionService)IPersistable)TestCasec                      a  ] tR t^t o RtV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR	 ltV 3R
 lR lt	V 3R lR lt
V 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltRtV tR# )AlmostServicea  
Implement IService in a way that can fail.

In general, classes should maintain invariants that adhere
to the interfaces that they claim to implement --
otherwise, it is a bug.

This is a buggy class -- the IService implementation is fragile,
and several methods will break it. These bugs are intentional,
as the tests trigger them -- and then check that the class,
indeed, no longer complies with the interface (IService)
that it claims to comply with.

Since the verification will, by definition, only fail on buggy classes --
in other words, those which do not actually support the interface they
claim to support, we have to write a buggy class to properly verify
the interface.
c                0   < V ^8  d   QhRS[ RS[RS[RR/# )   nameparentrunningreturnN)strr   bool)format__classdict__s   "G/usr/lib/python3/dist-packages/twisted/application/test/test_service.py__annotate__AlmostService.__annotate__-   s+      S *< t PT     c                *    Wn         W n        W0n        R # )Nr   r   r   )selfr   r   r   s   &&&&r   __init__AlmostService.__init__-   s    	r   c                   < V ^8  d   QhRR/# r   r   N )r   r   s   "r   r   r   2   s      4 r   c                
    V = R# )z~
Probably not a wise method to call.

This method removes the :code:`name` attribute,
which has to exist in IService classes.
N)r   r   s   &r   makeInvalidByDeletingName'AlmostService.makeInvalidByDeletingName2   s	     Ir   c                   < V ^8  d   QhRR/# r"   r#   )r   r   s   "r   r   r   ;   s      T r   c                
    V = R# )z
Probably not a wise method to call.

This method removes the :code:`parent` attribute,
which has to exist in IService classes.
N)r   r%   s   &r   makeInvalidByDeletingParent)AlmostService.makeInvalidByDeletingParent;   s	     Kr   c                   < V ^8  d   QhRR/# r"   r#   )r   r   s   "r   r   r   D   s      d r   c                
    V = R# )z
Probably not a wise method to call.

This method removes the :code:`running` attribute,
which has to exist in IService classes.
N)r   r%   s   &r   makeInvalidByDeletingRunning*AlmostService.makeInvalidByDeletingRunningD   s	     Lr   c                $   < V ^8  d   QhRS[ RR/# )r   r   r   Nobject)r   r   s   "r   r   r   M   s      F t r   c                    R# )zD
See L{twisted.application.service.IService}.

@param name: ignored
Nr#   )r   r   s   &&r   setNameAlmostService.setNameM       r   c                $   < V ^8  d   QhRS[ RR/# )r   r   r   Nr1   )r   r   s   "r   r   r   T   s      v $ r   c                    R# )zF
See L{twisted.application.service.IService}.

@param parent: ignored
Nr#   )r   r   s   &&r   setServiceParentAlmostService.setServiceParentT   r6   r   c                   < V ^8  d   QhRR/# r"   r#   )r   r   s   "r   r   r   [   s      T r   c                    R# z.
See L{twisted.application.service.IService}.
Nr#   r%   s   &r   disownServiceParent!AlmostService.disownServiceParent[   r6   r   c                   < V ^8  d   QhRR/# r"   r#   )r   r   s   "r   r   r   `   s       r   c                    R# r=   r#   r%   s   &r   privilegedStartService$AlmostService.privilegedStartService`   r6   r   c                   < V ^8  d   QhRR/# r"   r#   )r   r   s   "r   r   r   e   s      d r   c                    R# r=   r#   r%   s   &r   startServiceAlmostService.startServicee   r6   r   c                   < V ^8  d   QhRR/# r"   r#   )r   r   s   "r   r   r   j   s      T r   c                    R# r=   r#   r%   s   &r   stopServiceAlmostService.stopServicej   r6   r   r   N)__name__
__module____qualname____firstlineno____doc__r   r&   r*   r.   r4   r9   r>   rB   rF   rJ   __static_attributes____classdictcell__r   s   @r   r   r      sn     & 
      
 
 
 r   r   c                      a  ] tR t^pt o RtV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR	 ltV 3R
 lR lt	V 3R lR lt
RtV tR# )ServiceInterfaceTestszC
Tests for L{twisted.application.service.IService} implementation.
c                   < V ^8  d   QhRR/# r"   r#   )r   r   s   "r   r   "ServiceInterfaceTests.__annotate__u   s     R Rt Rr   c                ,    \        RRRR7      V n        R# )z+
Build something that implements IService.
NF)r   r   r   )r   almostServicer%   s   &r   setUpServiceInterfaceTests.setUpu   s     +$DQr   c                   < V ^8  d   QhRR/# r"   r#   )r   r   s   "r   r   rW   {   s     * *$ *r   c                :    \        4       p\        \        V4       R# )z
Service implements IService.
N)r	   r   r   )r   	myServices   & r   test_realService&ServiceInterfaceTests.test_realService{   s     I	Xy)r   c                   < V ^8  d   QhRR/# r"   r#   )r   r   s   "r   r   rW      s     3 3T 3r   c                :    \        \        V P                  4       R# )z$
AlmostService implements IService.
N)r   r   rY   r%   s   &r   test_hasAll!ServiceInterfaceTests.test_hasAll   s     	Xt112r   c                   < V ^8  d   QhRR/# r"   r#   )r   r   s   "r   r   rW      s     7 7T 7r   c                    V P                   P                  4        V P                  \        4      ;_uu_ 4        \	        \
        V P                   4       RRR4       R#   + '       g   i     R# ; i)z9
AlmostService with no name does not implement IService.
N)rY   r&   assertRaisesr   r   r   r%   s   &r   test_noName!ServiceInterfaceTests.test_noName   sG     	4463444#5#56 5444   AA.	c                   < V ^8  d   QhRR/# r"   r#   )r   r   s   "r   r   rW      s     7 7t 7r   c                    V P                   P                  4        V P                  \        4      ;_uu_ 4        \	        \
        V P                   4       RRR4       R#   + '       g   i     R# ; i)z;
AlmostService with no parent does not implement IService.
N)rY   r*   rg   r   r   r   r%   s   &r   test_noParent#ServiceInterfaceTests.test_noParent   sG     	6683444#5#56 5444rj   c                   < V ^8  d   QhRR/# r"   r#   )r   r   s   "r   r   rW      s     7 7 7r   c                    V P                   P                  4        V P                  \        4      ;_uu_ 4        \	        \
        V P                   4       RRR4       R#   + '       g   i     R# ; i)z<
AlmostService with no running does not implement IService.
N)rY   r.   rg   r   r   r   r%   s   &r   test_noRunning$ServiceInterfaceTests.test_noRunning   sG     	7793444#5#56 5444rj   )rY   N)rL   rM   rN   rO   rP   rZ   r_   rc   rh   rm   rq   rQ   rR   rS   s   @r   rU   rU   p   sH     R R* *3 37 77 77 7r   rU   c                   6   a  ] tR t^t o RtV 3R lR ltRtV tR# )ApplicationTestsz7
Tests for L{twisted.application.service.Application}.
c                   < V ^8  d   QhRR/# r"   r#   )r   r   s   "r   r   ApplicationTests.__annotate__   s     	G 	GD 	Gr   c                \   \        R4      pV P                  \        \        \        V4      4      4       V P                  \        \        \	        V4      4      4       V P                  \        \
        \        V4      4      4       V P                  \        \        \        V4      4      4       R# )zA
Check L{twisted.application.service.Application} instantiation.
zapp-nameN)r   
assertTruer   r   r   r   r
   )r   apps   & r   test_applicationComponents+ApplicationTests.test_applicationComponents   sn     *%Xx}=>%79KC9PQRXx}=>\<3DEFr   r#   N)rL   rM   rN   rO   rP   rz   rQ   rR   rS   s   @r   rt   rt      s     	G 	Gr   rt   N)rP   zope.interfacer   zope.interface.exceptionsr   zope.interface.verifyr   twisted.application.servicer   r   r   r   r	   twisted.persisted.sobr
   twisted.trial.unittestr   r   rU   rt   r#   r   r   <module>r      sd   
 ' : .  / + XT T Tn.7H .7bGx Gr   