File: //lib/python3/dist-packages/twisted/pair/test/__pycache__/test_ethernet.cpython-310.pyc
o
�b� � @ sb d dl mZ d dlmZmZ d dlmZ d dlmZ eej �G dd� d��Z
G dd� dej�Zd S )
� )�implementer)�ethernet�raw)�
components)�unittestc @ s$ e Zd Zdd� Zdd� Zdd� ZdS )�
MyProtocolc C s t |�| _d S )N)�list� expecting)�selfr � r �A/usr/lib/python3/dist-packages/twisted/pair/test/test_ethernet.py�__init__ s zMyProtocol.__init__c C s dS )z!
Not implemented
Nr )r
�num�protor r r �addProto s zMyProtocol.addProtoc C sR | j sJ d��| j �d�}t� }||||d�}|||fks'J d�|||f���d S )Nz(Got a packet when not expecting anymore.r ��partial�dest�source�protocolzExpected {!r}, got {!r})r �pop�locals�format) r
�datar r r r �expect�localVariables�paramsr r r �datagramReceived s �
�zMyProtocol.datagramReceivedN)�__name__�
__module__�__qualname__r
r r r r r r r
s r c @ sT e Zd Zdd� Zdd� Zdd� Zdd� Zd d
� Zdd� Zd
d� Z dd� Z
dd� ZdS )�
EthernetTestsc C sR t �� }tdddddd�fg�}|�d|� |jddd� |jr'J d |j ��d S )
N� foobarr � 123456� 987654� r � 123456987654 foobar�r �5Should not expect any more packets, but still want %r�r �EthernetProtocolr r r r �r
r �p1r r r �testPacketParsing$ s ����
�zEthernetTests.testPacketParsingc C sp t �� }tdddddd�fddd d
dd�fg�}|�d|� |jddd� |jd
dd� |jr6J d|j ��d S )Nr"