403Webshell
Server IP : 121.121.20.254  /  Your IP : 216.73.216.202
Web Server : Microsoft-IIS/10.0
System : Windows NT WEB-SERVER 10.0 build 20348 (Windows Server 2022) AMD64
User : IUSR ( 0)
PHP Version : 8.3.28
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/Python313/Lib/test/test_sqlite3/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/Python313/Lib/test/test_sqlite3/__pycache__/test_dbapi.cpython-313.pyc
�

��i'9���SSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSK	r
SSKrSSKJ
r
JrJr SSKJr SSKJrJr SSKJrJrJr SSKJrJrJrJrJr SSKJrJr SS	KJr "S
S\R@5r!"SS
\R@5r""SS\R@5r#\RH"\%"\RLS5S5"SS\R@55r'"SS\R@5r("SS\R@5r)"SS\R@5r*\RV"5"SS\R@55r,"SS\R@5r-"SS\R@5r."S S!\R@5r/"S"S#\\R@5r0"S$S%\R@5r1\"5"S&S'\R@55r2"S(S)\R@5r3\4S*:Xa\Rj"5 gg)+�N)�
SHORT_TIMEOUT�check_disallow_instantiation�requires_subprocess)�
gc_collect)�threading_helper�
import_helper)�SEEK_SET�SEEK_CUR�SEEK_END)�TESTFN�TESTFN_UNDECODABLE�unlink�temp_dir�FakePath�)�memory_database�cx_limit)�MemoryDatabaseMixinc��\rSrSrSrSrSrSrSrSr	Sr
S	rS
rSr
SrS
rSrSrSrSrSrSrSrSrg)�ModuleTests�.c�h�UR[RSS[R-5 g)Nz2.0zapilevel is %s, should be 2.0)�assertEqual�sqlite�apilevel��selfs �1C:\Python313\\Lib\test\test_sqlite3\test_dbapi.py�test_api_level�ModuleTests.test_api_level/s%��������%�8�6�?�?�J�	L�c��SnSH�nURUS9 UR[U5n[[U5 SSS5 URWR[5 UR[U5n[[RU5 SSS5 URUR[5 SSS5 M� g!,(df   N�=f!,(df   NL=f!,(df   M�=f)Nz-deprecated and will be removed in Python 3.14)�version�version_info)�attr)	�subTest�assertWarnsRegex�DeprecationWarning�getattrrr�filename�__file__�dbapi2)r�msgr%�cms    r�test_deprecated_version�#ModuleTests.test_deprecated_version3s���=��-�D����4��(��*�*�+=�s�C�r��F�D�)�D�� � ����x�8��*�*�+=�s�C�r��F�M�M�4�0�D�� � ����x�8�
)�(�.�C�C��D�C��	)�(�s9�C/�C
�>C/�=C�(C/�
C�C/�
C,�(C/�/
C>	c�l�UR[R1SkS[R-5 g)N>rr�z'threadsafety is %d, should be 0, 1 or 3)�assertInr�threadsafetyrs r�test_thread_safety�ModuleTests.test_thread_safety>s)���
�
�f�)�)�9�?��)�)�*�	+r!c�h�UR[RSS[R-5 g)N�qmarkz%paramstyle is '%s', should be 'qmark')rr�
paramstylers r�test_param_style�ModuleTests.test_param_styleCs+������*�*�G�@��*�*�+�	,r!c�`�UR[[R[5S5 g)Nz&Warning is not a subclass of Exception)�
assertTrue�
issubclassr�Warning�	Exceptionrs r�test_warning�ModuleTests.test_warningHs�����
�6�>�>�9�=�=�	?r!c�`�UR[[R[5S5 g)Nz$Error is not a subclass of Exception)r=r>r�Errorr@rs r�
test_error�ModuleTests.test_errorLs�����
�6�<�<��;�>�	@r!c�t�UR[[R[R5S5 g)Nz)InterfaceError is not a subclass of Error)r=r>r�InterfaceErrorrDrs r�test_interface_error� ModuleTests.test_interface_errorPs%�����
�6�#8�#8�&�,�,�G�C�	Er!c�t�UR[[R[R5S5 g)Nz(DatabaseError is not a subclass of Error)r=r>r�
DatabaseErrorrDrs r�test_database_error�ModuleTests.test_database_errorTs%�����
�6�#7�#7����F�B�	Dr!c�t�UR[[R[R5S5 g)Nz,DataError is not a subclass of DatabaseError)r=r>r�	DataErrorrLrs r�test_data_error�ModuleTests.test_data_errorXs'�����
�6�#3�#3�V�5I�5I�J�F�	Hr!c�t�UR[[R[R5S5 g)Nz3OperationalError is not a subclass of DatabaseError)r=r>r�OperationalErrorrLrs r�test_operational_error�"ModuleTests.test_operational_error\�'�����
�6�#:�#:�F�<P�<P�Q�M�	Or!c�t�UR[[R[R5S5 g)Nz1IntegrityError is not a subclass of DatabaseError)r=r>r�IntegrityErrorrLrs r�test_integrity_error� ModuleTests.test_integrity_error`s'�����
�6�#8�#8�&�:N�:N�O�K�	Mr!c�t�UR[[R[R5S5 g)Nz0InternalError is not a subclass of DatabaseError)r=r>r�
InternalErrorrLrs r�test_internal_error�ModuleTests.test_internal_errords'�����
�6�#7�#7��9M�9M�N�J�	Lr!c�t�UR[[R[R5S5 g)Nz3ProgrammingError is not a subclass of DatabaseError)r=r>r�ProgrammingErrorrLrs r�test_programming_error�"ModuleTests.test_programming_errorhrWr!c�t�UR[[R[R5S5 g)Nz4NotSupportedError is not a subclass of DatabaseError)r=r>r�NotSupportedErrorrLrs r�test_not_supported_error�$ModuleTests.test_not_supported_errorls*�����
�6�#;�#;�#)�#7�#7�9�N�	Pr!c�Z�/SQnUSS/-
nU/SQ-
n[RS:�aU/SQ-
n[RS:�aU/SQ-
n[RS	:�aUS
S/-
n[RS:�aUS
S/-
n[RS:�aU/SQ-
n[RS:�aU/SQ-
n[RS:�aURS5 UH:nURUS9 UR	[[U55 SSS5 M< g!,(df   MN=f)N)N�SQLITE_ABORT�SQLITE_ALTER_TABLE�SQLITE_ANALYZE�
SQLITE_ATTACH�SQLITE_AUTH�SQLITE_BUSY�SQLITE_CANTOPEN�SQLITE_CONSTRAINT�SQLITE_CORRUPT�SQLITE_CREATE_INDEX�SQLITE_CREATE_TABLE�SQLITE_CREATE_TEMP_INDEX�SQLITE_CREATE_TEMP_TABLE�SQLITE_CREATE_TEMP_TRIGGER�SQLITE_CREATE_TEMP_VIEW�SQLITE_CREATE_TRIGGER�SQLITE_CREATE_VIEW�SQLITE_CREATE_VTABLE�
SQLITE_DELETE�SQLITE_DENY�
SQLITE_DETACH�SQLITE_DONE�SQLITE_DROP_INDEX�SQLITE_DROP_TABLE�SQLITE_DROP_TEMP_INDEX�SQLITE_DROP_TEMP_TABLE�SQLITE_DROP_TEMP_TRIGGER�SQLITE_DROP_TEMP_VIEW�SQLITE_DROP_TRIGGER�SQLITE_DROP_VIEW�SQLITE_DROP_VTABLE�SQLITE_EMPTY�SQLITE_ERROR�
SQLITE_FORMAT�SQLITE_FULL�SQLITE_FUNCTION�
SQLITE_IGNORE�
SQLITE_INSERT�SQLITE_INTERNAL�SQLITE_INTERRUPT�SQLITE_IOERR�SQLITE_LIMIT_WORKER_THREADS�
SQLITE_LOCKED�SQLITE_MISMATCH�
SQLITE_MISUSE�SQLITE_NOLFS�SQLITE_NOMEM�
SQLITE_NOTADB�SQLITE_NOTFOUND�
SQLITE_NOTICE�	SQLITE_OK�SQLITE_PERM�
SQLITE_PRAGMA�SQLITE_PROTOCOL�SQLITE_RANGE�SQLITE_READ�SQLITE_READONLY�SQLITE_RECURSIVE�SQLITE_REINDEX�
SQLITE_ROW�SQLITE_SAVEPOINT�
SQLITE_SCHEMA�
SQLITE_SELECT�
SQLITE_TOOBIG�SQLITE_TRANSACTION�
SQLITE_UPDATE�SQLITE_WARNING�SQLITE_LIMIT_LENGTH�SQLITE_LIMIT_SQL_LENGTH�SQLITE_LIMIT_COLUMN�SQLITE_LIMIT_EXPR_DEPTH�SQLITE_LIMIT_COMPOUND_SELECT�SQLITE_LIMIT_VDBE_OP�SQLITE_LIMIT_FUNCTION_ARG�SQLITE_LIMIT_ATTACHED� SQLITE_LIMIT_LIKE_PATTERN_LENGTH�SQLITE_LIMIT_VARIABLE_NUMBER�SQLITE_LIMIT_TRIGGER_DEPTH�PARSE_DECLTYPES�PARSE_COLNAMES)8�SQLITE_ABORT_ROLLBACK�SQLITE_AUTH_USER�SQLITE_BUSY_RECOVERY�SQLITE_BUSY_SNAPSHOT�SQLITE_CANTOPEN_CONVPATH�SQLITE_CANTOPEN_FULLPATH�SQLITE_CANTOPEN_ISDIR�SQLITE_CANTOPEN_NOTEMPDIR�SQLITE_CONSTRAINT_CHECK�SQLITE_CONSTRAINT_COMMITHOOK�SQLITE_CONSTRAINT_FOREIGNKEY�SQLITE_CONSTRAINT_FUNCTION�SQLITE_CONSTRAINT_NOTNULL�SQLITE_CONSTRAINT_PRIMARYKEY�SQLITE_CONSTRAINT_ROWID�SQLITE_CONSTRAINT_TRIGGER�SQLITE_CONSTRAINT_UNIQUE�SQLITE_CONSTRAINT_VTAB�SQLITE_CORRUPT_VTAB�SQLITE_IOERR_ACCESS�SQLITE_IOERR_AUTH�SQLITE_IOERR_BLOCKED�SQLITE_IOERR_CHECKRESERVEDLOCK�SQLITE_IOERR_CLOSE�SQLITE_IOERR_CONVPATH�SQLITE_IOERR_DELETE�SQLITE_IOERR_DELETE_NOENT�SQLITE_IOERR_DIR_CLOSE�SQLITE_IOERR_DIR_FSYNC�SQLITE_IOERR_FSTAT�SQLITE_IOERR_FSYNC�SQLITE_IOERR_GETTEMPPATH�SQLITE_IOERR_LOCK�SQLITE_IOERR_MMAP�SQLITE_IOERR_NOMEM�SQLITE_IOERR_RDLOCK�SQLITE_IOERR_READ�SQLITE_IOERR_SEEK�SQLITE_IOERR_SHMLOCK�SQLITE_IOERR_SHMMAP�SQLITE_IOERR_SHMOPEN�SQLITE_IOERR_SHMSIZE�SQLITE_IOERR_SHORT_READ�SQLITE_IOERR_TRUNCATE�SQLITE_IOERR_UNLOCK�SQLITE_IOERR_VNODE�SQLITE_IOERR_WRITE�SQLITE_LOCKED_SHAREDCACHE�SQLITE_NOTICE_RECOVER_ROLLBACK�SQLITE_NOTICE_RECOVER_WAL�SQLITE_OK_LOAD_PERMANENTLY�SQLITE_READONLY_CANTLOCK�SQLITE_READONLY_DBMOVED�SQLITE_READONLY_RECOVERY�SQLITE_READONLY_ROLLBACK�SQLITE_WARNING_AUTOINDEX)r2�r)�SQLITE_IOERR_BEGIN_ATOMIC�SQLITE_IOERR_COMMIT_ATOMIC�SQLITE_IOERR_ROLLBACK_ATOMIC)r2�r)�SQLITE_ERROR_MISSING_COLLSEQ�SQLITE_ERROR_RETRY�SQLITE_READONLY_CANTINIT�SQLITE_READONLY_DIRECTORY)r2�r�SQLITE_CORRUPT_SEQUENCE�SQLITE_LOCKED_VTAB�r2�r�SQLITE_CANTOPEN_DIRTYWAL�SQLITE_ERROR_SNAPSHOT)r2�r)�SQLITE_CANTOPEN_SYMLINK�SQLITE_CONSTRAINT_PINNED�SQLITE_OK_SYMLINK)r2� r)�SQLITE_BUSY_TIMEOUT�SQLITE_CORRUPT_INDEX�SQLITE_IOERR_DATA)r2�"r�SQLITE_IOERR_CORRUPTFS)�const)r�sqlite_version_info�appendr&r=�hasattr)r�constsrs   r�test_module_constants�!ModuleTests.test_module_constantsqs?��P
��b	�$�&6�7�7���9
�9	
��t�%�%��3���
�F�
�%�%��3���
�F��%�%��3��0�2F�G�G�F��%�%��3��1�3J�K�K�F��%�%��3���
�F�
�%�%��3���
�F�
�%�%��3��M�M�2�3��E����E��*������� 6�7�+�*��*�*�s�. D�
D*	c��Sn[RRS5(a[RnO[R
n[
5nUR[RU5n[R"U5 SSS5 WRnURURU5 URURRS55 SSS5 g!,(df   Ni=f!,(df   g=f)N�unable to open database file�winro)�sys�platform�
startswithrr�ror�assertRaisesRegexrD�connect�	exceptionr�sqlite_errorcoder=�sqlite_errorname)r�err_msg�err_code�dbr.�es      r�test_error_code_on_exception�(ModuleTests.test_error_code_on_exception"s���0���<�<�"�"�5�)�)��3�3�H��-�-�H�
�Z�2��'�'����g�>�"����r�"�?����A����Q�/�/��:��O�O�A�.�.�9�9�:K�L�M��Z�>�>���Z�s%�!C>�3C-�
AC>�-
C;	�7C>�>
Dc���[5nU URS5 SSS5 SnUR[RU5nURS5 SSS5 WR
nUR
UR[R5 UR
URS5 SSS5 g!,(df   N�=f!,(df   Nz=f!,(df   g=f)Nz&create table t(t integer check(t > 0))zconstraint failedzinsert into t values(-1)r�)
r�executerrrYrrrr�r)r�con�errmsgr.�excs     r�%test_extended_error_code_on_exception�1ModuleTests.test_extended_error_code_on_exception0s���
�
�#�����D�E��(�F��'�'��(=�(=�v�F�"����6�7�G��,�,�C����S�1�1�#�;�;�
=����S�1�1�3L�M��
����G�F��	�
�s:�C!�B?�*C!�
C�AC!�?
C
	�	C!�
C	�C!�!
C/c	��[5n[U[U"S555 [U[R5 SSS5 g!,(df   g=f)N�select 1)rr�typer�Blob�r�cxs  r�test_disallow_instantiation�'ModuleTests.test_disallow_instantiation<s7��
�
�"�(��t�B�z�N�/C�D�(��v�{�{�;��
�
�s�6A
�

Ac��UR[R"S55 UR[R"S55 g)Nzselect tzcreate table t(t);)�assertFalser�complete_statementr=rs r�test_complete_statement�#ModuleTests.test_complete_statementAs3������2�2�:�>�?�����1�1�2F�G�Hr!�N)�__name__�
__module__�__qualname__�__firstlineno__rr/r5r:rArErIrMrQrUrZr^rbrfrr!r(r0r5�__static_attributes__r7r!rrr.sp��L�	9�+�
,�
?�@�E�D�H�O�M�L�O�P�
o8�bN�
N�<�
Ir!rc��\rSrSrSrSrSrSrSrSr	Sr
S	rS
rSr
SrS
rSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrg)�ConnectionTestsiFc���[R"S5UlURR5nUR	S5 UR	SS5 UR5 g)N�:memory:z4create table test(id integer primary key, name text)�!insert into test(name) values (?)��foo)rrr/�cursorr$�close�r�cus  r�setUp�ConnectionTests.setUpHsG���.�.��,���
�W�W�^�^�
��
�
�
�I�J�
�
�
�6��A�
���
r!c�8�URR5 g�N�r/rErs r�tearDown�ConnectionTests.tearDownO������
�
�r!c�8�URR5 grK�r/�commitrs r�test_commit�ConnectionTests.test_commitRs�������r!c�l�URR5 URR5 g)zF
A commit should also work when no changes were made to the database.
NrQrs r�test_commit_after_no_changes�,ConnectionTests.test_commit_after_no_changesUs ��	
�����������r!c�8�URR5 grK�r/�rollbackrs r�
test_rollback�ConnectionTests.test_rollback\s�������r!c�l�URR5 URR5 g)zH
A rollback should also work when no changes were made to the database.
NrYrs r�test_rollback_after_no_changes�.ConnectionTests.test_rollback_after_no_changes_s$��	
�����������r!c�8�URR5ngrK�r/rDrFs  r�test_cursor�ConnectionTests.test_cursorfs��
�W�W�^�^�
�r!c��SnUR[R5 [R"U5 SSS5 g!,(df   g=f)Nz/foo/bar/bla/23534/mydb.db)�assertRaisesrrTr)r�YOU_CANNOT_OPEN_THISs  r�test_failed_open� ConnectionTests.test_failed_openis5��;��
�
�
�v�6�6�
7��N�N�/�0�8�
7�
7�s�A�
Ac�8�URR5 grKrLrs r�
test_close�ConnectionTests.test_closenrOr!c���SnURR5nURU5nURR5 UR	[
RUR5 UR	[
RURU5 UR	[
RURU/5 UR	[
RURU5 UR	[
RURRU5 UR	[
RURRU/5 UR	[
RURRU5 UR	[
RURRSSS5 UR	[
RURR5 UR	[
R5 UR SSS5 SSS5 g!,(df   N=f!,(df   g=f)Nr+�trc��U$rKr7��xs r�<lambda>�6ConnectionTests.test_use_after_close.<locals>.<lambda>s��Qr!)r/rDr$rErerra�fetchall�executemany�
executescript�create_function)r�sqlrG�ress    r�test_use_after_close�$ConnectionTests.test_use_after_closeqs�����
�W�W�^�^�
���j�j��o�����
�
�����&�1�1�3�<�<�@����&�1�1�2�:�:�s�C����&�1�1�2�>�>�3��K����&�1�1�2�3C�3C�S�I����&�1�1�4�7�7�?�?�C�H����&�1�1��'�'�-�-�s�B�	8����&�1�1�4�7�7�3H�3H�#�N����&�1�1��'�'�1�1�3��;�	H����&�1�1�4�7�7�>�>�B�
�
�
�v�6�6�
7������8�
7����8�
7�s$�
I�,H?�.I�?
I
	�	I�
Ic��URURR[R5 URURR[R5 URURR
[R
5 URURR[R5 URURR[R5 URURR[R5 URURR[R5 URURR[R5 URURR[R5 URURR[R5 grK)
rr/r?rrDrHrLrPrTrYr]rarers r�test_exceptions�ConnectionTests.test_exceptions�s:����������&�.�.�9������������5�������/�/��1F�1F�G�������.�.��0D�0D�E�������*�*�F�,<�,<�=�������1�1�6�3J�3J�K�������/�/��1F�1F�G�������.�.��0D�0D�E�������1�1�6�3J�3J�K�������2�2�F�4L�4L�Mr!c���[5nUR5nURURS5 UR	S5 URURS5 UR	SS5 URURS5 UR	SS/5 UR5nURURS5 UR
5 URURS5 UR	SS/5 UR5nURURS5 UR5 SSS5 g!,(df   g=f)NFz?create table transactiontest(id integer primary key, name text)z,insert into transactiontest(name) values (?)rBTz-select name from transactiontest where name=?rC)rrDr�in_transactionr$�fetchonerRrE)rr/rG�rows    r�test_in_transaction�#ConnectionTests.test_in_transaction�s��
�
�"�����B����R�.�.��6��J�J�X�Y����R�.�.��6��J�J�E�x�P����R�.�.��5��J�J�F���P��+�+�-�C����R�.�.��5��I�I�K����R�.�.��6��J�J�F���P��+�+�-�C����R�.�.��6��H�H�J��
�
�s�EE�
E$c��UR[5 SURlSSS5 g!,(df   g=f)NT)re�AttributeErrorr/rrs r�test_in_transaction_ro�&ConnectionTests.test_in_transaction_ro�s(��
�
�
�~�
.�%)�D�G�G�"�/�
.�
.�s�1�
?c	�$�/SQnUHtnURUS9 UR[URU55 UR	[[U5[URU55 SSS5 Mv g!,(df   M�=f)N)	rPrLrDrYrHrerTrar?)r')r&r=rr/�assertIsr)r)r�
exceptionsr's   r�test_connection_exceptions�*ConnectionTests.test_connection_exceptions�si��

�
��C����#��&��������� 5�6��
�
�g�f�c�2�G�D�G�G�S�4I�J�'�&��&�&�s�AB�
B	c���URR5 UR[R5 URR5 SSS5 g!,(df   g=frK)r/rErerra�	interruptrs r�test_interrupt_on_closed_db�+ConnectionTests.test_interrupt_on_closed_db�s?�����
�
��
�
�
�v�6�6�
7��G�G����8�
7�
7�s�A�
A,c�V�URURR55 grK)�assertIsNoner/r�rs r�test_interrupt�ConnectionTests.test_interrupt�s�����$�'�'�+�+�-�.r!c��[S5HDnURRSU35nURUR	5SU5 MF g)Ni�zselect r)�ranger/r$rr�)r�nrGs   r�test_drop_unused_refs�%ConnectionTests.test_drop_unused_refs�sC���s��A������7�1�#��/�B����R�[�[�]�1�-�q�1�r!c���[RnURRU5nSnURR	X5nURX$5 URURRU5U5 SnUR
[RUURRS5 URR	X5 g!URR	X5 f=f)N�
�query string is too largezselect 1 as '16')	rr�r/�getlimit�setlimitrrrPr$)r�category�saved_limit�	new_limit�
prev_limitr-s      r�test_connection_limits�&ConnectionTests.test_connection_limits�s����1�1���g�g�&�&�x�0��		4��I����)�)�(�>�J����[�5����T�W�W�-�-�h�7��C�-�C��"�"�6�#3�#3�S�#'�7�7�?�?�4F�
H�
�G�G���X�3��D�G�G���X�3�s�BC�C7c���SnSnUR[RUURRU5 UR[RUURR
US5 g)Nz'category' is out of boundsiWr)rrrar/r�r�)rr-�cats   r�"test_connection_bad_limit_category�2ConnectionTests.test_connection_bad_limit_category�s\��+�������v�6�6��#�w�w�/�/��	6����v�6�6��#�w�w�/�/��a�	9r!c	���SnSnUH�nURUS9 UR[U5 [US9 SSS5 [5nUR[U5 X4lSSS5 URURS5 SSS5 SSS5 M� g!,(df   No=f!,(df   NP=f!,(df   N==f!,(df   M�=f)NzJisolation_level string must be '', 'DEFERRED', 'IMMEDIATE', or 'EXCLUSIVE')�BOGUS� �DEFERRE�IMMEDIAT�EXCLUSIV�	DEFERREDS�
IMMEDIATES�
EXCLUSIVES��level��isolation_level�)r&r�
ValueErrorrr�r)rr-�levelsr�r/s     r�(test_connection_init_bad_isolation_level�8ConnectionTests.test_connection_init_bad_isolation_level�s���
�	�	
���E����E��*��+�+�J��<�#�E�:�=�$�&�"��/�/�
�C�@�-2�*�A��$�$�R�%7�%7��<�	'�+�*��<�<��A�@��'�&��+�*�sQ�C�
B#�C�C�#B4	�*$C�C�#
B1�-C�4
C
�>C�
C�C�
C%	c��SH�nURUS9 [US9nURURU5 SSS5 [5nURURS5 XlURURU5 SSS5 SSS5 M� g!,(df   Nl=f!,(df   N,=f!,(df   M�=f)N)r��DEFERRED�	IMMEDIATE�	EXCLUSIVENr�r�r�)r&rrr�)rr�r/s   r�*test_connection_init_good_isolation_levels�:ConnectionTests.test_connection_init_good_isolation_levels�s���E�E����E��*�$�U�;�r��$�$�R�%7�%7��?�<�$�&�"��$�$�R�%7�%7��<�).�&��$�$�R�%7�%7��?�'�+�*�F�;�;��&�&��+�*�s9�
C�B"�C�?B3�
C�"
B0�,C�3
C�=C�
C	c��[5n[Ul[RUlUR
5nURS5 URSS[S555 URS5 URS5Vs/sHo3PM nnUR[SU555 URUVs/sHo3SPM	 snS	S
/5 URS5 URS5 URSSS
55 UR5Vs/sHo3PM nnUR[SU555 URUVs/sHo3SPM	 snSS/5 UR!5 SSS5 gs snfs snfs snfs snf!,(df   g=f)Nzcreate table foo (bar)z insert into foo (bar) values (?)c3�:# �UHn[U54v� M g7frK)�str��.0�vs  r�	<genexpr>�9ConnectionTests.test_connection_reinit.<locals>.<genexpr>s���8�x�!�S��V�I�x����zselect bar from foo�c3�V# �UHn[U[R5v� M! g7frK��
isinstancer�Row�r��rs  rr�r�����H�4�a�
�1�f�j�j� 9� 9�4���')r�0�1r@c3�&# �UHo4v� M	 g7frKr7r�s  rr�r�s���?�*>�Q�D�*>���)�a�b�c�dc3�V# �UHn[U[R5v� M! g7frKr�r�s  rr�r�r�r��2�3)r�bytes�text_factoryrr��row_factoryrDr$rtr��	fetchmanyr=�allr�__init__rsrE)rr/rGr��rowss     r�test_connection_reinit�&ConnectionTests.test_connection_reinitsh��
�
�"�#�B�O�#�Z�Z�B�N�����B��J�J�/�0��N�N�=�8�u�Q�x�8�
:��J�J�,�-�!�|�|�A��/��!�A��D�/��O�O�C�H�4�H�H�I����D�1�D�q��d�D�1�D�$�<�@��K�K�
�#��J�J�/�0��N�N�=�?�*>�?�
A� "�{�{�}�-�}�!�A�}�D�-��O�O�C�H�4�H�H�I����D�1�D�q��d�D�1�C��:�>��H�H�J�-�
��0��1��.��1�+�
�sC�BF7�F#�2F7�F(
�AF7�5F-�2F7�2F2
�F7�#F7�7
Gc��[R"S5nU URS5 SSS5 [5nUR	[R
SURU5 UR	[RSURSS[S555 SSS5 g!,(df   N�=f!,(df   g=f)Nr@�create table t(t)r�#Base Connection.__init__ not calledzinsert into t values(?)c3�&# �UHo4v� M	 g7frKr7r�s  rr��=ConnectionTests.test_connection_bad_reinit.<locals>.<genexpr>$s���#;�(�Q�D�(�r�r2)
rrr$rrrTr�rartr�)rr/rs   r�test_connection_bad_reinit�*ConnectionTests.test_connection_bad_reinits���
�^�^�J�
'��
��J�J�*�+��
�Z�2��"�"�6�#:�#:�#A�#%�;�;��
4�
�"�"�6�#:�#:�#H�#%�>�>�3L�#;�%��(�#;�
=�	�Z��R��
�Z�s�B0�A*C�0
B>�
Cc���[Rn[5nUR[S5 URS5 SSS5 URU5nU(+nUR
X5 URURU5U5 UR
U5 URURU55 U URS5 SSS5 UR[RS5 URS5 SSS5 SSS5 g!,(df   N�=f!,(df   Nb=f!,(df   N9=f!,(df   g=f)N�unknown���z�
                    create table t(t integer primary key);
                    create table u(u, foreign key(u) references t(t));
                �
constraintzinsert into u values(0))r�SQLITE_DBCONFIG_ENABLE_FKEYrrr��	getconfig�	setconfigrr=rurYr$)r�opr/�old�news     r�test_connection_config�&ConnectionTests.test_connection_config&s��
�
/�
/��
�
�"��'�'�
�I�>����R� �?��,�,�r�"�C��'�C��L�L��!����R�\�\�"�-�s�3��L�L����O�O�B�L�L��,�-��� � �"���
�'�'��(=�(=�|�L��
�
�4�5�M�'�
�>�>�����
M�L��'�
�sS�E�D&�BE�	D7�(E�E�E�&
D4	�0E�7
E	�E�
E	�E�
E'c��SnUR[U5n[R"SS5nUR	5 SSS5 URWR[5 g!,(df   N/=f)Nz�Passing more than 1 positional argument to sqlite3.connect\(\) is deprecated. Parameters 'timeout', 'detect_types', 'isolation_level', 'check_same_thread', 'factory', 'cached_statements' and 'uri' will become keyword-only parameters in Python 3.15.r@��?)r'r(rrrErr*r+)r�regexr.r/s    r�!test_connect_positional_arguments�1ConnectionTests.test_connect_positional_arguments>s^��
)�	��
"�
"�#5�u�
=�����
�C�0�B��H�H�J�>�	
������h�/�>�
=�s�(A*�*
A8c��UR[5 [R"S5nA[	5 SSS5 g!,(df   g=f�Nr@)�assertWarns�ResourceWarningrrrr.s  r� test_connection_resource_warning�0ConnectionTests.test_connection_resource_warningKs2��
�
�
�o�
.����
�+�B���L�/�
.�
.�s�"A�
Ac�j�SSKJn U"UR5nUR[	U5S5 g)Nr)�	signaturez(sql, /))�inspectrr/rr�)rr�sigs   r�test_connection_signature�)ConnectionTests.test_connection_signatureQs'��%����� ������S��:�.r!�r/N) r8r9r:r;rHrMrSrVr[r^rbrgrjryr|r�r�r�r�r�r�r�r�r�r�r�r�r�r�rr
r<r7r!rr>r>Fs����������1�
��(N��&*�K�" �
/�2�
4�9�=�2@��2=�6�00��/r!r>c� �\rSrSrSrSrSrg)�UninitialisedConnectionTestsiWc�h�[RR[R5UlgrK)r�
Connection�__new__r/rs rrH�"UninitialisedConnectionTests.setUpXs ���#�#�+�+�F�,=�,=�>��r!c��^�U4SjU4SjU4SjU4SjU4SjU4Sj4nUH<nTRUS9 TR[RSU5 SSS5 M> g!,(df   MP=f)	Nc�0>�TRR$rK)r/r�rs�rrq�EUninitialisedConnectionTests.test_uninit_operations.<locals>.<lambda>]s���D�G�G�+�+r!c�0>�TRR$rK)r/�
total_changesrs�rrqr^s���D�G�G�)�)r!c�0>�TRR$rK)r/rrs�rrqr_s���D�G�G�*�*r!c�8>�TRR5$rK)r/�iterdumprs�rrqr`s���D�G�G�$�$�&r!c�8>�TRR5$rKrars�rrqras���D�G�G�N�N�$r!c�8>�TRR5$rKrLrs�rrqrbs���D�G�G�M�M�Or!)�funcr�)r&rrra)r�funcsrs`  r�test_uninit_operations�3UninitialisedConnectionTests.test_uninit_operations[sa���+�)�*�&�$�#�

���D����4��(��&�&�v�'>�'>�'L�'+�-�)�(��(�(�s�"A%�%
A4	rN)r8r9r:r;rHrr<r7r!rrrWs��?�
-r!r�	serializezNeeds SQLite serialize APIc�&�\rSrSrSrSrSrSrg)�SerializeTestsikc��[5nU URS5 SSS5 UR5nU URS5 SSS5 SnUR[R
U5 URS5 SSS5 UR
U5 URS5 SSS5 g!,(df   N�=f!,(df   N�=f!,(df   N[=f!,(df   g=f)Nr�zdrop table tz
no such tablezselect t from t)rr$r!rrrT�deserialize)rr/�datar�s    r�test_serialize_deserialize�)SerializeTests.test_serialize_deserializens���
�
�"���
�
�.�/���<�<�>�D���
�
�>�*��#�E��'�'��(?�(?��G��
�
�,�-�H�
�N�N�4� ��J�J�(�)��
����
���H�G���
�sP�C.�B;�C.�C�*C.�6C�*C.�;
C		�C.�
C	�C.�
C+	�'C.�.
C<c�H�[[S5SSS24[/4[S4[S44nUHLup#URX#S9 [	5nURX$RU5 SSS5 SSS5 MN g!,(df   N=f!,(df   Mq=f)Nsblobr�r)r'�arg)�BufferError�
memoryview�	TypeErrorr&rrer%)r�datasetr'r*r/s     r�test_deserialize_wrong_args�*SerializeTests.test_deserialize_wrong_argss���
�*�W�-�c��c�2�3�
��O�
��N�
���	
�� �H�C����#��/�$�&�"��%�%�c�>�>�3�?�'�0�/� �&�&��0�/�s$�B�B�,B�
B�B�
B!	c��[5nSnUR[RU5 UR	S5 URS5 SSS5 SSS5 g!,(df   N=f!,(df   g=f)Nzfile is not a databaseszcreate table fail(f))rrrrLr%r$)rr/r�s   r�!test_deserialize_corrupt_database�0SerializeTests.test_deserialize_corrupt_database�s^��
�
�"�,�E��'�'��(<�(<�e�D����y�)��
�
�1�2�	E��
�D�D���
�s"�#A3�#A"�A3�"
A0	�,A3�3
Br7N)r8r9r:r;r'r/r2r<r7r!rr#r#ks��*�"
@�3r!r#c���\rSrSrSrSrSrSr\R"\
RS:HS5S5rS	r
S
rSr\R"\
RS:HS5S5rS
rSrSrg)�	OpenTestsi�zcreate table test(id integer)c���[R"[5nUR[U5 UR[RRU55 [R"[R"U55nUR[RRU55 URUR5 SSS5 g!,(df   g=frK)�os�fsencoder�
addCleanuprr3�path�exists�
contextlib�closingrrr=r$�_sql�rr:r/s   r�test_open_with_bytes_path�#OpenTests.test_open_with_bytes_path�s����{�{�6�"�������%����������-�.�
�
�
����t� 4�
5���O�O�B�G�G�N�N�4�0�1��J�J�t�y�y�!�6�
5�
5�s
�	A
C�
C*c���[[5nUR[U5 UR	[
RRU55 [R"[R"U55nUR[
RRU55 URUR5 SSS5 g!,(df   g=f)zoChecks that we can successfully connect to a database using an object that
is PathLike, i.e. has __fspath__(). N)rrr9rr3r7r:r;r<r=rrr=r$r>r?s   r�test_open_with_path_like_object�)OpenTests.test_open_with_path_like_object�s������������%����������-�.�
�
�
����t� 4�
5���O�O�B�G�G�N�N�4�0�1��J�J�t�y�y�!�6�
5�
5�s
�>A
C�
Cc���[nU(dURS5 [US5R5 [U5 U$![a URSU<35 N.f=f)Nz)only works if there are undecodable paths�wbz(can't create file with undecodable path )r
�skipTest�openrE�OSErrorr)rr:s  r�get_undecodable_path�OpenTests.get_undecodable_path�se��!����M�M�E�F�	O���t��"�"�$�	�t������	O��M�M�D�T�H�M�N�	O�s�A�A)�(A)�win32zskipped on Windowsc�j�UR5nUR[U5 [R"[
R"U55nUR[RRU55 URUR5 SSS5 g!,(df   g=frK)
rJr9rr<r=rrr=r7r:r;r$r>r?s   r�test_open_with_undecodable_path�)OpenTests.test_open_with_undecodable_path�sl���(�(�*�������%�
�
�
����t� 4�
5���O�O�B�G�G�N�N�4�0�1��J�J�t�y�y�!�6�
5�
5�s
�A
B$�$
B2c��[nUR[U5 S[RR[R"U55-nUR[RRU55 [R"[R"USS95nUR[RRU55 UR!UR"5 SSS5 g!,(df   g=f�N�file:T��uri)rr9r�urllib�parse�quoter7r8r3r:r;r<r=rrr=r$r>�rr:rTr/s    r�
test_open_uri�OpenTests.test_open_uri�s����������%�����*�*�2�;�;�t�+<�=�=�����������-�.�
�
�
����s�� =�
>�"��O�O�B�G�G�N�N�4�0�1��J�J�t�y�y�!�?�
>�
>�s
�*A
C=�=
Dc��[nUR[U5 SU-nUR[R
R
U55 [R"[R"USS95nUR[R
R
U55 URUR5 SSS5 g!,(df   g=frQ)rr9rr3r7r:r;r<r=rrr=r$r>rXs    r�test_open_unquoted_uri� OpenTests.test_open_unquoted_uri�s����������%���n�����������-�.�
�
�
����s�� =�
>�"��O�O�B�G�G�N�N�4�0�1��J�J�t�y�y�!�?�
>�
>�s
�9A
C�
Cc���[nUR[U5 S[RR[R"U55-S-nUR[RRU55 UR[R5 [R"USS9 SSS5 UR[RRU55 [R"U5R5 UR![RRU55 ["R$"[R"USS95nUR[R5 UR'UR(5 SSS5 SSS5 g!,(df   GN=f!,(df   N)=f!,(df   g=f)NrRz?mode=roTrS)rr9rrUrVrWr7r8r3r:r;rerrTrrEr=r<r=r$r>rXs    r�test_open_uri_readonly� OpenTests.test_open_uri_readonly�s.���������%�����*�*�2�;�;�t�+<�=�=�
�J�����������-�.�
�
�
�v�6�6�
7��N�N�3�D�)�8����������-�.����t��"�"�$���������t�,�-�
�
�
����s�� =�
>�"��"�"�6�#:�#:�;��
�
�4�9�9�%�<�?�
>�
8�
7��<�;��?�
>�s0�#F7�* G�
G	�&G�7
G�	
G	�G�
G(c��UR5nUR[U5 S[RRU5-n[R"[R"USS95nUR[RRU55 URUR5 SSS5 g!,(df   g=frQ)rJr9rrUrVrWr<r=rrr=r7r:r;r$r>rXs    r�test_open_undecodable_uri�#OpenTests.test_open_undecodable_uri�s����(�(�*�������%�����*�*�4�0�0��
�
�
����s�� =�
>�"��O�O�B�G�G�N�N�4�0�1��J�J�t�y�y�!�?�
>�
>�s
�2A
C�
Cc�,^�U4Sjn[[R"[5[[5[[R"[554H9nSm[R
"X!S9R
5 URTU5 M; g)Nc�<>�Um[R"S/UQ70UD6$r)rr)�database�args�kwargs�database_args   �r�factory�4OpenTests.test_factory_database_arg.<locals>.factory�s#���#�L��$�$�Z�A�$�A�&�A�Ar!)rj)rr7r8rrrrEr)rrjrfris   @r�test_factory_database_arg�#OpenTests.test_factory_database_arg�si���	B�
 ����V�!4�!�&�)�8�B�K�K��4G�+H�J�H��L��N�N�8�5�;�;�=����\�8�4�	Jr!c���[R"[R"SS95nUR	[U5[R5 SSS5 g!,(df   g=f)Nr@)rf)r<r=rrrr,rr.s  r�test_database_keyword�OpenTests.test_database_keyword�sB��
�
�
����
� C�
D�����T�"�X�v�'8�'8�9�E�
D�
D�s�*A�
A*r7N)r8r9r:r;r>r@rCrJ�unittest�skipIfrrrNrYr\r_rbrlror<r7r!rr5r5�s���*�D�"�"�	��_�_�S�\�\�W�,�.B�C�"�D�"�"�"�&� �_�_�S�\�\�W�,�.B�C�"�D�"�
5�:r!r5c���\rSrSrSrSrSrSrSrSr	Sr
S	rS
rSr
SrS
rSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSr Sr!\"RF"\$RJS :S!5S"5r&S#r'S$r(S%r)S&r*S'r+S(r,S)r-S*r.S+r/S,r0S-r1S.r2S/r3S0r4S1r5S2r6S3r7S4r8S5r9S6r:S7r;S8r<S9r=S:r>S;r?S<r@S=rAS>rBS?rCS@rDgA)B�CursorTestsi�c���[R"S5UlURR5UlURRS5 URRSS5 g)Nr@z\create table test(id integer primary key, name text, income number, unique_test text unique)rArB�rrr/rDrGr$rs rrH�CursorTests.setUp�sN���.�.��,����'�'�.�.�"��������
6�	
�	
�����;�X�Fr!c�l�URR5 URR5 grK�rGrEr/rs rrM�CursorTests.tearDown������
�
�����
�
�r!c�:�URRS5 g)N�delete from test�rGr$rs r�test_execute_no_args� CursorTests.test_execute_no_argss�������*�+r!c��UR[R5 URR	S5 SSS5 g!,(df   g=f)Nzselect asdf)rerrTrGr$rs r�test_execute_illegal_sql�$CursorTests.test_execute_illegal_sql
s2��
�
�
�v�6�6�
7��G�G�O�O�M�*�8�
7�
7���A�
Ac��SnSnUH_nURUS9 UR[RU5 URRU5 SSS5 SSS5 Ma g!,(df   N=f!,(df   M�=f)Nz,You can only execute one statement at a time)
zselect 1; select 2z)select 1; // c++ comments are not allowedzselect 1; *not a commentzselect 1; -*not a commentzselect 1; /* */ azselect 1; /**/azselect 1; -zselect 1; /zselect 1; -
- select 2zHselect 1;
               -- comment
               select 2
            ��query)r&rrrarGr$)rr-r.r�s    r� test_execute_multiple_statements�,CursorTests.test_execute_multiple_statementssl��<��
���E����E��*��+�+�F�,C�,C�S�I��G�G�O�O�E�*�J�+�*��I�I��+�*�s"�!A<�A+�A<�+
A9�5A<�<
B	c��SnUH6nURUS9 URRU5 SSS5 M8 g!,(df   MJ=f)N)zselect 1; -- foo barzselect 1; --zselect 1; /*zT
            select 5+4;

            /*
            foo
            */
            r�)r&rGr$)rr.r�s   r�#test_execute_with_appended_comments�/CursorTests.test_execute_with_appended_comments$sB��
���E����E��*�������&�+�*��*�*�s�A�
A	c��UR[5 URRS5 SSS5 g!,(df   g=f�N�*)rer-rGr$rs r�test_execute_wrong_sql_arg�&CursorTests.test_execute_wrong_sql_arg5s,��
�
�
�y�
)��G�G�O�O�B��*�
)�
)��	�;�
A	c�<�URRSS5 g)N�insert into test(id) values (?))r�r~rs r�test_execute_arg_int� CursorTests.test_execute_arg_int9s�������9�5�Ar!c�<�URRSS5 g)N�#insert into test(income) values (?))gq=
ף��@r~rs r�test_execute_arg_float�"CursorTests.test_execute_arg_float<s�������=�z�Jr!c�<�URRSS5 g)NrA)�Hugor~rs r�test_execute_arg_string�#CursorTests.test_execute_arg_string?s�������;�Y�Gr!c��URRSS5 URRSURR45 URR5nUR	USS5 g)NrA)�Hugoz select name from test where id=?rr�)rGr$�	lastrowidr�r�rr�s  r�&test_execute_arg_string_with_zero_byte�2CursorTests.test_execute_arg_string_with_zero_byteBs[�������;�]�K������:�T�W�W�=N�=N�<P�Q��g�g��� ������Q���,r!c��UR[R5nURR	SS5 SSS5 UR[
WR5S5 g!,(df   N4=f)Nr�r�z"parameters are of unsupported type)rerrarGr$rr�r)rr.s  r�test_execute_non_iterable�%CursorTests.test_execute_non_iterableIsS��
�
�
�v�6�6�
7�2��G�G�O�O�=�r�B�8�����R�\�\�*�,P�Q�8�
7�s�A+�+
A9c��UR[R5 URR	SS5 SSS5 g!,(df   g=f)Nr�)��Egon�rerrarGr$rs r�test_execute_wrong_no_of_args1�*CursorTests.test_execute_wrong_no_of_args1Ns5��
�
�
�v�6�6�
7��G�G�O�O�=�|�L�8�
7�
7�s�A�
Ac��UR[R5 URR	S5 SSS5 g!,(df   g=f�Nr�r�rs r�test_execute_wrong_no_of_args2�*CursorTests.test_execute_wrong_no_of_args2S�3��
�
�
�v�6�6�
7��G�G�O�O�=�>�8�
7�
7�r�c��UR[R5 URR	S5 SSS5 g!,(df   g=fr�r�rs r�test_execute_wrong_no_of_args3�*CursorTests.test_execute_wrong_no_of_args3Xr�r�c���URRS5 URRSS/5 URR5nURUSS5 g)N�%insert into test(name) values ('foo')�"select name from test where name=?rCr�rGr$r�rr�s  r�test_execute_param_list�#CursorTests.test_execute_param_list]sN�������?�@������<�u�g�F��g�g��� ������Q���'r!c���"SS5nURRS5 URRSU"55 URR5nURUSS5 g)Nc� �\rSrSrSrSrSrg)�2CursorTests.test_execute_param_sequence.<locals>.Lidc��g)Nrr7rs r�__len__�:CursorTests.test_execute_param_sequence.<locals>.L.__len__es��r!c��US:Xdeg)NrrCr7�rrps  r�__getitem__�>CursorTests.test_execute_param_sequence.<locals>.L.__getitem__gs���A�v�
�v�r!r7N�r8r9r:r;r�r�r<r7r!r�Lr�ds��
�
r!r�r�r�rrCr�)rr�r�s   r�test_execute_param_sequence�'CursorTests.test_execute_param_sequencecsZ��	�	�	
�����?�@������<�a�c�B��g�g��� ������Q���'r!c���"SS5nURRS5 UR[5 URRSU"55 SSS5 g!,(df   g=f)Nc� �\rSrSrSrSrSrg)�:CursorTests.test_execute_param_sequence_bad_len.<locals>.Lirc��SS- g)Nrrr7rs rr��BCursorTests.test_execute_param_sequence_bad_len.<locals>.L.__len__ss	���!�r!c��[erK)�AssertionError)�slfrps  rr��FCursorTests.test_execute_param_sequence_bad_len.<locals>.L.__getitem__us��$�$r!r7Nr�r7r!rr�r�rs��
�
%r!r�r�r�)rGr$re�ZeroDivisionError)rr�s  r�#test_execute_param_sequence_bad_len�/CursorTests.test_execute_param_sequence_bad_lenpsO��	%�	%�	
�����?�@�
�
�
�0�
1��G�G�O�O�@�!�#�F�2�
1�
1�s�"A&�&
A4c�L�SnSnUHwup4URX4S9 UR[U5nURR	X45 SSS5 URWR[5 SSS5 My g!,(df   N;=f!,(df   M�=f)N))z	select :a�r)zselect :a, ?, ?�rr�r2)zselect ?, :b, ?r�)zselect ?, ?, :cr�)zselect :a, :b, ?r�zBinding.*is a named parameter�r��params)r&r'r(rGr$rr*r+)rr.r-r�r�r.s      r�%test_execute_named_param_and_sequence�1CursorTests.test_execute_named_param_and_sequence|s��
��.��$�M�E����E��9��*�*�+=�s�C�r��G�G�O�O�E�2�D�� � ����x�8�:�9�%�C�C��:�9�s"�B�B�(B�
B�
B�
B#	c��SH�upnURXS9 [R"5 [R"S[5 UR
R
X5nUR5unURXS5 SSS5 SSS5 M� g!,(df   N=f!,(df   M�=f)N))z
select ?1, ?2�rr�r�)z
select ?2, ?1r�)r�rr��error)	r&�warnings�catch_warnings�simplefilterr(rGr$rsr)rr�r��expectedrG�actuals      r�$test_execute_indexed_nameless_params�0CursorTests.test_execute_indexed_nameless_params�s���(
�#�E�8����E��9��,�,�.��)�)�'�3E�F�������7�B� �k�k�m�G�F��$�$�V�6�	/�:�9�	(
�
/�.��:�9�s#�B.�AB�B.�
B+�'B.�.
B=	c�j�[RnSn[URUSS9 URRSS5 UR
[RU5 URRSS5 SSS5 SSS5 g!,(df   N=f!,(df   g=f)Nztoo many SQL variablesr)r��limitzselect * from test where id=?r�z(select * from test where id!=? and id!=?r�)rr�rr/rGr$rrT)rr�r-s   r�test_execute_too_many_params�(CursorTests.test_execute_too_many_params�s���6�6��&��
�d�g�g���
:��G�G�O�O�;�T�B��'�'��(?�(?��E������ J� &�(�F�;�
:�E�E��;�
:�s#�=B$�%B�B$�
B!	�B$�$
B2c���URRS5 URRSSS05 URR5nURUSS5 g)Nr��&select name from test where name=:name�namerCrr�r�s  r�test_execute_dict_mapping�%CursorTests.test_execute_dict_mapping�sP�������?�@������@�6�5�/�R��g�g��� ������Q���'r!c��"SS[5nURRS5 URRSU"55 URR5nUR	USS5 g)Nc��\rSrSrSrSrg)�8CursorTests.test_execute_dict_mapping_mapping.<locals>.Di�c��g�NrCr7)r�keys  r�__missing__�DCursorTests.test_execute_dict_mapping_mapping.<locals>.D.__missing__�s��r!r7N)r8r9r:r;r�r<r7r!r�Dr��s��
r!r�r�r�rrC)�dictrGr$r�r)rr�r�s   r�!test_execute_dict_mapping_mapping�-CursorTests.test_execute_dict_mapping_mapping�s\��	��	�	
�����?�@������@�!�#�F��g�g��� ������Q���'r!c���URRS5 UR[R5 URRSSS05 SSS5 g!,(df   g=f)Nr�z1select name from test where name=:name and id=:idr�rC�rGr$rerrars r�)test_execute_dict_mapping_too_little_args�5CursorTests.test_execute_dict_mapping_too_little_args�sM�������?�@�
�
�
�v�6�6�
7��G�G�O�O�O�RX�Z_�Q`�a�8�
7�
7���A#�#
A1c���URRS5 UR[R5 URRS5 SSS5 g!,(df   g=f)Nr�r�r�rs r�!test_execute_dict_mapping_no_args�-CursorTests.test_execute_dict_mapping_no_args�sD�������?�@�
�
�
�v�6�6�
7��G�G�O�O�D�E�8�
7�
7���A � 
A.c���URRS5 UR[R5 URRSSS05 SSS5 g!,(df   g=f)Nr�r�r�rCr�rs r�!test_execute_dict_mapping_unnamed�-CursorTests.test_execute_dict_mapping_unnamed�sJ�������?�@�
�
�
�v�6�6�
7��G�G�O�O�@�6�5�/�R�8�
7�
7�rc�8�URR5 grK)rGrErs rrj�CursorTests.test_close�rOr!c�(�URRS5 URRS5 URRS5 URRS5 URURRS5 g)Nr}r�zupdate test set name='bar'r��rGr$r�rowcountrs r�test_rowcount_execute�!CursorTests.test_rowcount_execute�s`�������*�+������?�@������?�@������4�5�������)�)�1�-r!c��URRS5 URURRS5 g)z�
pysqlite does not know the rowcount of SELECT statements, because we
don't fetch all rows after executing the select statement. The rowcount
has thus to be -1.
zselect 5 union select 6r�Nrrs r�test_rowcount_select� CursorTests.test_rowcount_select�s/��	
�����1�2�������)�)�2�.r!c���URRS5 URRS/SQ5 URURRS5 g)Nr}rA�r�)r��r2r2)rGr$rtrrrs r�test_rowcount_executemany�%CursorTests.test_rowcount_executemany�sC�������*�+������?�AS�T�������)�)�1�-r!)r2�#rzRequires SQLite 3.35.0 or newerc���URRS5 URURR5SS5 URURRS5 g)Nz7update test set name='bar' where name='foo' returning 1rr)rGr$rr�rrs r�test_rowcount_update_returning�*CursorTests.test_rowcount_update_returning�sQ��	
�����Q�R�������)�)�+�A�.��2�������)�)�1�-r!c��URRS5 URURRS5 URRS5 URURRS5 URRS5 URURRS5 g)NzW
            -- foo
            insert into test(name) values ('foo'), ('foo')
        r�z�
            /* -- messy *r /* /* ** *- *--
            */
            /* one more */ insert into test(name) values ('messy')
        rz5/* bar */ update test set name='bar' where name='foo'r2rrs r�#test_rowcount_prefixed_with_comment�/CursorTests.test_rowcount_prefixed_with_comment�s���������	
�	
������)�)�1�-�������	
�
	
������)�)�1�-������O�P�������)�)�1�-r!c�B�SnURRSU5 URURRS5 URR5 URR
S5 URURRS5 g)Nrz"insert into test(income) values(?)r2�vacuumr�)rGrtrrr/rRr$)rr&s  r�test_rowcount_vaccuum�!CursorTests.test_rowcount_vaccuum�sn��!�������@�$�G�������)�)�1�-�������������!�������)�)�2�.r!c��URRS5 URRS5 URSURRSS9 g)Nr�r�z"total changes reported wrong value)r-)rGr$�
assertLessr/rrs r�test_total_changes�CursorTests.test_total_changes�sA�������?�@������?�@�����4�7�7�0�0�6Z��[r!c�|�URRS[SS5Vs/sHo4PM sn5 gs snf)Nr��d�n)rGrtr�r�s  r�test_execute_many_sequence�&CursorTests.test_execute_many_sequences5�������A�RW�X[�]`�Ra�Cb�Ra�Q�D�Ra�Cb�c��Cbs�9
c�Z�"SS5nURRSU"55 g)Nc�&�\rSrSrSrSrSrSrg)�6CursorTests.test_execute_many_iterator.<locals>.MyIteric��SUlg�N���valuers rr��?CursorTests.test_execute_many_iterator.<locals>.MyIter.__init__s	����
r!c��U$rKr7rs r�__iter__�?CursorTests.test_execute_many_iterator.<locals>.MyIter.__iter__	s���r!c�r�URS:Xa[eU=RS-
slUR4$)Nr�r)r2�
StopIterationrs r�__next__�?CursorTests.test_execute_many_iterator.<locals>.MyIter.__next__s-���:�:��#�'�'��J�J�!�O�J� �J�J�=�(r!r1N)r8r9r:r;r�r5r9r<r7r!r�MyIterr-s��
�
�
)r!r;r��rGrt)rr;s  r�test_execute_many_iterator�&CursorTests.test_execute_many_iterators%��	)�	)�	
�����A�6�8�Lr!c�L�SnURRSU"55 g)Nc3�:# �[S5HnU4v� M
 g7fr/)r�)�is r�mygen�6CursorTests.test_execute_many_generator.<locals>.mygens����1�X���d�
��r�r�r<)rrBs  r�test_execute_many_generator�'CursorTests.test_execute_many_generators ��	�	
�����A�5�7�Kr!c��UR[5 URRSS/5 SSS5 g!,(df   g=f)Nr�r�rer-rGrtrs r�test_execute_many_wrong_sql_arg�+CursorTests.test_execute_many_wrong_sql_args2��
�
�
�y�
)��G�G����T�F�+�*�
)�
)�s	�=�
Ac��UR[R5 URR	SS/5 SSS5 g!,(df   g=f)Nzselect ?r)rerrarGrtrs r�test_execute_many_select�$CursorTests.test_execute_many_select s8��
�
�
�v�6�6�
7��G�G���
�T�F�3�8�
7�
7�s�A�
Ac��UR[5 URRSS5 SSS5 g!,(df   g=f)Nr�r�rGrs r�test_execute_many_not_iterable�*CursorTests.test_execute_many_not_iterable$s1��
�
�
�y�
)��G�G��� E�r�J�*�
)�
)�s	�<�
A
c��URRS5 URRSS5 URRSS5 URRS5 /nURHnURUS5 M URUSS5 URUSS	5 g)
Nr}r�)r0)�zselect id from test order by idrr0rrQ)rGr$r
r)r�lstr�s   r�test_fetch_iter�CursorTests.test_fetch_iter(s��������*�+������9�4�@������9�4�@������9�:����7�7�C��J�J�s�1�v�������Q���#�����Q���#r!c���URRS5 URR5nURUSS5 URR5nURUS5 g)N�select name from testrrCr�r�s  r�
test_fetchone�CursorTests.test_fetchone4s[�������/�0��g�g��� ������Q���'��g�g��� ������d�#r!c�|�URR5nUR5nURUS5 grK)r/rDr�r)r�curr�s   r�test_fetchone_no_statement�&CursorTests.test_fetchone_no_statement;s-���g�g�n�n����l�l�n������d�#r!c���URURRS5 SURlURRS5 URRS5 URRS5 URRS5 URRS5 URR	5nUR[U5S5 g)Nrr�r}z#insert into test(name) values ('A')z#insert into test(name) values ('B')z#insert into test(name) values ('C')rV)rrG�	arraysizer$r��len�rrxs  r�test_array_size�CursorTests.test_array_size@s���������*�*�A�.������	
�����*�+������=�>������=�>������=�>������/�0��g�g���!������S��1�%r!c���Sn[R"[URS5nUR	[
US5 UR	[US5 UR	[X!S-5 g)N���r^r����r)�	functools�partial�setattrrGrer-r��
OverflowError)r�
UINT32_MAX�setters   r�test_invalid_array_size�#CursorTests.test_invalid_array_sizeQsW��"�
��"�"�7�D�G�G�[�A�����)�V�S�1����*�f�b�1����-��a��@r!c��URR5nURU/5 URRS5nURU/5 URRS5 URR5nUR[	U5S5 URRS5 URRS5nUR[	U5S5 URRS5nURU/5 URRS5 URRS5nURU/5 URRS5nUR[	U5S5 URRS5nURU/5 g)N��rVrr'r)rGr�rr$r_r`s  r�test_fetchmany�CursorTests.test_fetchmanyYsc���g�g���!������b�!��g�g����%������b�!�	
�����/�0��g�g���!������S��1�%�	
�����/�0��g�g����$������S��1�%��g�g����$������b�!�	
�����/�0��g�g����"������b�!��g�g����$������S��1�%��g�g����$������b�!r!c���SnURRnUR[US5 UR[US5 UR[
X!S-5 g)Nrdr�rer)rGr�rer-r�ri)rrjr�s   r�test_invalid_fetchmany�"CursorTests.test_invalid_fetchmanyusN��"�
��G�G�%�%�	����)�Y��4����*�i��4����-���N�Cr!c��URRS5 URRSS9nUR[	U5S5 g)z0Checks if fetchmany works with keyword argumentsrVr')�sizerN)rGr$r�rr_r`s  r�test_fetchmany_kw_arg�!CursorTests.test_fetchmany_kw_arg}s>�������/�0��g�g���S��)������S��1�%r!c��URRS5 URR5nUR[	U5S5 URR5nURU/5 g)NrVr)rGr$rsrr_r`s  r�
test_fetchall�CursorTests.test_fetchall�s[�������/�0��g�g��� ������S��1�%��g�g��� ������b�!r!c�>�URR/SQ5 g)N)r2r�r0)rG�
setinputsizesrs r�test_setinputsizes�CursorTests.test_setinputsizes�s�������i�(r!c�<�URRSS5 g)Nr0r�rG�
setoutputsizers r�test_setoutputsize�CursorTests.test_setoutputsize�s�������a��#r!c�:�URRS5 gr�r�rs r�test_setoutputsize_no_column�(CursorTests.test_setoutputsize_no_column�s�������b�!r!c�d�URURRUR5 grK)rrG�
connectionr/rs r�test_cursor_connection�"CursorTests.test_cursor_connection�s ��������+�+�T�W�W�5r!c��UR[5 SnURRU5nSSS5 g!,(df   g=f)Nc��grKr7r7r!r�f�1CursorTests.test_wrong_cursor_callable.<locals>.f�s��Tr!)rer-r/rD)rr�rZs   r�test_wrong_cursor_callable�&CursorTests.test_wrong_cursor_callable�s1��
�
�
�y�
)���'�'�.�.��#�C�*�
)�
)�s	�>�
Ac��"SS5nU"5nUR[5 [R"U5nSSS5 g!,(df   g=f)Nc��\rSrSrSrg)�0CursorTests.test_cursor_wrong_class.<locals>.Fooi�r7N�r8r9r:r;r<r7r!r�Foor��s��4r!r�)rer-r�Cursor)rr�rCrZs    r�test_cursor_wrong_class�#CursorTests.test_cursor_wrong_class�s6�����e��
�
�
�y�
)��-�-��$�C�*�
)�
)�s�A�
Ac��SnSHlnURUS9 URRURU5S5 UR	URR
S5 SSS5 Mn g!,(df   M�=f)zF
INSERT OR REPLACE and REPLACE INTO should produce the same behavior.
z+{} INTO test(id, unique_test) VALUES (?, ?))zINSERT OR REPLACE�REPLACE��	statement)rrCrN)r&rGr$�formatrr�)rrwr�s   r�test_last_row_id_on_replace�'CursorTests.test_last_row_id_on_replace�se��<��9�I����	��2�������
�
�9� 5�z�B�� � ����!2�!2�A�6�3�2�:�2�2�s�AA6�6
B	c��URRSS5 URURRS5 URRSS5 URURRS5 g)Nz2insert or ignore into test(unique_test) values (?))�testr�)rGr$rr�rs r�test_last_row_id_on_ignore�&CursorTests.test_last_row_id_on_ignore�sf�������@��	�	
������*�*�A�.������@��	�	
������*�*�A�.r!c�v�/nSH�nSnURSRU5S9 URRURU5U45 UR	X RR
45 UR
[R5 URRURU5U45 SSS5 UR	X RR
45 SSS5 M� /SQnURX5 g!,(df   NV=f!,(df   GM3=f)N)�FAIL�ABORT�ROLLBACKz.INSERT OR {} INTO test(unique_test) VALUES (?)zINSERT OR {}r�)�r�r�r��r�r2r��r�r�r�)
r&r�rGr$r
r�rerrYr)r�resultsr�rwr�s     r�test_last_row_id_insert_o_r�'CursorTests.test_last_row_id_insert_o_r�s�����6�I�B�C�����(=�(=�i�(H��I�������
�
�9� 5�	�|�D����	�7�7�+<�+<�=�>��&�&�v�'<�'<�=��G�G�O�O�C�J�J�y�$9�I�<�H�>����	�7�7�+<�+<�=�>�J�I�7�
��
	
����+�>�=��J�I�s$�A2D(�-D�.D(�
D%�!D(�(
D8	c�&�SnURRU5n[UR5nURRS5 URRU5n[UR5nUR	XC-
S5 g)Nzselect * from testzalter table test add newcolr)rGr$r_�descriptionr)r�selectrx�	old_count�	new_counts     r�test_column_count�CursorTests.test_column_count�sk��%���g�g�o�o�f�%������(�	������5�6��g�g�o�o�f�%������(�	�����.��2r!c���[S5Vs/sHoRRS5PM nnUH$nURUR	5S/5 M& gs snf)Nr2r+r�)r�r/r$rrs)r�_�cursorsrGs    r�#test_same_query_in_multiple_cursors�/CursorTests.test_same_query_in_multiple_cursors�sM��8=�a��A��1�7�7�?�?�:�.���A��B����R�[�[�]�T�F�3���Bs�$A�rGr/N)Er8r9r:r;rHrMrr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrjr
rrrqrrrrrrr r$r)r=rDrHrKrNrSrWr[rarlrprsrwrzr~r�r�r�r�r�r�r�r�r�r�r<r7r!rrtrt�sg��G��,�+�+�,'�" �B�K�H�-�R�
M�
?�
?�
(�(�
G�
9�7�(�(�(�b�
F�
S�
�.�/�.�
�_�_�V�/�/�*�<�6�8�.�8�.�.� /�\�d�M�"L�,�4�K�
$�$�$�
&�"A�"�8D�&�"�)�$�"�6�$�
%�7�/�,�"	3�4r!rtc��\rSrSrSrSrSrSrSrSr	Sr
S	rS
rSr
SrS
rSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSr Sr!S r"S!r#S"r$S#r%S$r&S%r'S&r(S'r)S(r*S)r+S*r,S+r-S,r.S-r/g.)/�	BlobTestsi�c��[R"S5UlURRS5 SUlURRSUR45 URRSSS5Ulg)Nr@�create table test(b blob)s2this blob data string is exactly fifty bytes long!�insert into test(b) values (?)r�r�r)rrr/r$r&�blobopen�blobrs rrH�BlobTests.setUp�s]���.�.��,��������3�4�I��	������8�4�9�9�,�G��G�G�$�$�V�S�!�4��	r!c�l�URR5 URR5 grK)r�rEr/rs rrM�BlobTests.tearDown�s���	�	�������
�
�r!c�X�URUR[R5 grK)�assertIsInstancer�rr-rs r�test_blob_is_a_blob�BlobTests.test_blob_is_a_blob�s�����d�i�i����5r!c�J�URRS5 URURR5S5 URRS[5 URURR5S5 URRS[
5 URURR5S5 URRS[5 URURR5S5 g)Nr������()r��seekr�tellr	r
rrs r�test_blob_seek_and_tell�!BlobTests.test_blob_seek_and_tell�s����	�	���r����������)�2�.��	�	���r�8�$���������)�2�.��	�	���r�8�$���������)�2�.��	�	���s�H�%���������)�2�.r!c�^�SnSn[UU4Sj4[UU4Sj4[UU4Sj4[UU4Sj44nUH1upEnTRXEUS9 TRXEU5 SSS5 M3 g!,(df   ME=f)Nzoffset out of blob rangez;'origin' should be os.SEEK_SET, os.SEEK_CUR, or os.SEEK_ENDc�:>�TRRS5$)Nro�r�r�rs�rrq�0BlobTests.test_blob_seek_error.<locals>.<lambda>�s���$�)�)�.�.��*>r!c�:>�TRRS5$)Nr�r�rs�rrqr��s���$�)�)�.�.��*=r!c�<>�TRRSS5$)Nr�r�r�rs�rrqr��s���4�9�9�>�>�"�b�+Ar!c�<>�TRRSS5$)Nr�r2r�rs�rrqr��s���4�9�9�>�>�"�a�+@r!)r'r-�fn)r�r&r)r�msg_oor�msg_origr.r'r-r�s`      r�test_blob_seek_error�BlobTests.test_blob_seek_error�s����,��P����">�?�
��"=�>�
��#A�B�
��#@�A�	
��$�L�C�b����#�2��6��&�&�s��4�7�6�$�6�6�s�A0�0
A?	c���Sn[R"S5nURRS[5 UR[U5 URRUR[5 SSS5 UR[U5 URRUR[5 SSS5 g!,(df   NX=f!,(df   g=f)Nzseek offset results in overflow�	_testcapir)
r�
import_moduler�r�r	rri�INT_MAXr
r)r�msg_ofr�s   r�test_blob_seek_overflow_error�'BlobTests.test_blob_seek_overflow_errors���2��!�/�/��<�	��	�	���q�(�#�
�
#�
#�M�6�
:��I�I�N�N�9�,�,�h�7�;�
�
#�
#�M�6�
:��I�I�N�N�9�,�,�h�7�;�
:�;�
:��
:�
:�s�+C�+C�
C�
C+c�n�URR5nURXR5 grK)r��readrr&�r�bufs  r�test_blob_read�BlobTests.test_blob_reads$���i�i�n�n�������i�i�(r!c��URR[UR5S-5nUR	XR5 g)Nr�)r�r�r_r&rr�s  r�test_blob_read_oversized�"BlobTests.test_blob_read_oversizeds3���i�i�n�n�S����^�a�/�0������i�i�(r!c���SnURRU5nURX RSU5 URURR	5U5 g)Nr�)r�r�rr&r�)rr�r�s   r�test_blob_read_advance_offset�'BlobTests.test_blob_read_advance_offsetsL�����i�i�n�n�Q�������i�i���m�,���������)�1�-r!c��URRS5 URURRS5URSS5 g)Nr�r�)r�r�rr�r&rs r�test_blob_read_at_offset�"BlobTests.test_blob_read_at_offsets:���	�	���r�����������+�T�Y�Y�r�"�-=�>r!c���URRS5 UR[R5 UR
R
5 SSS5 g!,(df   g=f)N�&update test set b='aaaa' where rowid=1)r/r$rerrTr�r�rs r� test_blob_read_error_row_changed�*BlobTests.test_blob_read_error_row_changedsA�������@�A�
�
�
�v�6�6�
7��I�I�N�N��8�
7�
7�s�A�
A-c���SRS5nURRU5 URR	S5R5nUR
USU5 g)Nsnew data�2�select b from testr)�ljustr��writer/r$r�r�r�new_datar�s   r�test_blob_write�BlobTests.test_blob_write#sR���$�$�R�(���	�	����!��g�g�o�o�2�3�<�<�>������Q���*r!c��SnURRS5 URRU5 URR	S5R5nUR
USURSSU-5 g)Nscccccccccccccccccccccccccr�r�r)r�r�r�r/r$r�rr&r�s   r�test_blob_write_at_offset�#BlobTests.test_blob_write_at_offset)sf�����	�	���r���	�	����!��g�g�o�o�2�3�<�<�>������Q�����3�B��(�!:�;r!c��URRS5 URURR5S5 g)Ns
ddddddddddr�)r�r�rr�rs r�test_blob_write_advance_offset�(BlobTests.test_blob_write_advance_offset0s-���	�	���� ���������)�2�.r!c��UR[S5 URRS5 SSS5 URR	S[
5 [
UR5nURRSUS-
-5 URRS5 UR[S5 URRS5 SSS5 g!,(df   N�=f!,(df   g=f)Nzdata longer than blob��aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaar�ar)rr�r�r�r�r	r_)rr�s  r�test_blob_write_error_length�&BlobTests.test_blob_write_error_length4s���
�
#�
#�J�0G�
H��I�I�O�O�K�(�I�	
�	�	���q�(�#���	�	�N���	�	�����!���%��	�	�����
�
#�
#�J�0G�
H��I�I�O�O�D�!�I�
H�I�
H��I�
H�s�C'�C8�'
C5�8
Dc���URRS5 UR[R5 UR
R
S5 SSS5 g!,(df   g=f)Nr��aaa)r/r$rerrTr�r�rs r�!test_blob_write_error_row_changed�+BlobTests.test_blob_write_error_row_changed?sC�������@�A�
�
�
�v�6�6�
7��I�I�O�O�F�#�8�
7�
7�rc���URRSSSSS9nUR[RS5 URS5 SSS5 UR
5 g!,(df   N=f)Nr�r�rT)�readonlyrr
)r/r�rrrTr�rE)r�ro_blobs  r�test_blob_write_error_readonly�(BlobTests.test_blob_write_error_readonlyDsZ���'�'�"�"�6�3��D�"�A��
�
#�
#�F�$;�$;�Z�
H��M�M�&�!�I��
�
��I�
H�s�A(�(
A6c�>�SSS04S04S04S044nSnUHbup4URX4S9 UR[RU5 URR
"U0UD6 SSS5 SSS5 Md g!,(df   N=f!,(df   M�=f)	N)r�r�rr��notexisting)rr�r)r�rr)r�r�r�zno such)rg�kwds)r&rrrTr/r�)rr.r�rgrs     r�test_blob_open_error�BlobTests.test_blob_open_errorJs���
��
�6�7�
$�b�)�
'��,�
�r�"�	
����!�J�D����4��3��+�+�F�,C�,C�U�K��G�G�$�$�d�3�d�3�L�4�3�"�K�K��4�3�s#�!B
�
A<�'B
�<
B
�B
�
B	c�N�UR[UR5S5 g)Nr�)rr_r�rs r�test_blob_length�BlobTests.test_blob_lengthWs������T�Y�Y���,r!c��URURS[S55 URURS[S55 URURS[S55 URURS[S55 URURS[S	55 g)
Nr0r�rQ�l��o�r��!)rr��ordrs r�test_blob_get_item�BlobTests.test_blob_get_itemZs���������1��s�3�x�0�������1��s�3�x�0�������1��s�3�x�0�������1��s�3�x�0�������2���C��1r!c���[S5URS'SURSS-nURR	S5R5SnUR
X!5 g)Nr�r�brr�)r#r�r&r/r$r�r�rr�r�s   r�test_blob_set_item�BlobTests.test_blob_set_itemasV���3�x��	�	�!���$�)�)�A�B�-�'�������!5�6�?�?�A�!�D������*r!c��URRS[5 URURR	5S5 [S5URS'[S5URS'URRS[5 SnURURR	5U5 g)Nrr!�T�.r�s2This blob data string is exactly fifty bytes long.)r�r�rrr�r#r	)rr�s  r�test_blob_set_item_with_offset�(BlobTests.test_blob_set_item_with_offsetgs����	�	���q�(�#���������)�3�/��3�x��	�	�!���C���	�	�"�
��	�	���q�(�#�H����������)�8�4r!c�Z�SSKJn [S5URSS&URURSSS5 [	S5URSS&URURSSS5 U"S/SQ5URSS&URURSSS5 g)	Nr)�array�12345r0s23456r�)rr�r2r�r0s)r1r,r�r�	bytearray)rr1s  r�!test_blob_set_slice_buffer_object�+BlobTests.test_blob_set_slice_buffer_objectps����#�H�-��	�	�!�A��������1�Q���2�"�8�,��	�	�!�A��������1�Q���2��s�O�4��	�	�!�A��������1�Q��)@�Ar!c�`�SURS'URURSS5 g)N�r�)r�rrs r�!test_blob_set_item_negative_index�+BlobTests.test_blob_set_item_negative_index{s'����	�	�"�
�������2���,r!c�B�URURSSS5 g)Nr0�s	blob data�rr�rs r�test_blob_get_slice�BlobTests.test_blob_get_slices��������1�R��,�7r!c�B�URURSSS5 g)Nr0r!r<rs r�test_blob_get_empty_slice�#BlobTests.test_blob_get_empty_slice�s��������1�Q���-r!c���URRSS5 URRSSS5nURUSSS5 SSS5 g!,(df   g=f)	Nr�)sabcr�r�r�r0���r!)r/r$r�r)rr�s  r�%test_blob_get_empty_slice_oob_indices�/BlobTests.test_blob_get_empty_slice_oob_indices�sO�������8�)�D�
�W�W�
�
�f�c�1�
-�����T�!�B�Z��-�.�
-�
-�s�A�
A'c�\�URURSSURSS5 g)Nr0rC)rr�r&rs r�"test_blob_get_slice_negative_index�,BlobTests.test_blob_get_slice_negative_index�s&��������1�R��$�)�)�A�b�/�:r!c�H�URURSSS2S5 g)Nrr�r�sti lbr<rs r�test_blob_get_slice_with_skip�'BlobTests.test_blob_get_slice_with_skip�s!��������1�R��6�*�H�5r!c��SURSS&SURSS-nURRS5R	5SnURX!5 g)Nr2rr0r�)r�r&r/r$r�rr(s   r�test_blob_set_slice�BlobTests.test_blob_set_slice�sT��!��	�	�!�A���d�i�i���m�+�������!5�6�?�?�A�!�D������*r!c�t�SURSS&URURSSUR5 g)Nr!r)r�rr&rs r�test_blob_set_empty_slice�#BlobTests.test_blob_set_empty_slice�s-����	�	�!�A��������1��t�y�y�1r!c���SURSSS2'URRS5R5SnSURSS-nURX5 g)Nr2rr�r�r�s
1h2s3b4o5 )r�r/r$r�r&r)rr�r�s   r�test_blob_set_slice_with_skip�'BlobTests.test_blob_set_slice_with_skip�sY��$��	�	�!�B�q�&�������!5�6�?�?�A�!�D�� �4�9�9�R�S�>�1������*r!c��SnUR[U5 URSS SSS5 UR[U5 URS SSS5 UR[U5 SURS'SSS5 g!,(df   Nk=f!,(df   NN=f!,(df   g=f)Nzindices must be integersr0g@g�?r'r��rr-r�)rr-s  r�$test_blob_mapping_invalid_index_type�.BlobTests.test_blob_mapping_invalid_index_type�s���(��
�
#�
#�I�s�
3��I�I�a���4�
�
#�
#�I�s�
3��I�I�c�N�4�
�
#�
#�I�s�
3�!�D�I�I�c�N�4�
3�	4�
3��
3�
3��
3�
3�s#�B�B�5B0�
B�
B-�0
B>c���[UR5SS/nUHInURUS9 UR[S5 URU SSS5 SSS5 MK UR
R
S5 UR[R5 URS SSS5 g!,(df   Nm=f!,(df   M�=f!,(df   g=f)N�ii����)�idxzindex out of ranger�r)
r_r�r&r�
IndexErrorr/r$rerrT)rr.r[s   r�test_blob_get_item_error�"BlobTests.test_blob_get_item_error�s����t�y�y�>�3��-���C����#��&��+�+�J�8L�M��I�I�c�N�N�'�&��	
�����@�A�
�
�
�v�6�6�
7��I�I�a�L�8�
7�N�M��'�&��8�
7�s/�C�B;�C�"C�;
C	�C�
C	�
C,c���[R"S5nUR[S5 URUR
 SSS5 g!,(df   g=f)Nr�zcannot fit 'int')rr�rr\r��
ULLONG_MAX)rr�s  r�test_blob_get_item_error_bigint�)BlobTests.test_blob_get_item_error_bigint�sB��!�/�/��<�	�
�
#�
#�J�0B�
C��I�I�i�*�*�+�D�
C�
C�s�A�
Ac��UR[S5 SURS'SSS5 UR[S5 SURS'SSS5 UR[S5 [S5URS'SSS5 UR[S5 URS	SSS5 UR[S5 SURS'SSS5 UR[
S5 S	URS'SSS5 UR[
S5 S
URS'SSS5 UR[
S5 SS-URS'SSS5 g!,(df   GN\=f!,(df   GN@=f!,(df   GN=f!,(df   GN=f!,(df   N�=f!,(df   N�=f!,(df   N�=f!,(df   g=f)
Nzcannot be interpretedsmultiplerr��doesn't support.*deletionzBlob index out of rangerozmust be in ranger��r��A)rr-r�r3r\r�rs r�test_blob_set_item_error�"BlobTests.test_blob_set_item_error�sk��
�
#�
#�I�/F�
G�&�D�I�I�a�L�H�
�
#�
#�I�/F�
G��D�I�I�a�L�H�
�
#�
#�I�/F�
G�$�T�?�D�I�I�a�L�H�
�
#�
#�I�/J�
K��	�	�!��L�
�
#�
#�J�0I�
J��D�I�I�d�O�K�
�
#�
#�J�0B�
C��D�I�I�a�L�D�
�
#�
#�J�0B�
C��D�I�I�a�L�D��
#�
#�J�0B�
C��b�5�D�I�I�a�L�D�
C�H�
G��
G�
G��
G�
G��
K�
K��
J�
J��
C�
C��
C�
C��D�
C�s_�E<�F�3F �*F2�G�G�2G&� G7�<
F�
F� 
F/�2
G�
G�
G#�&
G4�7
Hc��UR[S5 SURSS&SSS5 UR[S5 SURSS&SSS5 UR[S5 URSS2	SSS5 UR[S5 SURSSS	2'SSS5 UR[5 [S
5SSS2URSS&SSS5 g!,(df   N�=f!,(df   N�=f!,(df   N�=f!,(df   N~=f!,(df   g=f)Nz
wrong sizer	r0r�rrdzstep cannot be zeror2rsabcder�)rr\r�r-r�rer+r,rs r�test_blob_set_slice_error�#BlobTests.test_blob_set_slice_error�s���
�
#�
#�J��
=�"�D�I�I�a��O�>�
�
#�
#�J��
=�)�D�I�I�a��O�>�
�
#�
#�I�/J�
K��	�	�!�B�$��L�
�
#�
#�J�0E�
F� (�D�I�I�a��1�f��G�
�
�
�{�
+�(��2�3�Q�3�7�D�I�I�a��O�,�
+�>�
=��
=�
=��
K�
K��
F�
F��
+�
+�s;�C9�D
�3D�!D,�D=�9
D�

D�
D)�,
D:�=
Ec��UR[S5 URUR- SSS5 UR[S5 URS- SSS5 UR[S5 SUR; SSS5 g!,(df   Nk=f!,(df   NN=f!,(df   g=f)Nzunsupported operandr0zis not iterabler	rVrs r� test_blob_sequence_not_supported�*BlobTests.test_blob_sequence_not_supported�s���
�
#�
#�I�/D�
E��I�I��	�	�!�F�
�
#�
#�I�/D�
E��I�I��M�F�
�
#�
#�I�/@�
A��D�I�I��B�
A�	F�
E��
E�
E��
A�
A�s#�B�B'�=B8�
B$�'
B5�8
Cc��SnURRSSS5nURU5 SSS5 URRS5R	5SnURX15 UR
[RS5 WR5 SSS5 g!,(df   N�=f!,(df   g=f)Ns2aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaar�r�rr�rzclosed blob)
r/r�r�r$r�rrrrar�)rr&r�r�s    r�test_blob_context_manager�#BlobTests.test_blob_context_manager�s�����
�W�W�
�
�f�c�1�
-���J�J�t��.������!5�6�?�?�A�!�D������&��
#�
#�F�$;�$;�]�
K��I�I�K�L�
K�
.�
-��L�
K�s�B1�C�1
B?�
Cc���"SS[5nURUS5 URRSSS5nU"S5e!,(df   O=fSSS5 g!,(df   g=f)Nc��\rSrSrSrg)�NBlobTests.test_blob_context_manager_reraise_exceptions.<locals>.DummyExceptioni�r7Nr�r7r!r�DummyExceptionrt�s��r!ru�reraisedr�r�r)r@rr/r�)rrur�s   r�,test_blob_context_manager_reraise_exceptions�6BlobTests.test_blob_context_manager_reraise_exceptions�sZ��	�Y�	�
�
#�
#�N�J�
?����!�!�&�#�q�1�T�$�Z�0�0�2�1��1�@�
?�
?�s�A$�	A	�	
A	�A$�$
A2c�n�[5nURS5 URS5 URSSS5nUR5 SnUR	[
RU5 UR5 SSS5 UR	[
RU5 URS5 SSS5 UR	[
RU5 URS5 SSS5 UR	[
RU5 UR5 SSS5 UR	[
RU5 UR5 SSS5 UR	[
RU5 URSSS5 SSS5 UR	[
RU5 [U5 SSS5 UR	[
RU5 US SSS5 UR	[
RU5 USS SSS5 UR	[
RU5 SUS'SSS5 SSS5 g!,(df   GN�=f!,(df   GN�=f!,(df   GN�=f!,(df   GN�=f!,(df   GNZ=f!,(df   GN0=f!,(df   GN=f!,(df   N�=f!,(df   N�=f!,(df   N�=f!,(df   g=f)	Nr�z'insert into test values (zeroblob(100))r�r�rzCannot operate on a closed blobr!r)rr$r�rErrrar�r�r�r��	__enter__�__exit__r_)rr/r�r-s    r�test_blob_closed�BlobTests.test_blob_closed�s��
�
�"��J�J�2�3��J�J�@�A��;�;�v�s�A�.�D��J�J�L�3�C��'�'��(?�(?��E��	�	��F��'�'��(?�(?��E��
�
�3��F��'�'��(?�(?��E��	�	�!��F��'�'��(?�(?��E��	�	��F��'�'��(?�(?��E���� �F��'�'��(?�(?��E��
�
�d�D�$�/�F��'�'��(?�(?��E��D�	�F��'�'��(?�(?��E��Q��F��'�'��(?�(?��E��Q�q�	�F��'�'��(?�(?��E���Q��F�3�
�F�E��E�E��E�E��E�E��E�E��E�E��E�E��E�E��E�E��E�E��3�
�s��A(L&�3I5�(L&�,J�>(L&�&J�8(L&� J+�1(L&�J=�*(L&�K�&(L&�K!�(L&�K3�(L&�0L�6(L&�L�$L&�5
J	�?L&�
J	�L&�
J(	�#L&�+
J:	�5L&�=
K	�L&�
K	�L&�!
K0	�+L&�3
L	�=L&�
L	�L&�
L#	�L&�&
L4c�,�[5nURS5 URS5 URSSS5nUR5 UR	[
RSUR5 SSS5 g!,(df   g=f)Nr�z*insert into test(b) values (zeroblob(100))r�r�rz#Cannot operate on a closed database)rr$r�rErrrar�)rr/r�s   r�test_blob_closed_db_read�"BlobTests.test_blob_closed_db_readsk��
�
�"��J�J�2�3��J�J�C�D��;�;�v�s�A�.�D��H�H�J��"�"�6�#:�#:�#H�#'�9�9�
.��
�
�s�A1B�
Bc��[5nSnURS5 URSU45 URSSU5 SSS5 g!,(df   g=f)Nlzcreate table t(t blob)z/insert into t(rowid, t) values (?, zeroblob(1))rm)rr$r�)rr/�rowids   r�test_blob_32bit_rowid�BlobTests.test_blob_32bit_rowidsI��
�
�"��E��J�J�/�0��J�J�H�5�(�S��K�K��S�%�(�	�
�
�s�:A�
A)r�r/r&N)0r8r9r:r;rHrMr�r�r�r�r�r�r�r�r�r�rrr
rrrrr$r)r.r4r8r=r@rDrGrJrMrPrSrWr]rargrjrmrprwr|rr�r<r7r!rr�r��s���5��6�/�5�8�)�)�.�?��
+�<�/�	"�$�
�4�-�2�+�5�	B�-�8�.�.�
;�6�+�2�+�"�
�,�
!�&
8��	�1��:.�)r!r�c�t�\rSrSrSrSr\RS5rSr	Sr
\RS5rSrg	)
�ThreadTestsi$c���[R"S5UlURR5UlURRS5 URRS5 g)Nr@z$create table test(name text, b blob)z,insert into test values('blob', zeroblob(1)))rrr%rDrZr$rs rrH�ThreadTests.setUp&sJ���>�>�*�-����8�8�?�?�$��������?�@������G�Hr!c�l�URR5 URR5 grK�rZrEr%rs rrM�ThreadTests.tearDown,��������������r!c��^^^�UUU4Sjn/n[R"USU0S9nUR5 UR5 U(a!UR	SRU55 gg)Nc�>�T"T0TD6 URS5 g![Ra g URS5 g=f)Nzdid not raise ProgrammingErrorzraised wrong exception)r
rra)�errrgr�rs ���r�run�"ThreadTests._run_test.<locals>.run2sG���
5��D�!�D�!��
�
�;�<���*�*�
��
5��
�
�3�4�s��A�Ar���targetrh�
)�	threading�Thread�start�join�fail)rr�rgrr�r�rms ```   r�	_run_test�ThreadTests._run_test0sS���	5������C����=��	���	�	������I�I�d�i�i��n�%�r!c��^�U4SjU4SjU4SjU4SjU4SjU4SjU4SjU4SjU4S	jU4S
j/
n[[RS5(a*URU4Sj5 URU4S
j5 [RS:�aURU4Sj5 UH,nTRUS9 TR
U5 SSS5 M. g!,(df   M@=f)Nc�8>�TRR5$rK)r%rDrs�rrq�:ThreadTests.test_check_connection_thread.<locals>.<lambda>D����D�H�H�O�O�%r!c�8>�TRR5$rK)r%rRrs�rrqr�Er�r!c�8>�TRR5$rK)r%rZrs�rrqr�F����D�H�H�%�%�'r!c�8>�TRR5$rK)r%rErs�rrqr�G����D�H�H�N�N�$r!c�:>�TRRS5$rK)r%�set_trace_callbackrs�rrqr�Hs���D�H�H�/�/��5r!c�:>�TRRS5$rK)r%�set_authorizerrs�rrqr�Is���D�H�H�+�+�D�1r!c�<>�TRRSS5$r�)r%�create_collationrs�rrqr�Js���D�H�H�-�-�e�T�:r!c�X>�TRR[RS5$)Nr�)r%r�rr�rs�rrqr�Ks���D�H�H�%�%�f�&@�&@�"�Er!c�V>�TRR[R5$rK)r%r�rr�rs�rrqr�Ls���D�H�H�%�%�f�&@�&@�Ar!c�>>�TRRSSS5$)Nr�r�r)r%r�rs�rrqr�Ms���D�H�H�%�%�f�c�1�5r!r!c�8>�TRR5$rK)r%r!rs�rrqr�Ps���t�x�x�1�1�3r!c�:>�TRRS5$)Nr!)r%r%rs�rrqr�Qs���t�x�x�3�3�C�8r!r�c�>>�TRRSSS5$)NrCr)r%�create_window_functionrs�rrqr�Ss���t�x�x�>�>�u�a��Nr!�r�)rrrr
rr&r��r�fnsr�s`  r�test_check_connection_thread�(ThreadTests.test_check_connection_threadBs����%�%�'�$�5�1�:�E�A�5�
���6�$�$�k�2�2��J�J�3�4��J�J�8�9��%�%��3��J�J�N�O��B������$����r�"�%�$��$�$�s�<C�
C*	c�^�U4SjU4SjU4SjU4Sj/nUH,nTRUS9 TRU5 SSS5 M. g!,(df   M@=f)Nc�:>�TRRS5$)Nz"insert into test(name) values('a')�rZr$rs�rrq�6ThreadTests.test_check_cursor_thread.<locals>.<lambda>[s���D�H�H�$�$�%I�Jr!c�8>�TRR5$rK)rZrErs�rrqr�\r�r!c�:>�TRRS5$)NrVr�rs�rrqr�]s���D�H�H�$�$�%<�=r!c�8>�TRR5$rK)rZr�rs�rrqr�^r�r!r�)r&r�r�s`  r�test_check_cursor_thread�$ThreadTests.test_check_cursor_threadYsK���J�$�=�'�	
���B������$����r�"�%�$��$�$�s�A�
A	c��Sn[SS9n/n[R"XUS.S9nUR5 UR	5 UR[
U5SSR	U55 SSS5 g!,(df   g=f)Nc�~�URS5 g![Ra URS5 gf=f)Nr+zmulti-threading not allowed)r$rrDr
�r%r�s  rr��4ThreadTests.test_dont_check_same_thread.<locals>.rungs3��
:����J�'���<�<�
:��
�
�8�9�
:�s��%<�<F)�check_same_threadr�r�rr�)rr�r�r�r�rr_)rr�r%r�rms     r�test_dont_check_same_thread�'ThreadTests.test_dont_check_same_threadesi��	:��u�
5���C�� � ���4L�M�A�
�G�G�I�
�F�F�H����S��X�q�$�)�)�C�.�9�6�
5�
5�s�A%A;�;
B	�r%rZN)
r8r9r:r;rHrMr�reap_threadsr�r�r�r�r<r7r!rr�r�$sK��I���"�"�&�#�&�"#�.	#��"�"�:�#�:r!r�c�>�\rSrSrSrSrSrSrSrSr	Sr
S	rg
)�ConstructorTestsiuc�4�[R"SSS5ng)N��r��)r�Date�rr�s  r�	test_date�ConstructorTests.test_datevs���K�K��b�"�%�r!c�4�[R"SSS5ng)N��'r)r�Time�rrms  r�	test_time�ConstructorTests.test_timeys���K�K��B��#�r!c�:�[R"SSSSSS5ng)Nr�r�r�r�r�r)r�	Timestamp�r�tss  r�test_timestamp�ConstructorTests.test_timestamp|s��
�
�
�d�B��B��B�
7�r!c�0�[R"S5ngr�)r�
DateFromTicksr�s  r�test_date_from_ticks�%ConstructorTests.test_date_from_ticks���� � ��$�r!c�0�[R"S5ngr�)r�
TimeFromTicksr�s  r�test_time_from_ticks�%ConstructorTests.test_time_from_ticks�r�r!c�0�[R"S5ngr�)r�TimestampFromTicksr�s  r�test_timestamp_from_ticks�*ConstructorTests.test_timestamp_from_ticks�s��
�
&�
&�r�
*�r!c�0�[R"S5ng)Ns')r�Binary)rr�s  r�test_binary�ConstructorTests.test_binary�s���M�M�&�!�r!r7N)r8r9r:r;r�r�r�r�r�r�r�r<r7r!rr�r�us%��&�$�8�%�%�+�"r!r�c�b�\rSrSrSrSrSrSrSrSr	Sr
S	rS
rSr
SrS
rSrSrg)�ExtensionTestsi�c�x�[R"S5UlURR5Ulgr)rrr%rDrZrs rrH�ExtensionTests.setUp�s$���>�>�*�-����8�8�?�?�$��r!c�l�URR5 URR5 grKr�rs rrM�ExtensionTests.tearDown�r�r!c��URnURS5 URS5 UR5SnUR	US5 g)Nz�
            -- bla bla
            /* a stupid comment */
            create table a(i);
            insert into a(i) values (5);
            zselect i from arr0)rZrur$r�r)rrZrxs   r�test_script_string_sql�%ExtensionTests.test_script_string_sql�sM���h�h������	�	���%�&��l�l�n�Q�������a� r!c��UR[R5 URR	S5 SSS5 g!,(df   g=f)Nzo
                CREATE TABLE test(x);
                asdf;
                CREATE TABLE test2(x)
            �rerrTrZrurs r�test_script_syntax_error�'ExtensionTests.test_script_syntax_error�s9��
�
�
�v�6�6�
7��H�H�"�"�$�
�8�
7�
7�r�c��UR[R5 URR	S5 SSS5 g!,(df   g=f)Nzc
                CREATE TABLE test(sadfsadfdsa);
                SELECT foo FROM hurz;
            r�rs r�test_script_error_normal�'ExtensionTests.test_script_error_normal�s9��
�
�
�v�6�6�
7��H�H�"�"�$�
�8�
7�
7�r�c��UR[5 URRS5 SSS5 g!,(df   g=f)Nsg
                CREATE TABLE test(foo);
                INSERT INTO test(foo) VALUES (5);
            )rer-rZrurs r�"test_cursor_executescript_as_bytes�1ExtensionTests.test_cursor_executescript_as_bytes�s3��
�
�
�y�
)��H�H�"�"�$�
�*�
)�
)�r�c��UR[5 URRS5 SSS5 g!,(df   g=f)Nz^
                CREATE TABLE a(i);
                INSERT INTO a(i) VALUES (5);
            )rer�rZrurs r�.test_cursor_executescript_with_null_characters�=ExtensionTests.test_cursor_executescript_with_null_characters�s3��
�
�
�z�
*��H�H�"�"�$�
�+�
*�
*�r�c��UR[5 URRS5 SSS5 g!,(df   g=f)Nua
                CREATE TABLE a(s);
                INSERT INTO a(s) VALUES ('�');
            )re�UnicodeEncodeErrorrZrurs r�)test_cursor_executescript_with_surrogates�8ExtensionTests.test_cursor_executescript_with_surrogates�s4��
�
�
�1�
2��H�H�"�"�$�
�3�
2�
2�r�c	��Sn[5n[U5nURSRU55 UR	[
RU5 URSRUS-55 SSS5 SSS5 SSS5 g!,(df   N=f!,(df   N(=f!,(df   g=f)Nr�zselect 'almost too large'zselect 'too large'r)rrrur�rrrP)rr-r/�lims    r�*test_cursor_executescript_too_large_script�9ExtensionTests.test_cursor_executescript_too_large_script�s���)��
�
�"�h�r�l�c����8�>�>�s�C�D��'�'��(8�(8�#�>�� � �!5�!;�!;�C��E�!B�C�?�'3�
�
�>�>��'3�l��
�
�s;�B9�AB(�$B�>B(�B9�
B%�!B(�(
B6	�2B9�9
Cc���URnURS5 URUR5 UR	S5 URUR5 g)N�beginr+)r%r$r=rrur3)rr%s  r�$test_cursor_executescript_tx_control�3ExtensionTests.test_cursor_executescript_tx_control�sK���h�h�����G������*�*�+����*�%�����+�+�,r!c��URRS5R5SnURUSS5 g)Nzselect 5rr0z Basic test of Connection.execute)r%r$r�r)r�results  r�test_connection_execute�&ExtensionTests.test_connection_execute�s7�����!�!�*�-�6�6�8��;�������$F�Gr!c��URnURS5 URSSS/5 URS5R5nUR	USSSS5 UR	US	SS
S5 g)Nzcreate table test(foo)z insert into test(foo) values (?)r�r�z!select foo from test order by foorr2z$Basic test of Connection.executemanyrr�)r%r$rtrsr�rr%rs   r�test_connection_executemany�*ExtensionTests.test_connection_executemany�sy���h�h�����,�-����:�T�4�L�I����@�A�J�J�L��������1��q�*P�Q�������1��q�*P�Qr!c��URnURS5 URS5R5SnUR	USS5 g)Nz[
            CREATE TABLE test(foo);
            INSERT INTO test(foo) VALUES (5);
        zselect foo from testrr0z&Basic test of Connection.executescript)r%rur$r�rrs   r�test_connection_executescript�,ExtensionTests.test_connection_executescript�sP���h�h������	
����3�4�=�=�?��B�������$L�Mr!r�N)r8r9r:r;rHrMr�r�r�rrrrrrrrr<r7r!rr�r��sG��%��
!������D�-�H�R�Nr!r�c�V�\rSrSrSrSrSrSrSrSr	Sr
S	rS
rSr
SrS
rg)�ClosedConTestsi�c��SnUR[RU5 U"U0UD6 SSS5 g!,(df   g=f)Nz$Cannot operate on a closed database.)rrra)rr�rgrr�s     r�check�ClosedConTests.check�s7��6��
�
#�
#�F�$;�$;�U�
C������D�
C�
C�s	�	5�
Ac��[R"S5UlURR5UlURR5 gr)rrr%rDrZrErs rrH�ClosedConTests.setUp�s2���>�>�*�-����8�8�?�?�$��������r!c�N�URURR5 grK)r!r%rDrs r�test_closed_con_cursor�%ClosedConTests.test_closed_con_cursor�����
�
�4�8�8�?�?�#r!c�N�URURR5 grK)r!r%rRrs r�test_closed_con_commit�%ClosedConTests.test_closed_con_commit�r(r!c�N�URURR5 grK)r!r%rZrs r�test_closed_con_rollback�'ClosedConTests.test_closed_con_rollback�s���
�
�4�8�8�$�$�%r!c�P�URURRS5 g)Nzselect 4)r!rZr$rs r�test_closed_cur_execute�&ClosedConTests.test_closed_cur_execute�s���
�
�4�8�8�#�#�Z�0r!c�Z�SnURURRSSU5 g)Nc��g�Nr�r7ros rr��5ClosedConTests.test_closed_create_function.<locals>.fs��r!rCr)r!r%rv)rr�s  r�test_closed_create_function�*ClosedConTests.test_closed_create_function�s#��	��
�
�4�8�8�+�+�U�A�q�9r!c�h�"SS5nURURRSSU5 g)Nc�&�\rSrSrSrSrSrSrg)�8ClosedConTests.test_closed_create_aggregate.<locals>.Aggic��grKr7rs rr��AClosedConTests.test_closed_create_aggregate.<locals>.Agg.__init__���r!c��grKr7r�s  r�step�=ClosedConTests.test_closed_create_aggregate.<locals>.Agg.stepr=r!c��gr4r7rs r�finalize�AClosedConTests.test_closed_create_aggregate.<locals>.Agg.finalize
s��r!r7N)r8r9r:r;r�r?rBr<r7r!r�Aggr:s��
�
�
r!rDrCr)r!r%�create_aggregate)rrDs  r�test_closed_create_aggregate�+ClosedConTests.test_closed_create_aggregates*��	�	�	
�
�
�4�8�8�,�,�e�Q��<r!c�V�SnURURRU5 g)Nc�"�[R$rK)r�DENY)rgs r�
authorizer�=ClosedConTests.test_closed_set_authorizer.<locals>.authorizers���;�;�r!)r!r%r�)rrKs  r�test_closed_set_authorizer�)ClosedConTests.test_closed_set_authorizers��	��
�
�4�8�8�*�*�J�7r!c�X�SnURURRUS5 g)Nc��grKr7r7r!r�progress�BClosedConTests.test_closed_set_progress_callback.<locals>.progresss��r!r')r!r%�set_progress_handler)rrQs  r�!test_closed_set_progress_callback�0ClosedConTests.test_closed_set_progress_callbacks!��	��
�
�4�8�8�0�0�(�C�@r!c�:�URUR5 grK)r!r%rs r�test_closed_call�ClosedConTests.test_closed_calls���
�
�4�8�8�r!r�N)r8r9r:r;r!rHr&r*r-r0r6rFrMrTrWr<r7r!rrr�s:���
�
$�$�&�1�:�
=�8�
A�
r!rc��\rSrSrSrSrg)�ClosedCurTestsic�.�URR5nUR5 SHSnUS;aSnOUS:XaSSS/4nO/nUR[R
5 [
X5nU"U6 SSS5 MU g!,(df   Mg=f)N)r$rtrursr�r�)r$ru)zselect 4 union select 5rtzinsert into foo(bar) values (?)rr)r/rDrErerrar))rrZ�method_namer��methods     r�test_closed�ClosedCurTests.test_closeds����g�g�n�n����	�	��k�K��:�:�5���
�-�;�d�D�\�J�����"�"�6�#:�#:�;� ��2�����<�;�l�<�;�s�'B�
B	r7N)r8r9r:r;r^r<r7r!rrZrZs�� r!rZc�N�\rSrSrSrSrSrSrSrSr	Sr
S	rS
rSr
Srg
)�SqliteOnConflictTestsi.zn
Tests for SQLite's "insert on conflict" feature.

See https://www.sqlite.org/lang_conflict.html for details.
c��[R"S5UlURR5UlURRS5 g)Nr@zz
          CREATE TABLE test(
            id INTEGER PRIMARY KEY, name TEXT, unique_name TEXT UNIQUE
          );
        rvrs rrH�SqliteOnConflictTests.setUp5s9���.�.��,����'�'�.�.�"���������	
r!c�l�URR5 URR5 grKryrs rrM�SqliteOnConflictTests.tearDown>r{r!c�l�SURlURR5UlURR	S5 URR	S5 URR	S5 UR[R5 URR	S5 SSS5 URR5 URR	S5 URURR5/5 g!,(df   Nn=f)N�BEGIN�,INSERT INTO test(name) VALUES ('abort_test')�8INSERT OR ROLLBACK INTO test(unique_name) VALUES ('foo')z"SELECT name, unique_name from test�r/r�rDrGr$rerrYrRrrsrs r�3test_on_conflict_rollback_with_explicit_transaction�ISqliteOnConflictTests.test_on_conflict_rollback_with_explicit_transactionBs���"&������'�'�.�.�"��������� ������F�G������R�S�
�
�
�v�4�4�
5��G�G�O�O�V�W�6�	
�����������<�=�������)�)�+�R�0�
6�
5�s�!D%�%
D3c�p�SURlURR5UlURR	S5 URR	S5 URR	S5 UR[R5 URR	S5 SSS5 URR5 URR	S5 URURR5SS/5 g!,(df   Np=f)Nrgrh�5INSERT OR ABORT INTO test(unique_name) VALUES ('foo')�"SELECT name, unique_name FROM test��
abort_testNr�rjrs r�8test_on_conflict_abort_raises_with_explicit_transactions�NSqliteOnConflictTests.test_on_conflict_abort_raises_with_explicit_transactionsQs���#'������'�'�.�.�"��������� ������F�G������O�P�
�
�
�v�4�4�
5��G�G�O�O�S�T�6������������<�=�������)�)�+�.B�N�-S�T�6�
5�s�!D'�'
D5c��URRS5 URRS5 UR[R5 URRS5 SSS5 URRS5 URURR
5/5 g!,(df   NT=f)Nrhriro�rGr$rerrYrrsrs r�-test_on_conflict_rollback_without_transaction�CSqliteOnConflictTests.test_on_conflict_rollback_without_transactionas��������F�G������R�S�
�
�
�v�4�4�
5��G�G�O�O�V�W�6������<�=�������)�)�+�R�0�	6�
5�s�C�
Cc��URRS5 URRS5 UR[R5 URRS5 SSS5 URRS5 URURR
5SS/5 g!,(df   NV=f)Nrhrnrorpr�rurs r�2test_on_conflict_abort_raises_without_transactions�HSqliteOnConflictTests.test_on_conflict_abort_raises_without_transactionsks���	
�����F�G������O�P�
�
�
�v�4�4�
5��G�G�O�O�S�T�6�	
�����<�=�������)�)�+�.B�N�-S�T�	6�
5�s�C�
Cc�6�URRS5 UR[R5 URRS5 SSS5 URURR
5/5 g!,(df   N9=f)Nz4INSERT OR FAIL INTO test(unique_name) VALUES ('foo')rurs r�test_on_conflict_fail�+SqliteOnConflictTests.test_on_conflict_failvsc�������N�O�
�
�
�v�4�4�
5��G�G�O�O�R�S�6�������)�)�+�R�0�6�
5�s�B
�

Bc��URRS5 URRS5 URRS5 URURR5S/5 g)Nz6INSERT OR IGNORE INTO test(unique_name) VALUES ('foo')zSELECT unique_name FROM testrB�rGr$rrsrs r�test_on_conflict_ignore�-SqliteOnConflictTests.test_on_conflict_ignore|sT�������P�Q������P�Q������6�7�������)�)�+�h�Z�8r!c��URRS5 URRS5 URRS5 URURR5S/5 g)NzFINSERT OR REPLACE INTO test(name, unique_name) VALUES ('Data!', 'foo')zUINSERT OR REPLACE INTO test(name, unique_name) VALUES ('Very different data!', 'foo')ro)zVery different data!rCrrs r�test_on_conflict_replace�.SqliteOnConflictTests.test_on_conflict_replace�sV�������`�a������o�p������<�=�������)�)�+�.M�-N�Or!r�N)r8r9r:r;�__doc__rHrMrkrrrvryr|r�r�r<r7r!rrara.s7���
��
1�U� 1�	U�1�9�Pr!rac�$�\rSrSrSrSrSrSrg)�MultiprocessTestsi�rc�"�[[5 grK)rrrs rrM�MultiprocessTests.tearDown�s	���v�r!c��S[SURS3n[R"[R
SU/SS[R[RS9nURUR5 URSURR5R55 [R"[URS	9nU URS
5 SSS5 UR R#S5 UR)5 UR+UR,5 URS[.S
9 URUR,S5 g!,(df   N�=f![R$a.nUR R#['U55 SnAN�SnAff=f!UR)5 f=f![R0a" UR35 UR5 ef=f)Nz�if 1:
            import sqlite3
            def wait():
                print("started")
                assert "database is locked" in input()

            cx = sqlite3.connect("z", timeout=a�)
            cx.create_function("wait", 0, wait)
            with cx:
                cx.execute("create table t(t)")
            try:
                # execute two transactions; both will try to lock the db
                cx.executescript('''
                    -- start a transaction and wait for parent
                    begin transaction;
                    select * from t;
                    select wait();
                    rollback;

                    -- start a new transaction; would fail if parent holds lock
                    begin transaction;
                    select * from t;
                    rollback;
                ''')
            finally:
                cx.close()
        z-czutf-8r)�encoding�bufsize�stdin�stdout�started)�timeoutzinsert into t values('test')zno error�end)�inputr�)r�CONNECTION_TIMEOUT�
subprocess�Popenr�
executable�PIPEr9�communicaterr��readline�striprrr$r�r�rTr�rEr��
returncoder�TimeoutExpired�kill)r�SCRIPT�procr/r's     r�&test_ctx_mgr_rollback_if_commit_failed�8MultiprocessTests.test_ctx_mgr_rollback_if_commit_failed�s���#�$*�(�+�d�6M�6M�5N�O	�
��:���
�^�^�T�6�*����/�/��?�?�
��	
����(�(�)�	
����D�K�K�$8�$8�$:�$@�$@�$B�C�
�^�^�F�D�,C�,C�
D��	���
�
�9�:��

�J�J���Z�(��H�H�J�	
���$�/�/�*�	����5�-��@�
	
������!�,�#����&�&�	'��J�J���S��X�&�&��	'��

�H�H�J���(�(�	��I�I�K������	�sT�E9�E(�(E9�0F>�7G�(
E6�2E9�9F;�
$F6�1F>�6F;�;F>�>G�6H	r7N)r8r9r:r;r�rMr�r<r7r!rr�r��s�����>-r!r�c�D�\rSrSrSrSrSrSrSrSr	Sr
S	rS
rg)�RowTestsi�c�x�[R"S5Ul[RURlgr)rrr/r�r�rs rrH�RowTests.setUp�s"���.�.��,���$�j�j����r!c�8�URR5 grKrLrs rrM�RowTests.tearDown�rOr!c��URRS5nUR5nURUR	5SS/5 g)NzSELECT 1 as first, 2 as second�first�second)r/r$r�r�keys�rrGr�s   r�
test_row_keys�RowTests.test_row_keys�s;��
�W�W�_�_�=�
>���k�k�m���������g�x�%8�9r!c��URRS5nUR5nUR[	U5S5 g)NzSELECT 1, 2, 3r2)r/r$r�rr_r�s   r�test_row_length�RowTests.test_row_length�s4��
�W�W�_�_�-�
.���k�k�m������S��1�%r!c���URRS5nUR5nURUSS5 URUSS5 URUSS5 URUSS5 SH=nUR	US9 UR[5 X# SSS5 SSS5 M? g!,(df   N=f!,(df   Mb=f)	NzSELECT 1 as a, 2 as brrr�r�r�)�nokeyr�g333333�?)r�)r/r$r�rr&rer\)rrGr�r�s    r�test_row_getitem�RowTests.test_row_getitem�s���
�W�W�_�_�4�
5���k�k�m������Q���#�����Q���#�����S��1�%�����S��1�%�"�C����#��&��&�&�z�2��H�3�'�&�#�2�2��'�&�s$�C�*C�/C�
C�C�
C$	c�l�URRS5nUR5nURRS5nUR5nURX$5 UR	X$5 URRS5nUR5nURX&5 g)Nz
SELECT 1 as az
SELECT 1 as b)r/r$r��assertIsNotr�assertNotEqual)r�c1�r1�c2�r2�c3�r3s       r�test_row_equality�RowTests.test_row_equality�s���
�W�W�_�_�_�
-��
�[�[�]��
�W�W�_�_�_�
-��
�[�[�]������ ����� �
�W�W�_�_�_�
-��
�[�[�]�����B�#r!c�F�URR5nURUR5 [R
"US5nUR
UR5/5 UR[S5 US SSS5 g!,(df   g=f)Nr7r�)
r/rDr�r�rr�rr�rr\r�s   r�test_row_no_description� RowTests.test_row_no_descriptionsm��
�W�W�^�^�
�����"�.�.�)��j�j��R� ���������R�(�
�
#�
#�J��
8���L�9�
8�
8�s�B�
B c���SSKJn URRS5nUR	5nUR[
[RU55 UR[X155 g)Nr)�SequencezSELECT 1)
�collections.abcr�r/r$r�r=r>rr�r�)rr�rGr�s    r�test_row_is_a_sequence�RowTests.test_row_is_a_sequence
sJ��,�
�W�W�_�_�Z�
(���k�k�m�����
�6�:�:�x�8�9����
�3�1�2r!rN)
r8r9r:r;rHrMr�r�r�r�r�r�r<r7r!rr�r��s*��)��:�
&�

�
$��3r!r��__main__)6r<rfr7�sqlite3rr�rr�rq�urllib.parserUr��test.supportrrrrrrr	r
r�test.support.os_helperrr
rrr�utilrrr�TestCaserr>r�
skipUnlessrrr#r5rtr��requires_working_threadingr�r�r�rrZrar�r�r8�mainr7r!r�<module>r�s���.��	���
�������$�8�+�+�Y�Y�+�%�UI�(�#�#�UI�pN/�h�'�'�N/�b-�8�#4�#4�-�(
���W�V�.�.��<�1�3�%3�X�&�&�%3�3�%3�Pa:��!�!�a:�H\4�(�#�#�\4�~I)��!�!�I)�X
�,�,�.�M:�(�#�#�M:�/�M:�`"�x�(�(�"�,ZN�X�&�&�ZN�z1�X�&�&�1�h �(�(�*;�*;� �$ZP�H�-�-�ZP�z��D-��)�)�D-��D-�N>3�x� � �>3�B�z���M�M�O�r!

Youez - 2016 - github.com/yon3zu
LinuXploit