
    <e                     \   d dl Z d dlmZ d dlZddlmZmZ  G d d          Z ee          j	        dz  Z
 ee
dz                      d	                    Zes
J d
            g ZeD ]xZe                    d          Z	  e j        e                                                                          Zn# e$ r  ee          ZY nw xY we                    e           y ee          Z ee
dz                      d	                    Zes
J d             G d dej                  ZdS )    N)Path   )
burntsushitomllibc                       e Zd ZdefdZdS )MissingFilepathc                     || _         d S )N)r	   )selfr	   s     2/usr/lib/python3.11/test/test_tomllib/test_data.py__init__zMissingFile.__init__   s    			    N)__name__
__module____qualname__r   r    r   r   r   r      s/        T      r   r   datavalidz	**/*.tomlzValid TOML test files not foundz.jsoninvalidz!Invalid TOML test files not foundc                       e Zd Zd Zd ZdS )TestDatac                    t           D ]}|                     |j                  5  |                                }	 |                                }n# t
          $ r Y d d d            _w xY w|                     t          j                  5  t          j	        |           d d d            n# 1 swxY w Y   d d d            n# 1 swxY w Y   d S )Nmsg)
INVALID_FILESsubTeststem
read_bytesdecodeUnicodeDecodeErrorassertRaisesr   TOMLDecodeErrorloads)r   r   
toml_bytestoml_strs       r   test_invalidzTestData.test_invalid%   so   $ 		, 		,G',// , ,$//11
)0022HH)   , , , , , , , &&w'>?? , ,M(+++, , , , , , , , , , , , , , ,, , , , , , , , , , , , , , ,		, 		,sX   CAC
A(C'A(("C
B+C+B//C2B/3CC		C	c                    t          t          t                    D ]\  }}|                     |j                  5  t          |t                    r|j        dv sJ 	 d d d            N|                                                                }t          j
        |          }t          j        |          }t          j        |          }|                     ||           d d d            n# 1 swxY w Y   d S )Nr   >   qa-array-inline-nested-1000qa-table-inline-nested-1000)zipVALID_FILESVALID_FILES_EXPECTEDr   r   
isinstancer   r   r   r   r#   r   convert	normalizeassertEqual)r   r   expectedr%   actuals        r   
test_validzTestData.test_valid1   sT   ";0DEE 	3 	3OE8%*-- 3 3h44  !: *     3 3 3 3 3 3 3 !++--4466 x00#+F33%/99  2223 3 3 3 3 3 3 3 3 3 3 3 3 3 3	3 	3s   "C-)A8C--C1	4C1	N)r   r   r   r&   r3   r   r   r   r   r   $   s2        
, 
, 
,3 3 3 3 3r   r   )jsonpathlibr   unittest r   r   r   __file__parentDATA_DIRtupleglobr+   _expected_filespwith_suffix	json_pathr#   r   r   textFileNotFoundErrorappendr,   r   TestCaser   r   r   r   <module>rE      s  
         ! ! ! ! ! ! ! !       
 4>> 6)eX'--k::;; 5 55 5 5 5	 ! !Ag&&I&tz)..007799:: & & &{9%%&4    u_-- x)+11+>>?? 9 99 9 9 93 3 3 3 3x  3 3 3 3 3s    4B55CC