File manager - Edit - /home/newsbmcs.com/public_html/static/img/logo/test.zip
Back
PK ə�Z][�K� � test_scripts.pynu �[��� # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for the command-line interfaces to conch. """ from unittest import skipIf from twisted.python.reflect import requireModule from twisted.python.test.test_shellcomp import ZshScriptTestMixin from twisted.scripts.test.test_scripts import ScriptTestsMixin from twisted.trial.unittest import TestCase doSkip = False skipReason = "" if not requireModule("pyasn1"): doSkip = True skipReason = "Cannot run without PyASN1" if not requireModule("cryptography"): doSkip = True cryptoSkip = "can't run w/o cryptography" if not requireModule("tty"): doSkip = True ttySkip = "can't run w/o tty" try: import tkinter except ImportError: doSkip = True skipReason = "can't run w/o tkinter" else: try: tkinter.Tk().destroy() except tkinter.TclError as e: doSkip = True skipReason = "Can't test Tkinter: " + str(e) @skipIf(doSkip, skipReason) class ScriptTests(TestCase, ScriptTestsMixin): """ Tests for the Conch scripts. """ def test_conch(self): self.scriptTest("conch/conch") def test_cftp(self): self.scriptTest("conch/cftp") def test_ckeygen(self): self.scriptTest("conch/ckeygen") def test_tkconch(self): self.scriptTest("conch/tkconch") class ZshIntegrationTests(TestCase, ZshScriptTestMixin): """ Test that zsh completion functions are generated without error """ generateFor = [ ("conch", "twisted.conch.scripts.conch.ClientOptions"), ("cftp", "twisted.conch.scripts.cftp.ClientOptions"), ("ckeygen", "twisted.conch.scripts.ckeygen.GeneralOptions"), ("tkconch", "twisted.conch.scripts.tkconch.GeneralOptions"), ] PK ə�Z� ��� � $ __pycache__/__init__.cpython-310.pycnu �[��� o �b � @ s d Z dS )zconch testsN)�__doc__� r r �=/usr/lib/python3/dist-packages/twisted/conch/test/__init__.py�<module> s PK ə�Z� �� � ( __pycache__/test_scripts.cpython-310.pycnu �[��� o �b� � @ s d Z ddlmZ ddlmZ ddlmZ ddlmZ ddl m Z dZdZed �s,d ZdZed�s4d Zd Z ed�s<d ZdZzddlZW n eyO d ZdZY n%w ze�� �� W n ejys Z zd Zdee� ZW Y dZ[ndZ[ww eee�G dd� de e��ZG dd� de e�ZdS )z1 Tests for the command-line interfaces to conch. � )�skipIf)� requireModule)�ZshScriptTestMixin)�ScriptTestsMixin)�TestCaseF� �pyasn1TzCannot run without PyASN1�cryptographyzcan't run w/o cryptography�ttyzcan't run w/o ttyNzcan't run w/o tkinterzCan't test Tkinter: c @ s0 e Zd ZdZdd� Zdd� Zdd� Zdd � Zd S )�ScriptTestsz& Tests for the Conch scripts. c C � | � d� d S )Nzconch/conch�� scriptTest��self� r �A/usr/lib/python3/dist-packages/twisted/conch/test/test_scripts.py� test_conch0 � zScriptTests.test_conchc C r )Nz conch/cftpr r r r r � test_cftp3 r zScriptTests.test_cftpc C r )Nz conch/ckeygenr r r r r �test_ckeygen6 r zScriptTests.test_ckeygenc C r )Nz conch/tkconchr r r r r �test_tkconch9 r zScriptTests.test_tkconchN)�__name__� __module__�__qualname__�__doc__r r r r r r r r r * s r c @ s e Zd ZdZg d�ZdS )�ZshIntegrationTestszH Test that zsh completion functions are generated without error ))�conchz)twisted.conch.scripts.conch.ClientOptions)�cftpz(twisted.conch.scripts.cftp.ClientOptions)�ckeygenz,twisted.conch.scripts.ckeygen.GeneralOptions)�tkconchz,twisted.conch.scripts.tkconch.GeneralOptionsN)r r r r �generateForr r r r r = s r )r �unittestr �twisted.python.reflectr �"twisted.python.test.test_shellcompr �!twisted.scripts.test.test_scriptsr �twisted.trial.unittestr �doSkip� skipReason� cryptoSkip�ttySkip�tkinter�ImportError�Tk�destroy�TclError�e�strr r r r r r �<module> sB ���PK ə�Z�}9 __init__.pynu �[��� "conch tests" PK ���Z���^� � ) __pycache__/test_sentence.cpython-310.pycnu �[��� o �bZ � @ s� d Z ddlZddlmZ ddlmZ dZdZG dd� d�ZG d d � d ej �Z G dd� dej�ZG d d� dej �Z G dd� d�ZG dd� dee�ZdS )z" Tests for positioning sentences. � N)� _sentence)�TestCase�someStringValue�someOtherStringValuec @ s e Zd ZdZedd� �ZdS )� DummyProtocolz" A simple, fake protocol. c C s dt tgS )N�type)�sentinelValueOne�sentinelValueTwo� r r �H/usr/lib/python3/dist-packages/twisted/positioning/test/test_sentence.py�getSentenceAttributes s z#DummyProtocol.getSentenceAttributesN)�__name__� __module__�__qualname__�__doc__�staticmethodr r r r r r s r c @ � e Zd ZdZe�� ZdS )� DummySentencez* A sentence for L{DummyProtocol}. N)r r r r r r �ALLOWED_ATTRIBUTESr r r r r � r c @ s e Zd ZdZdeedgiZdS )� MixinProtocolz� A simple, fake protocol that declaratively tells you the sentences it produces using L{base.PositioningSentenceProducerMixin}. N)r r r r r r �_SENTENCE_CONTENTSr r r r r # s ��r c @ r )� MixinSentencez* A sentence for L{MixinProtocol}. N)r r r r r r r r r r r r 2 r r c @ sJ e Zd ZdZdd� Zdd� Zdd� ZdZd Zddd �Z dd� Z dd� ZdS )�SentenceTestsMixinzI Tests for positioning protocols and their respective sentences. c C s: t � }| �t|i�}| �t|t�|� | �t|t�� dS )z� A sentence attribute gets the correct value, and accessing an unset attribute (which is specified as being a valid sentence attribute) gets L{None}. N)�object� sentenceClassr �assertEqual�getattr�assertIsNoner )�self�thisSentinel�sentencer r r �test_attributeAccess? s z'SentenceTestsMixin.test_attributeAccessc C s | � i �}| �tt|d� dS )zM Accessing a nonexistent attribute raises C{AttributeError}. �BOGUSN�r �assertRaises�AttributeErrorr �r r! r r r �"test_raiseOnMissingAttributeAccessJ s z5SentenceTestsMixin.test_raiseOnMissingAttributeAccessc C s"