Server IP : 209.38.156.173 / Your IP : 216.73.216.122 [ Web Server : Apache/2.4.52 (Ubuntu) System : Linux lakekumayuhotel 5.15.0-136-generic #147-Ubuntu SMP Sat Mar 15 15:53:30 UTC 2025 x86_64 User : root ( 0) PHP Version : 8.1.2-1ubuntu2.22 Disable Function : NONE Domains : 2 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /usr/lib/python3/dist-packages/twisted/python/test/__pycache__/ |
Upload File : |
o �b� � @ sz d Z ddlZddlmZ ddlmZ G dd� d�ZG dd� d�ZG d d � d �ZG dd� deee�Z G d d� deee�Z dS )z& Tests for L{twisted.python.systemd}. � N)� ListenFDs)�TestCasec @ � e Zd ZdZdd� Zdd� ZdS )�InheritedDescriptorsMixinz� Mixin for a L{TestCase} subclass which defines test methods for some kind of systemd sd-daemon class. In particular, it defines tests for a C{inheritedDescriptors} method. c C s$ | � dd�}| �g d�|�� � dS )z� C{inheritedDescriptors} returns a list of integers giving the file descriptors which were inherited from systemd. � � )r � � N�� getDaemon�assertEqual�inheritedDescriptors��self�sddaemon� r �B/usr/lib/python3/dist-packages/twisted/python/test/test_systemd.py�test_inheritedDescriptors s z3InheritedDescriptorsMixin.test_inheritedDescriptorsc C s$ | � dd�}| �|�� |�� � dS )zW Any subsequent calls to C{inheritedDescriptors} return the same list. r r Nr r r r r � test_repeated s �z'InheritedDescriptorsMixin.test_repeatedN)�__name__� __module__�__qualname__�__doc__r r r r r r r s r c @ s e Zd ZdZdd� ZdS )�MemoryOnlyMixinz� Mixin for a L{TestCase} subclass which creates creating a fake, in-memory implementation of C{inheritedDescriptors}. This provides verification that the fake behaves in a compatible way with the real implementation. c C s t t||| ��S )a Invent C{count} new I{file descriptors} (actually integers, attached to no real file description), starting at C{start}. Construct and return a new L{ListenFDs} which will claim those integers represent inherited file descriptors. )r �range)r �start�countr r r r / s zMemoryOnlyMixin.getDaemonN)r r r r r r r r r r ( s r c @ r )�EnvironmentMixinaV Mixin for a L{TestCase} subclass which creates a real implementation of C{inheritedDescriptors} which is based on the environment variables set by systemd. To facilitate testing, this mixin will also create a fake environment dictionary and add keys to it to make it look as if some descriptors have been inherited. c C s&