Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/keystoneauth1/tests/unit/extras/saml2/__pycache__/test_auth_saml2.cpython-39.pyc
Ðазад
a s�h�0 � @ s� d dl Z d dlZd dlZd dlmZ d dlmZ d dlmZ d dlm Z d dlmZ d dlmZ d dlmZ d Zd eiZejjjZG dd� dej�ZG d d� dej�ZdS )� N)� exceptions)�_saml2)�fixture)�session)�fixtures)�utils)�matcherszapplication/vnd.paos+xmlzContent-Typec @ s� e Zd ZdZdZdZdZdZdZdZ dd � Z ed d� �Zeefdd �Z dd� Zdd� Zdd� Zdd� Zdd� Zdd� Zdd� ZdS )�SamlAuth2PluginTestsz�These test ONLY the standalone requests auth plugin. Tests for the auth plugin are later so that hopefully these can be extracted into it's own module. �,�user�passzhttp://sp.testzhttp://idp.test�1https://openstack4.local/Shibboleth.sso/SAML2/ECPc K s6 |� d| j� |� d| j| jf� tjjjf i |��S )N�identity_provider_urlZ requests_auth)� setdefault�TEST_IDP_URL� TEST_USER� TEST_PASS�saml2�v3Z _SamlAuth��self�kwargs� r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/keystoneauth1/tests/unit/extras/saml2/test_auth_saml2.py� get_plugin. s zSamlAuth2PluginTests.get_pluginc C s dd� | j jD �S )Nc S s g | ]}|j �d ��qS ��/��url�strip��.0�rr r r � <listcomp>5 � z.SamlAuth2PluginTests.calls.<locals>.<listcomp>�� requests_mock�request_history�r r r r �calls3 s zSamlAuth2PluginTests.callsc C s( |� d|� �� � }d�t�|��d��S �N�:zBasic {}zutf-8��encode�format�base64� b64encode�decode�r �username�password� user_passr r r �basic_header7 s z!SamlAuth2PluginTests.basic_headerc C s� t �� j}d|i}tjdd|d�}| �� }||�j}| �d|� |d }| �| j|� | �||� | j�� | �t |� | j�� d S )N�Accept�GET�http://another.test)�headers)�uuid�uuid4�hex�requests�Requestr r: ZassertIn�HEADER_MEDIA_TYPE_SEPARATOR�split�PAOS_HEADER)r Z random_headerr: �req�pluginZplugin_headersZ accept_headerr r r �test_request_accept_headers; s ��z0SamlAuth2PluginTests.test_request_accept_headersc C sT t �� j}d}| jj|dt|d� tj|| �� d�}| �d|j � | �||j � d S )Nr9 �� )�status_coder: �text��auth)r; r<