
    [h                         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ej                  ZdS )   )fixtures)eq_)Column)Table   )Integer)select)testing)unionc                       e Zd ZdZed             Zed             ZddZd Zd Z	e
j        j        e
j        j        d                         Ze
j        j        d	             Zd
 Zd ZdS )DeprecatedCompoundSelectTestTc           
          t          d|t          dt          d          t          dt                    t          dt                               d S )N
some_tableidT)primary_keyxy)r   r   r   )clsmetadatas     y/var/www/api.easyaligner.net/htdocs/venv_linux/lib/python3.11/site-packages/sqlalchemy/testing/suite/test_deprecations.pydefine_tablesz*DeprecatedCompoundSelectTest.define_tables   sP    4d3333  3  	
 	
 	
 	
 	
    c           
          |                     | 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   
connections     r   insert_dataz(DeprecatedCompoundSelectTest.insert_data    sq    J!((**qq))qq))qq))qq))		
 	
 	
 	
 	
r    c                 r    t          |                    ||                                          |           d S )N)r   r   fetchall)selfconnr	   resultparamss        r   _assert_resultz+DeprecatedCompoundSelectTest._assert_result,   s2    DLL((1133V<<<<<r   c                    | j         j        }t          |                              |j        j        dk              }t          |                              |j        j        dk              }t          ||          }t          j        d          5  | 	                    ||
                    |j        j                  ddg           d d d            d S # 1 swxY 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u1s         r   test_plain_unionz-DeprecatedCompoundSelectTest.test_plain_union/   s   &E]]  q11E]]  q112r]]&(
 
 	 	 BKK009i2H  		 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	s   7CCCc                    | j         j        }t          |                              |j        j        dk              }t          |                              |j        j        dk              }t          ||                                                                          }t          j	        d          5  | 
                    ||                    |j        j                  ddg           d d d            d S # 1 swxY w Y   d S r+   )r   r   r	   r/   r0   r   r   aliasr
   r1   r)   r2   r3   s         r   "_dont_test_select_from_plain_unionz?DeprecatedCompoundSelectTest._dont_test_select_from_plain_unionD   s%   &E]]  q11E]]  q112r]]  ""))++&(
 
 	 	 BKK009i2H  		 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	s   57C99C= C=c                    | j         j        }t          |                              |j        j        dk                                  d                              |j        j                  }t          |                              |j        j        dk                                  d                              |j        j                  }t          ||                              d          }t          j
        d          5  |                     ||                    |j        j                  ddg           d d d            d S # 1 swxY w Y   d S Nr   r   r   r,   r-   r.   )r   r   r	   r/   r0   r   limitr2   r   r
   r1   r)   r3   s         r   &test_limit_offset_selectable_in_unionszCDeprecatedCompoundSelectTest.test_limit_offset_selectable_in_unionsR   s]    &E]]  q1177::CCEGJOOE]]  q1177::CCEGJOO2r]]  ##&(
 
 	 	 BKK009i2H  		 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	s   7EEEc                 ^   | j         j        }t          |                              |j        j        dk                                  |j        j                  }t          |                              |j        j        dk                                  |j        j                  }t          ||                              d          }t          j
        d          5  |                     ||                    |j        j                  ddg           d d d            d S # 1 swxY w Y   d S r+   )r   r   r	   r/   r0   r   r2   r   r>   r
   r1   r)   r3   s         r   "test_order_by_selectable_in_unionsz?DeprecatedCompoundSelectTest.test_order_by_selectable_in_unionsb   s?   &E]]  q11::57:FFE]]  q11::57:FF2r]]  ##&(
 
 	 	 BKK009i2H  		 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	s   7D""D&)D&c                 2   | j         j        }t          |                              |j        j        dk                                              }t          |                              |j        j        dk                                              }t          ||                              d          }t          j
        d          5  |                     ||                    |j        j                  ddg           d d d            d S # 1 swxY w Y   d S r+   )r   r   r	   r/   r0   r   distinctr   r>   r
   r1   r)   r2   r3   s         r   "test_distinct_selectable_in_unionsz?DeprecatedCompoundSelectTest.test_distinct_selectable_in_unionsq   s3   &E]]  q11::<<E]]  q11::<<2r]]  ##&(
 
 	 	 BKK009i2H  		 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	s   7DDDc                 :   | j         j        }t          |                              |j        j        dk                                  d                              |j        j                                                                                  }t          |                              |j        j        dk                                  d                              |j        j                                                                                  }t          ||                              d          }t          j        d          5  |                     ||                    |j        j                  ddg           d d d            d S # 1 swxY w Y   d S r=   )r   r   r	   r/   r0   r   r>   r2   r:   r   r
   r1   r)   r3   s         r   .test_limit_offset_aliased_selectable_in_unionszKDeprecatedCompoundSelectTest.test_limit_offset_aliased_selectable_in_unions   s   &5MMU57:?##U1XXXegj!!UWWVXX 	 5MMU57:?##U1XXXegj!!UWWVXX 	 2r]]  ##&(
 
 	 	 BKK009i2H  		 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	s   7FFFN)r"   )__name__
__module____qualname____backend__classmethodr   r!   r)   r8   r;   r
   requiresorder_by_col_from_union/parens_in_union_contained_select_w_limit_offsetr?   0parens_in_union_contained_select_wo_limit_offsetrA   rD   rF   r"   r   r   r   r      s        K
 
 [
 	
 	
 [	
= = = =  *   -E  FE .- F  GF      r   r   N) r   
assertionsr   schemar   r   r   r	   r
   r   
TablesTestr   r"   r   r   <module>rT      s                                                   F F F F F8#6 F F F F Fr   