관리-도구
편집 파일: test_reflection.cpython-38.pyc
U -?�f� � @ s� d dl Z d dlZd dlZddlmZ ddlmZ ddlmZ ddlmZ ddlm Z ddlm Z dd lmZ dd lmZ ddl mZ ddl mZ dd lmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlm Z ddlm!Z! ddl"m#Z# ddl"m$Z$ ddlm%Z% dd lm&Z& dd!l'm(Z( dd"l)m*Z* dd#lm+Z+ dd$lm,Z, dd%lm-Z- dd&lm.Z. dd'lm/Z/ d(\Z0Z1G d)d*� d*ej2�Z3G d+d,� d,e3�Z4G d-d.� d.ej2�Z5G d/d0� d0ej6�Z7G d1d2� d2ej2�Z8d3d4� Z9G d5d6� d6e,e3�Z:G d7d8� d8ej6�Z;G d9d:� d:e+ej6�Z<G d;d<� d<ej2�Z=G d=d>� d>ej>�Z?G d?d@� d@ej2�Z@G dAdB� dBej2�ZAdCZBdS )D� N� )�config)�engines)�eq_)� expect_raises)�expect_raises_message)�expect_warnings)�fixtures)�is_)�get_temp_table_name)�temp_table_keyword_args��Column)�Table� )�event)� ForeignKey)�func)�Identity)�inspect)�Integer)�MetaData)�String)�testing)�types)� Inspector)� ObjectKind)�ObjectScope)�NoSuchTableError)�UnreflectableTableError)�DDL)�Index)�quoted_name)�BLANK_SCHEMA)�ComparesIndexes)�ComparesTables)�is_false)�is_true)�mock)NNc @ s e Zd Zedd� �ZdS )�OneConnectionTablesTestc C s6 t jjjr,ddlm} tjt|j dd�d�S t j S d S )Nr )�pool�class)Z poolclass�scope)�options)r �requirementsZindependent_connections�enabled� sqlalchemyr* r �testing_engine�dictZ StaticPool�db)�clsr* � r5 �X/opt/hc_python/lib64/python3.8/site-packages/sqlalchemy/testing/suite/test_reflection.py� setup_bind7 s �z"OneConnectionTablesTest.setup_bindN)�__name__� __module__�__qualname__�classmethodr7 r5 r5 r5 r6 r) 6 s r) c @ s� e Zd ZdZedd� �Zedd� �Zedd� �Zedd � �Zd d� Z dd � Z ejj dd� �Zejj dd� �Zejjdd� �Zejjdd� �Zejjejjejjdd� ���Zejjejj dd� ��ZdS )�HasTableTestTc C s~ t d|tdtdd�tdtd��� tjjjrTt d|tdtdd�tdtd��tj d� tjj rf| �|� tjjjrz| � |� d S ) N� test_table�idT��primary_key�data�2 �test_table_s��schema)r r r r r �requires�schemasr/ r �test_schema�view_reflection�define_views�has_temp_table�define_temp_tables�r4 �metadatar5 r5 r6 � define_tablesI s$ � � zHasTableTest.define_tablesc C sp d}t �|dt|�� t �|dtd�� tjjjrldtjtjf }t �|dt|�� t �|dtdtj �� d S )Nz1CREATE VIEW vv AS SELECT id, data FROM test_table�after_create�before_dropzDROP VIEW vvz9CREATE VIEW %s.vv AS SELECT id, data FROM %s.test_table_szDROP VIEW %s.vv) r �listenr r rF rG r/ r rH )r4 rN �queryr5 r5 r6 rJ _ s ����zHasTableTest.define_viewsc C s t ttjdtj� ��S �NZ user_tmp_�r r r3 �ident�r4 r5 r5 r6 �temp_table_nameu s �zHasTableTest.temp_table_namec C s� t ttj�}| �� }t||tdtjdd�tdt�d��f|�}t j jjr|t j j jr|t�|dtdtj �� t�|dtd �� d S ) Nr>