|
Server : LiteSpeed System : Linux server51.dnsbootclub.com 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64 User : nandedex ( 1060) PHP Version : 8.1.33 Disable Function : NONE Directory : /opt/cppython/lib/python3.8/sqlite3/test/__pycache__/ |
U
?��gz* � @ sx d dl Z d dlZd dlmZmZ G dd� de j�ZG dd� de j�ZG dd� de j�Z d d
� Z
dd� Zed
krte� dS )� N)�TESTFN�unlinkc @ s^ e Zd Zdd� Zdd� Zdd� Zdd� Ze�e j
d k d
�dd� �Zd
d� Zdd� Z
dd� ZdS )�CollationTestsc C s4 t �d�}| �t�� |�d dd� � W 5 Q R X d S )N�:memory:c S s | |k| |k S �N� ��x�yr r �1/opt/cppython/lib/python3.8/sqlite3/test/hooks.py�<lambda>! � z>CollationTests.CheckCreateCollationNotString.<locals>.<lambda>)�sqlite�connect�assertRaises� TypeError�create_collation��self�conr r r �CheckCreateCollationNotString s
z,CollationTests.CheckCreateCollationNotStringc C sB t �d�}| �t��}|�dd� W 5 Q R X | �t|j�d� d S )Nr �X�* zparameter must be callable)r r r r r �assertEqual�str� exception�r r �cmr r r �CheckCreateCollationNotCallable# s
z.CollationTests.CheckCreateCollationNotCallablec C s6 t �d�}| �t j�� |�ddd� � W 5 Q R X d S )Nr u colläc S s | |k| |k S r r r r r r r , r
z=CollationTests.CheckCreateCollationNotAscii.<locals>.<lambda>)r r r ZProgrammingErrorr r r r r �CheckCreateCollationNotAscii) s
z+CollationTests.CheckCreateCollationNotAsciic C sl G dd� dt �}t�d�}dd� }|�|d�|� |�d��� }| �|d d d � | �|d
d d� d S )Nc @ s e Zd Zdd� ZdS )z@CollationTests.CheckCreateCollationBadUpper.<locals>.BadUpperStrc S s d S r r )r r r r �upper0 s zFCollationTests.CheckCreateCollationBadUpper.<locals>.BadUpperStr.upperN)�__name__�
__module__�__qualname__r r r r r �BadUpperStr/ s r$ r c S s | |k| |k S r r r r r r r 3 r
z=CollationTests.CheckCreateCollationBadUpper.<locals>.<lambda>�mycollz�
select x from (
select 'a' as x
union
select 'b' as x
) order by x collate mycoll
r �b� �a)r r r r �execute�fetchallr )r r$ r r% �resultr r r �CheckCreateCollationBadUpper. s
z+CollationTests.CheckCreateCollationBadUpper)� � r'