o
    QDi'                     @   sN   d dl Z d dlmZmZ dd Zdd Ze jje jddd	gd
d Z	dS )    N)FrictionlessExceptionResourcec                  C   s   d} t d| d}tt}|jdd W d    n1 sw   Y  |jj}|jj}|jdks2J |j	dks9J |d jdksBJ |d j	d	ksKJ d S )
Nzdata/resource.profile.jsondata/table.csv)pathprofileT)validateresource-errordescriptor is not validr   )'requiredProperty' is a required property)
r   pytestraisesr   to_descriptorvalueerrorreasonstypenote)r   resourceexcinfor   r    r   d/var/www/Datamplify/venv/lib/python3.10/site-packages/frictionless/resource/__spec__/test_profile.py$test_resource_profiles_to_descriptor   s   r   c                  C   s   t t} tdddd W d    n1 sw   Y  | jj}| jj}|jdks-J |j	dks4J |d jdks=J |d j	dksFJ d S )	Nnamer   zdata/profiles/required.jsonr   r   r   r   r	   r   r
   )
r   r   r   r   from_descriptorr   r   r   r   r   )r   r   r   r   r   r   &test_resource_profiles_from_descriptor   s   r   r   zdata-resourceztabular-data-resourcec                 C   s4   dd| d}t |}| }|dd u sJ d S )Ntabler   r   r   )r   r   r   get)r   
descriptorr   r   r   r   test_resource_profile_type&   s   
r   )
r   frictionlessr   r   r   r   markskipparametrizer   r   r   r   r   <module>   s    