%PDF- %PDF-
Direktori : /lib/python3/dist-packages/twisted/application/test/__pycache__/ |
Current File : //lib/python3/dist-packages/twisted/application/test/__pycache__/test_service.cpython-312.pyc |
� Ϫ�f � � � d Z ddlmZ ddlmZ ddlmZ ddlmZm Z m Z mZmZ ddl mZ ddlmZ ee � G d� d � � Z G d � de� Z G d� d e� Zy)z+ Tests for L{twisted.application.service}. � )�implementer)�BrokenImplementation)�verifyObject)�Application�IProcess�IService�IServiceCollection�Service)�IPersistable)�TestCasec � � e Zd ZdZdedededdfd�Zdd�Zdd �Z dd �Z deddfd�Zdeddfd�Z dd �Zdd�Zdd�Zdd�Zy)� 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. �name�parent�running�returnNc �. � || _ || _ || _ y )N)r r r )�selfr r r s �G/usr/lib/python3/dist-packages/twisted/application/test/test_service.py�__init__zAlmostService.__init__- s � ��� ������� c � � | ` y)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 �makeInvalidByDeletingNamez'AlmostService.makeInvalidByDeletingName2 s � � �Ir c � � | ` y)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 �makeInvalidByDeletingParentz)AlmostService.makeInvalidByDeletingParent; s � � �Kr c � � | ` y)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 �makeInvalidByDeletingRunningz*AlmostService.makeInvalidByDeletingRunningD s � � �Lr c � � y)z\ See L{twisted.application.service.IService}. @param name: ignored N� )r r s r �setNamezAlmostService.setNameM � � r c � � y)z^ See L{twisted.application.service.IService}. @param parent: ignored Nr )r r s r �setServiceParentzAlmostService.setServiceParentT r"