U a<8@sddlZddlmZddlmZddlmZddlmZddlm Z ddlm Z d d lm Z d d lm Z d d lm Z d d lmZd dlmZd dlmZd dlmZd dlmZd dlmZGdddejZGdddejZGdddejejZdS)N)engines)fixtures)eq_) requirements)Column)Table)DateTime)func)Integer)select)sql)String)testing)text)utilc@s^eZdZdZeddZeddZddZdd Zd d Z d d Z e j ddZ ddZdS) RowFetchTestTcCsDtd|tdtddtdtdtd|tdtddtdtdS) Nplain_pkidTZ primary_keydata2 has_datestoday)rrr rr clsmetadatarfC:\Users\vtejo\AppData\Local\Temp\pip-unpacked-wheel-nyjtotrf\sqlalchemy\testing\suite\test_results.py define_tabless   zRowFetchTest.define_tablesc Cs\||jjdddddddddg||jjdtdd d d d d d gdS) Nd1)rrrZd2r Zd3 r)rr)executetablesrinsertrdatetime)r connectionrrr insert_data&s   zRowFetchTest.insert_datacCs@||jj|jjjj}t|jdt|j ddSNr!r") r&r'rr order_bycrfirstrrselfr*rowrrr test_via_attr6s  zRowFetchTest.test_via_attrcCsH||jj|jjjj}t|j ddt|j dddS)Nrr!rr") r&r'rr r-r.rr/r_mappingr0rrrtest_via_string>s zRowFetchTest.test_via_stringcCsD||jj|jjjj}t|ddt|dddS)Nrr!r") r&r'rr r-r.rr/rr0rrr test_via_intFs zRowFetchTest.test_via_intcCsX||jj|jjjj}t|j |jjjjdt|j |jjjj ddSr,) r&r'rr r-r.rr/rr4rr0rrrtest_via_col_objectNs z RowFetchTest.test_via_col_objectcCs\|t|jjjj|jjjjd|jjjj}| }t | ddgt |ddS)Nr)r"r") r&r r'rr.rlabelr-rr/rkeys)r1r*resultr2rrrtest_row_with_dupe_namesVs  z%RowFetchTest.test_row_with_dupe_namesc Cs`|jj}t|djj}t|jj|d}| | }t |j t dddddddS)ztest that a scalar select as a column is returned as such and that type conversion works OK. (this is half a SQLAlchemy Core test and half to catch database backends that may have unusual behavior with scalar selects.) x somelabelr#r$r%rN)r'rr aliasr.rZscalar_subqueryrr8r&r/rr=r))r1r*Z datetabless2r2rrrtest_row_w_scalar_selectbs z%RowFetchTest.test_row_w_scalar_selectN)__name__ __module__ __qualname__ __backend__ classmethodr r+r3r5r6r7rZ%duplicate_names_in_cursor_descriptionr;rArrrrrs   rc@s<eZdZdZdZdZeddZddZdd Z d d Z d S) PercentSchemaNamesTestztests using percent signs, spaces in table and column names. This didn't work for PostgreSQL / MySQL drivers for a long time but is now supported. )Zpercent_schema_namesTcCs@td|tdttdt|j_tdtdtd|j_dS)Nz percent%tablepercent%spaces % more spaces) rrr r' percent_tablertablecolumnlightweight_percent_tablerrrrr ~sz$PercentSchemaNamesTest.define_tablescCsP|jj}ddddddddddddfD]}|||q,||dSNr$r%)rHrI r'rJr&r( _assert_table)r1r*rJparamsrrrtest_single_roundtripsz,PercentSchemaNamesTest.test_single_roundtripcCsT|jj}||ddd||dddddddddg||dSrNrS)r1r*rJrrrtest_executemany_roundtripsz1PercentSchemaNamesTest.test_executemany_roundtripc CsL|jj}|jj}||||fD]}tt|||j dddddgtt|| |j d ddg|j dddg|||j d }t|j dd t|j dd t|j |j dd t|j |j dd q$|||j dd itt|||j dd d ddgdS)NrH)r$r%)rOrP)rQrR)rPrQrIrQrRr$r%)r$rX)rOrX)rQrX)rPrX)r'rJrMr>rlistr&r r-r.whereZin_r/r4updatevalues)r1connrJrMrKr2rrrrTs^    z$PercentSchemaNamesTest._assert_tableN) rBrCrD__doc__ __requires__rErFr rVrWrTrrrrrGrs  rGc@seZdZdZdZddZddZejddde d dfd de d dfd d e d d fdd e d j dddfdde d j d dd fdde d  dfdddde dfdd e dd fdd e dj dddfddd ddZddZdd Zd!d"Zd#d$Zd%d&Zd'S)(ServerSideCursorsTest)server_side_cursorsTcCs|jjjdkrt|jS|jjjdkrszBServerSideCursorsTest.test_roundtrip_fetchmany..r!r$cSsg|]}|d|fqSrrrrrrrsrRcSsg|]}|d|fqSrrrrrrrscSsg|]}|d|fqSrrrrrrrs)rrmrrr rrqrr&r(ranger r-r.rrZ fetchmanyr)r1rrrcrr*r:rrrtest_roundtrip_fetchmanys4    z.ServerSideCursorsTest.test_roundtrip_fetchmanyN)rBrCrDr_rErkrmr combinationsrr rwZwith_for_updateZskip_ifruryrzr~rrrrrrr`sR$   (r`)r)rrZ assertionsrconfigrZschemarrr r r r rrrrrZ TablesTestrrGZTestBaseZAssertsExecutionResultsr`rrrrs*               ^k