0x1949 Team - FAZEMRX - MANAGER
Edit File: test_basesupport.cpython-310.pyc
o �b� � @ s^ d dl mZmZ d dlmZ d dlmZ G dd� dej�ZG dd� d�Z G dd � d ej �Zd S )� )�defer�error)�unittest)�basesupportc @ s0 e Zd ZdZdZdZdd� Zdd� Zdd� Zd S ) �DummyAccountzO An account object that will do nothing when asked to start to log on. Fc G s t �� | _| jS )z� Set self.loginDeferred to the same as the deferred returned, allowing a testcase to .callback or .errback. @return: A deferred. )r �Deferred� loginDeferred)�self�args� r �E/usr/lib/python3/dist-packages/twisted/words/test/test_basesupport.py�_startLogOn s zDummyAccount._startLogOnc C � d| _ tj�| |�S �NT)�loginHasFailedr �AbstractAccount�_loginFailed�r �resultr r r r � zDummyAccount._loginFailedc C r r )�loginCallbackCalledr r � _cb_logOnr r r r r r zDummyAccount._cb_logOnN) �__name__� __module__�__qualname__�__doc__r r r r r r r r r r s r c @ s e Zd ZdZdZdd� ZdS )�DummyUIzT Provide just the interface required to be passed to AbstractAccount.logOn. Fc C s d| _ d S r )�clientRegisteredr r r r �registerAccountClient+ s zDummyUI.registerAccountClientN)r r r r r r r r r r r $ s r c @ s4 e Zd Zdd� Zdd� Zdd� Zdd� Zd d � ZdS )�ClientMsgTestsc C s t � S )N)r �r r r r �makeUI0 s zClientMsgTests.makeUIc C s t dddd dd�S )N�laF� localhosti )r r r r r �makeAccount3 s zClientMsgTests.makeAccountc sB �� � � ��� }� �|�}� j�d� � �fdd�}|�|� |S )�z Test that account.logOn works, and it calls the right callback when a connection is established. Nc s �� � jd� ��� jd� d S )NzLogin shouldn't have failedzWe should be logged in)�assertFalser � assertTruer )r ��accountr r r �check@ s z*ClientMsgTests.test_connect.<locals>.check)r$ r! �logOnr �callback�addCallback)r �ui�dr* r r( r �test_connect6 s zClientMsgTests.test_connectc sT �� � � ��� �� ���}� j�t� � � ��fdd�}�fdd�}|�||� |S )r% c s0 �� � jd� ��� jd� �� �j d� d S )NzLogin should have failedzWe shouldn't be logged inz(Client shouldn't be registered in the UI)r'