a
    Lf                     @   s:   d dl Z d dlZd dlZddlmZ G dd dejZdS )    N   )utilc                   @   s  e Zd Zeddddeddddeddddeddddeddddedddd	gZejjd
d Z	ejjdd Z
ejjdd Zejjdd Zejjdd Zejjdd Zejjdd Zejjdd Zejjdd Zdd Zdd Zd d! Zd"S )#TestParametersZtestssrcZ	parameterzconstant_real.f90zconstant_integer.f90zconstant_both.f90zconstant_compound.f90zconstant_non_compound.f90zconstant_array.f90c                 C   s`   t jdt jdd d d }tt| jj| t jdt jd}| j| t |g ds\J d S N   Zdtype      )   r   r	   )	nparangeZfloat32pytestraises
ValueErrormoduleZ
foo_singleallcloseselfx r   X/var/www/ai-form-bot/venv/lib/python3.9/site-packages/numpy/f2py/tests/test_parameter.pytest_constant_real_single   s
    z(TestParameters.test_constant_real_singlec                 C   s`   t jdt jdd d d }tt| jj| t jdt jd}| j| t |g ds\J d S r   )	r   r   float64r   r   r   r   Z
foo_doubler   r   r   r   r   test_constant_real_double   s
    z(TestParameters.test_constant_real_doublec                 C   s`   t jdt jdd d d }tt| jj| t jdt jd}| j| t |g ds\J d S )Nr   r   r	   r
   )   r   r	   )	r   r   int32r   r   r   r   Zfoo_compound_intr   r   r   r   r   test_constant_compound_int*   s
    z)TestParameters.test_constant_compound_intc                 C   s4   t jdt jd}| j| t |g ds0J d S )N   r   )   r   r	   r
   )r   r   r   r   Zfoo_non_compound_intr   r   r   r   r   test_constant_non_compound_int5   s    z-TestParameters.test_constant_non_compound_intc                 C   s`   t jdt jdd d d }tt| jj| t jdt jd}| j| t |g ds\J d S r   )	r   r   r   r   r   r   r   Zfoo_intr   r   r   r   r   test_constant_integer_int<   s
    z(TestParameters.test_constant_integer_intc                 C   s`   t jdt jdd d d }tt| jj| t jdt jd}| j| t |g ds\J d S r   )	r   r   Zint64r   r   r   r   Zfoo_longr   r   r   r   r   test_constant_integer_longG   s
    z)TestParameters.test_constant_integer_longc                 C   s`   t jdt jdd d d }tt| jj| t jdt jd}| j| t |g ds\J d S Nr   r   r	   r
   )   r
   r   )	r   r   r   r   r   r   r   Zfoor   r   r   r   r   test_constant_bothR   s
    z!TestParameters.test_constant_bothc                 C   s`   t jdt jdd d d }tt| jj| t jdt jd}| j| t |g ds\J d S r#   )	r   r   r   r   r   r   r   Zfoo_nor   r   r   r   r   test_constant_no]   s
    zTestParameters.test_constant_noc                 C   s`   t jdt jdd d d }tt| jj| t jdt jd}| j| t |g ds\J d S r#   )	r   r   r   r   r   r   r   Zfoo_sumr   r   r   r   r   test_constant_sumh   s
    z TestParameters.test_constant_sumc                 C   sj   t jdt jd}t jdt jd}| j||}t |g dsBJ t |g dsVJ t |dsfJ d S )Nr
   r      )        g?g?)r)   g      $@g      4@g      >@g      D@g      3@)r   r   r   r   Z	foo_arrayr   )r   r   yzr   r   r   test_constant_arrays   s    z"TestParameters.test_constant_arrayc                 C   s:   t jdt jd}| j|}t ||jddds6J d S )Nr   r   )r	   r
   F)order)r   r   r   r   Zfoo_array_any_indexr   Zreshape)r   r   r*   r   r   r   test_constant_array_any_index{   s    z,TestParameters.test_constant_array_any_indexc                 C   s   | j  }|dksJ d S )N	   )r   Zfoo_array_delimsr   r   r   r   test_constant_array_delims   s    
z)TestParameters.test_constant_array_delimsN)__name__
__module____qualname__r   Zgetpathsourcesr   markZslowr   r   r   r    r!   r"   r%   r&   r'   r,   r/   r1   r   r   r   r   r   	   s8   	
















r   )osr   numpyr    r   ZF2PyTestr   r   r   r   r   <module>   s   