U
    ¶[ÖeX  ã                   @   s*  d dl Zd dlmZmZmZmZmZmZm	Z	m
Z
mZmZmZmZmZ G dd„ dejƒZG dd„ deƒZG dd„ deƒZG d	d
„ d
eƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZdS )é    N)ÚSocialAuthBaseExceptionÚWrongBackendÚ
AuthFailedÚAuthTokenErrorÚAuthMissingParameterÚAuthStateMissingÚNotAllowedToDisconnectÚAuthExceptionÚAuthCanceledÚAuthUnknownErrorÚAuthStateForbiddenÚAuthAlreadyAssociatedÚAuthTokenRevokedc                   @   s   e Zd ZdZdZdd„ ZdS )ÚBaseExceptionTestCaseNÚ c              
   C   s\   | j d kr| jdkrd S z
| j ‚W n4 tk
rV } z|  t|ƒ| j¡ W 5 d }~X Y nX d S )Nr   )Ú	exceptionÚexpected_messager   ÚassertEqualÚstr)ÚselfÚerr© r   ú^/var/www/html/services/stratfitenv/lib/python3.8/site-packages/social/tests/test_exceptions.pyÚtest_exception_message   s    
z,BaseExceptionTestCase.test_exception_message)Ú__name__Ú
__module__Ú__qualname__r   r   r   r   r   r   r   r      s   r   c                   @   s   e Zd ZedƒZdZdS )ÚWrongBackendTestÚfoobarz)Incorrect authentication service "foobar"N)r   r   r   r   r   r   r   r   r   r   r      s   r   c                   @   s   e Zd ZeddƒZdZdS )ÚAuthFailedTestr   Z
wrong_userz!Authentication failed: wrong_userN©r   r   r   r   r   r   r   r   r   r   r      s   
r   c                   @   s   e Zd ZeddƒZdZdS )ÚAuthFailedDeniedTestr   Zaccess_deniedz#Authentication process was canceledNr    r   r   r   r   r!   #   s   
r!   c                   @   s   e Zd ZeddƒZdZdS )ÚAuthTokenErrorTestr   zIncorrect tokenszToken error: Incorrect tokensN)r   r   r   r   r   r   r   r   r   r   r"   (   s   
r"   c                   @   s   e Zd ZeddƒZdZdS )ÚAuthMissingParameterTestr   Úusernamez!Missing needed parameter usernameN)r   r   r   r   r   r   r   r   r   r   r#   -   s   
r#   c                   @   s   e Zd ZedƒZdZdS )ÚAuthStateMissingTestr   zSession value state missing.N)r   r   r   r   r   r   r   r   r   r   r%   2   s   r%   c                   @   s   e Zd Zeƒ ZdZdS )ÚNotAllowedToDisconnectTestr   N)r   r   r   r   r   r   r   r   r   r   r&   7   s   r&   c                   @   s   e Zd ZeddƒZdZdS )ÚAuthExceptionTestr   ÚmessageN)r   r   r   r	   r   r   r   r   r   r   r'   <   s   
r'   c                   @   s   e Zd ZedƒZdZdS )ÚAuthCanceledTestr   zAuthentication process canceledN)r   r   r   r
   r   r   r   r   r   r   r)   A   s   r)   c                   @   s   e Zd ZeddƒZdZdS )ÚAuthUnknownErrorTestr   z
some errorz9An unknown error happened while authenticating some errorN)r   r   r   r   r   r   r   r   r   r   r*   F   s   
r*   c                   @   s   e Zd ZedƒZdZdS )ÚAuthStateForbiddenTestr   zWrong state parameter given.N)r   r   r   r   r   r   r   r   r   r   r+   L   s   r+   c                   @   s   e Zd ZedƒZdZdS )ÚAuthAlreadyAssociatedTestr   r   N)r   r   r   r   r   r   r   r   r   r   r,   Q   s   r,   c                   @   s   e Zd ZedƒZdZdS )ÚAuthTokenRevokedTestr   zUser revoke access to the tokenN)r   r   r   r   r   r   r   r   r   r   r-   V   s   r-   )Z	unittest2ZunittestZsocial.exceptionsr   r   r   r   r   r   r   r	   r
   r   r   r   r   ZTestCaser   r   r   r!   r"   r#   r%   r&   r'   r)   r*   r+   r,   r-   r   r   r   r   Ú<module>   s   <	