File: //usr/lib/python3/dist-packages/twisted/test/__pycache__/test_randbytes.cpython-38.pyc
U
W[
� @ s| d Z ddlmZmZ ddlmZ ddlmZ G dd� de�Z G dd� de ej
�ZG d d
� d
e ej�Z
G dd� de ej�Zd
S )z-
Test cases for L{twisted.python.randbytes}.
� )�division�absolute_import)�unittest)� randbytesc @ s e Zd ZdZdd� ZdS )�SecureRandomTestCaseBasez1
Base class for secureRandom test cases.
c C sP t dd�D ]@}||�}| �t|�|� ||�}| �t|�|� | �||� q
dS )a|
The given random bytes source should return the number of bytes
requested each time it is called and should probably not return the
same bytes on two consecutive calls (although this is a perfectly
legitimate occurrence and rejecting it may generate a spurious failure
-- maybe we'll get lucky and the heat death with come first).
� � N)�range�assertEqual�lenZassertNotEqual)�self�source�nbytes�s�s2� r �=/usr/lib/python3/dist-packages/twisted/test/test_randbytes.py�_check s zSecureRandomTestCaseBase._checkN)�__name__�
__module__�__qualname__�__doc__r r r r r r s r c @ s e Zd ZdZdd� ZdS )�SecureRandomTestsz4
Test secureRandom under normal conditions.
c C s | � tj� dS )z�
L{randbytes.secureRandom} should return a string of the requested
length and make some effort to make its result otherwise unpredictable.
N)r r �secureRandom�r r r r �test_normal+ s zSecureRandomTests.test_normalN)r r r r r r r r r r &