o
    ÕÜgŁ  ć                   @   sv   d dl mZ d dlmZ d dlmZ d dlmZ ddl mZ ddl mZ ddl m	Z	 dd	l m
Z
 G d
d dejZdS )é   )Śfixtures)Śeq_)ŚColumn)ŚTableé   )ŚInteger)Śselect)Śtesting)Śunionc                   @   sz   e Zd ZdZedd Zedd ZdddZd	d
 Zdd Z	e
jje
jjdd Ze
jjdd Zdd Zdd ZdS )ŚDeprecatedCompoundSelectTestTc                 C   s*   t d|tdtddtdttdt d S )NŚ
some_tableŚidT)Śprimary_keyŚxŚy)r   r   r   )ŚclsŚmetadata© r   śd/var/www/html/api-tag/env/lib/python3.10/site-packages/sqlalchemy/testing/suite/test_deprecations.pyŚdefine_tables   s   ūz*DeprecatedCompoundSelectTest.define_tablesc              
   C   s@   |  | jj ” ddddddddddddddddg” d S )Né   r   )r   r   r   r   é   é   )ŚexecuteŚtablesr   Śinsert)r   Ś
connectionr   r   r   Śinsert_data    s   




üžz(DeprecatedCompoundSelectTest.insert_datar   c                 C   s   t | ||” ” | d S )N)r   r   Śfetchall)ŚselfŚconnr   ŚresultŚparamsr   r   r   Ś_assert_result,   s   z+DeprecatedCompoundSelectTest._assert_resultc                 C   s   | j j}t| |jjdk”}t| |jjdk”}t||}t d” |  	|| 
|jj”ddg” W d    d S 1 s>w   Y  d S ©Nr   r   śAThe SelectBase.c and SelectBase.columns attributes are deprecated©r   r   r   ©r   r   r   )r   r   r   ŚwhereŚcr   r
   r	   Śexpect_deprecatedr#   Śorder_by©r   r   ŚtableŚs1Śs2Śu1r   r   r   Śtest_plain_union/   s   
’’"üz-DeprecatedCompoundSelectTest.test_plain_unionc                 C   s   | j j}t| |jjdk”}t| |jjdk”}t|| ”  ” }t 	d” |  
|| |jj”ddg” W d    d S 1 sBw   Y  d S r$   )r   r   r   r(   r)   r   r
   Śaliasr	   r*   r#   r+   r,   r   r   r   Ś"_dont_test_select_from_plain_unionD   s   ’’"üz?DeprecatedCompoundSelectTest._dont_test_select_from_plain_unionc                 C   s°   | j j}t| |jjdk” d” |jj”}t| |jjdk” d” |jj”}t|| d”}t	 
d” |  || |jj”ddg” W d    d S 1 sQw   Y  d S ©Nr   r   r   r%   r&   r'   )r   r   r   r(   r)   r   Ślimitr+   r
   r	   r*   r#   r,   r   r   r   Ś&test_limit_offset_selectable_in_unionsR   s   &&’’"üzCDeprecatedCompoundSelectTest.test_limit_offset_selectable_in_unionsc                 C   s¤   | j j}t| |jjdk” |jj”}t| |jjdk” |jj”}t|| d”}t	 
d” |  || |jj”ddg” W d    d S 1 sKw   Y  d S r$   )r   r   r   r(   r)   r   r+   r
   r5   r	   r*   r#   r,   r   r   r   Ś"test_order_by_selectable_in_unionsb   s     ’’"üz?DeprecatedCompoundSelectTest.test_order_by_selectable_in_unionsc                 C   s   | j j}t| |jjdk” ” }t| |jjdk” ” }t|| d”}t	 
d” |  || |jj”ddg” W d    d S 1 sEw   Y  d S r$   )r   r   r   r(   r)   r   Śdistinctr
   r5   r	   r*   r#   r+   r,   r   r   r   Ś"test_distinct_selectable_in_unionsq   s   ’’"üz?DeprecatedCompoundSelectTest.test_distinct_selectable_in_unionsc                 C   sĄ   | j j}t| |jjdk” d” |jj” ”  ” }t| |jjdk” d” |jj” ”  ” }t	|| d”}t
 d” |  || |jj”ddg” W d    d S 1 sYw   Y  d S r4   )r   r   r   r(   r)   r   r5   r+   r2   r
   r	   r*   r#   r,   r   r   r   Ś.test_limit_offset_aliased_selectable_in_unions   s.   
ś	
ś	’’"üzKDeprecatedCompoundSelectTest.test_limit_offset_aliased_selectable_in_unionsN)r   )Ś__name__Ś
__module__Ś__qualname__Ś__backend__Śclassmethodr   r   r#   r1   r3   r	   ŚrequiresŚorder_by_col_from_unionŚ/parens_in_union_contained_select_w_limit_offsetr6   Ś0parens_in_union_contained_select_wo_limit_offsetr7   r9   r:   r   r   r   r   r      s     
	


r   N)Ś r   Ś
assertionsr   Śschemar   r   r   r   r	   r
   Ś
TablesTestr   r   r   r   r   Ś<module>   s   