3
Ud[!                 @   s   d dl Z d dlZd dlmZ d dlZd dlZd dlmZmZ d dl	j
ZG dd dZG dd deZdd	 Zd
d Zdd ZG dd deZG dd deZdS )    N)List)apicompatc               @   s   e Zd ZdddZdS )BaseNc             C   sJ   t dd t|D }|d k	r2t t|t| }t |}tj|| d S )Nc             s   s   | ]}|j d s|V  qdS )__N)
startswith).0f r
   M/var/www/html/virt/lib64/python3.6/site-packages/pandas/tests/api/test_api.py	<genexpr>   s    zBase.check.<locals>.<genexpr>)sorteddirsettmZassert_almost_equal)self	namespaceexpectedignoredresultr
   r
   r   check   s
    z
Base.check)N)__name__
__module____qualname__r   r
   r
   r
   r   r      s   r   c            '   @   s  e Zd ZU dddgZdddddd	d
ddddddgZddgZee dddgZddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<g'Z	g Z
ee 
d=gZee ejse	jd>d?d@g g Zee dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^gZd_d`dadbdcddgZdedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwgZdxgZdydzd{d|gZg Zee g Zee d}d~ddddddddddgZdd Zdd ZdS )	TestPDApitestslocaleZconftestr   Zarraysr   coreerrorspandasZplottingtesttestingZtseriesutiloptionsionpdatetimeZ
IndexSliceZNaTZNAZCategoricalZCategoricalIndexZ	DataFrameZ
DateOffsetZDatetimeIndexZ	ExcelFileZExcelWriterZFloat64IndexZGrouperZHDFStoreIndexZ
Int64IndexZ
MultiIndexZPeriodZPeriodIndexZ
RangeIndexZUInt64IndexZSeriesZSparseDtypeZStringDtypeZ	TimedeltaZTimedeltaIndex	TimestampZIntervalZIntervalIndexZCategoricalDtypeZPeriodDtypeZIntervalDtypeZDatetimeTZDtypeZBooleanDtypeZ	Int8DtypeZ
Int16DtypeZ
Int32DtypeZ
Int64DtypeZ
UInt8DtypeZUInt16DtypeZUInt32DtypeZUInt64DtypeZNamedAggSparseArrayZPanelZSparseSeriesZSparseDataFramearrayZbdate_rangeconcatZcrosstabZcutZ
date_rangeZinterval_rangeevalZ	factorizeZget_dummiesZ
infer_freqZisnaZisnullZlreshapeZmeltZnotnaZnotnulloffsetsmergeZmerge_orderedZ
merge_asofZperiod_rangeZpivotZpivot_tableZqcutZshow_versionsZtimedelta_rangeuniqueZvalue_countsZwide_to_longZreset_optionZdescribe_option
get_optionZoption_contextZ
set_optionZset_eng_float_formatZread_clipboardZread_csvZ
read_excelZread_fwfZread_gbqZread_hdfZ	read_html	read_jsonZread_pickleZread_sasZread_sqlZread_sql_queryZread_sql_tableZ
read_stataZ
read_tableZread_featherZread_parquetZread_orcZ	read_spssZjson_normalizeto_datetimeZ
to_numericZ	to_pickleZto_timedelta_configZ
_hashtableZ_libZ_libsZ_np_version_under1p16Z_np_version_under1p17Z_np_version_under1p18Z_is_numpy_dev_testingZ_tslibZ_typing_versionc             C   sz   | j | j | j | j | j | j | j | j | j | j	 }t
jsf|j| j| j | j | j | j  | jt|| j d S )N)libmiscmodulesclassesfuncsfuncs_option
funcs_read
funcs_jsonfuncs_toprivate_modulesr   PY37extenddeprecated_modulesdeprecated_classesdeprecated_classes_in_futuredeprecated_funcs_in_futuredeprecated_funcsr   pdr   )r   Z
checktheser
   r
   r   test_api   s
    < zTestPDApi.test_apic             C   s   | j | j | j | j | j }xv|D ]n}tjtZ tt	|}t
js|dkrd|jtt	jjd  n$|dkrv|g  n|jt|d  W d Q R X q$W d S )Nr&      r)   rJ   )rB   rC   rD   rF   rE   r   assert_produces_warningFutureWarninggetattrrG   r   r@   __getattr__r   r&   )r   Zdeprecated_listZdepr
deprecatedr
   r
   r   	test_depr   s    


zTestPDApi.test_deprN)r   r   r   r   r6   rB   r   strr7   r9   rC   rD   r   r@   rA   r8   r:   r;   r<   r=   r>   rE   rF   r?   rH   rP   r
   r
   r
   r   r      s
  


r   c              C   s|   ddl m }  dd l}|j V |jdt | dddddtj dddddksPtttj dddddtj sntW d Q R X d S )Nr   )r&   ignorei  rI      )r&   warningscatch_warningssimplefilterrL   rG   AssertionError
isinstance)r&   rT   r
   r
   r   test_datetime   s    
&rY   c              C   sL   dd l } | j 2 | jdt ttjdddgddtjs>tW d Q R X d S )Nr   rR   rI   rS      ZSparse)Zdtype)	rT   rU   rV   rL   rX   rG   r*   r)   rW   )rT   r
   r
   r   test_sparsearray  s    
r[   c              C   sV   dd l } dd l}| j 4 | jdt tjjdd|jddkj sHt	W d Q R X d S )Nr   rR   
   )
rT   ZnumpyrU   rV   rL   rG   r%   ZarangeallrW   )rT   r%   r
   r
   r   test_np  s
    
r^   c               @   s   e Zd ZdddgZdd ZdS )TestApitypes
extensionsZindexersc             C   s   | j t| j d S )N)r   r   allowed)r   r
   r
   r   rH     s    zTestApi.test_apiN)r   r   r   rb   rH   r
   r
   r
   r   r_     s   
r_   c               @   s8   e Zd ZddddgZdd Zdd Zd	d
 Zdd ZdS )TestTestingZassert_frame_equalassert_series_equalZassert_index_equalZassert_extension_array_equalc             C   s   ddl m} | j|| j d S )Nr   )r!   )r   r!   r   r:   )r   r!   r
   r
   r   test_testing&  s    zTestTesting.test_testingc             C   s\   t jjdd  tjt}dd l}W d Q R X dt|d jksBt	dt|d jksXt	d S )Nzpandas.util.testingr   z!pandas.util.testing is deprecatedzpandas.testing instead)
sysr8   popr   rK   rL   pandas.util.testingrQ   messagerW   )r   mr   r
   r
   r   test_util_testing_deprecated+  s
    z(TestTesting.test_util_testing_deprecatedc             C   s`   t jjdd  tjt}ddlm} W d Q R X dt|d j	ksFt
dt|d j	ks\t
d S )Nzpandas.util.testingr   )rd   z!pandas.util.testing is deprecatedzpandas.testing instead)rf   r8   rg   r   rK   rL   rh   rd   rQ   ri   rW   )r   rj   rd   r
   r
   r   #test_util_testing_deprecated_direct5  s
    z/TestTesting.test_util_testing_deprecated_directc          	   C   sN   t jtjddgt jdj }d|ks(ttjt	dd t
jj W d Q R X d S )Nz-cz6import pandas; pandas.util.testing.assert_series_equal)stderrz!pandas.util.testing is deprecatedfoo)match)
subprocesscheck_outputrf   
executableSTDOUTdecoderW   pytestZraisesAttributeErrorrG   r"   rn   )r   outr
   r
   r   test_util_in_top_level>  s    z"TestTesting.test_util_in_top_levelN)r   r   r   r:   re   rk   rl   rx   r
   r
   r
   r   rc     s   
	rc   )rp   rf   typingr   ru   r   rG   r   r   Zpandas._testingr4   r   r   r   rY   r[   r^   r_   rc   r
   r
   r
   r   <module>   s   
 a
