otlp-arrow-library 0.6.4

Cross-platform Rust library for receiving OTLP messages via gRPC and writing to Arrow IPC files
Documentation
�

S�"i����dZddlZddlmcmZddlZddlZddl	Z	d�Z
d�Zd�Zd�Z
edk(re	jeg�yy)z$Unit test for library initialization�Nc��ddl}|j�}d}||u}|s�tjd|fd||f�dt	j
�vstj|�rtj|�ndtj|�d�z}dd|iz}ttj|���dx}}|j�y)	z6Test library initialization with default configurationrN��is not�z%(py0)s is not %(py3)s�library��py0�py3�assert %(py5)s�py5��otlp_arrow_library�
PyOtlpLibrary�
@pytest_ar�_call_reprcompare�@py_builtins�locals�_should_repr_global_name�	_saferepr�AssertionError�_format_explanation�shutdown�rr�@py_assert2�@py_assert1�@py_format4�@py_format6s      �K/Users/mark.olliver/GIT/otlp-rust-service/tests/python/test_library_init.py�test_library_init_defaultrsz��� �.�.�0�G���7�$�����7�$�������7����7����$������������c��	�ddl}tj�5}|j|��}d}||u}|s�t	j
d|fd||f�dt
j�vst	j|�rt	j|�ndt	j|�d�z}dd	|iz}tt	j|���dx}}tj}|j}tj}|j}	d
}
d}|	||
|�}||�}
|
�s�dd
t
j�vst	jt�rt	jt�nd
t	j|�t	j|�d
t
j�vst	jt�rt	jt�nd
t	j|�t	j|	�dt
j�vst	j|�rt	j|�ndt	j|
�t	j|�t	j|�t	j|
�d�z}tt	j|���dx}x}x}x}	x}
x}x}}
tj}|j}tj}|j}	d
}
d}|	||
|�}||�}
|
�s�dd
t
j�vst	jt�rt	jt�nd
t	j|�t	j|�d
t
j�vst	jt�rt	jt�nd
t	j|�t	j|	�dt
j�vst	j|�rt	j|�ndt	j|
�t	j|�t	j|�t	j|
�d�z}tt	j|���dx}x}x}x}	x}
x}x}}
|j!�ddd�y#1swYyxYw)z8Test library initialization with custom output directoryrN)�
output_dirrrrrrr�otlp�tracesz�assert %(py18)s
{%(py18)s = %(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.path
}.exists
}(%(py16)s
{%(py16)s = %(py9)s
{%(py9)s = %(py7)s
{%(py7)s = %(py5)s.path
}.join
}(%(py10)s, %(py12)s, %(py14)s)
})
}�os�tmpdir)r	�py2�py4r�py7�py9�py10�py12�py14�py16�py18�metrics)r�tempfile�TemporaryDirectoryrrrrrrrrrr%�path�exists�joinr)rr&rrrrr�@py_assert3�@py_assert6�@py_assert8�@py_assert11�@py_assert13�@py_assert15�@py_assert17�@py_format19s               r�#test_library_init_custom_output_dirr>s����	�	$�	$�	&�&�$�2�2�f�2�E��"�"�w�d�"�"�"�"�w�d�"�"�"�"�"�"�w�"�"�"�w�"�"�"�d�"�"�"�"�"�"�"��w�w�E�w�~�~�E�b�g�g�E�g�l�l�E�6�E�8�E�l�6�6�8�D�E�~�D�E�E�E�E�E�E�E�E�r�E�E�E�r�E�E�E�w�E�E�E�~�E�E�E�E�E�E�b�E�E�E�b�E�E�E�g�E�E�E�l�E�E�E�E�E�E�6�E�E�E�6�E�E�E�6�E�E�E�8�E�E�E�D�E�E�E�E�E�E�E�E�E�E�E��w�w�F�w�~�~�F�b�g�g�F�g�l�l�F�6�F�9�F�l�6�6�9�E�F�~�E�F�F�F�F�F�F�F�F�r�F�F�F�r�F�F�F�w�F�F�F�~�F�F�F�F�F�F�b�F�F�F�b�F�F�F�g�F�F�F�l�F�F�F�F�F�F�6�F�F�F�6�F�F�F�6�F�F�F�9�F�F�F�E�F�F�F�F�F�F�F�F�F�F�F�	����
'�	&�	&�s�R8S�S#c��ddl}|jddd��}d}||u}|s�tjd|fd||f�d	t	j
�vstj|�rtj|�nd	tj|�d
�z}dd|iz}ttj|���dx}}|j�y)
z1Test library initialization with custom intervalsrN�
i�i )�write_interval_secs�trace_cleanup_interval_secs�metric_cleanup_interval_secsrrrrrrr
rs      r�"test_library_init_custom_intervalsrD#s���� �.�.��$(�%)�/��G�
��7�$�����7�$�������7����7����$�����������r c��ddl}|jdddd��}d}||u}|s�tjd|fd||f�d	t	j
�vstj|�rtj|�nd	tj|�d
�z}dd|iz}ttj|���dx}}|j�y)
z7Test library initialization with protocol configurationrNTi�i�)�protobuf_enabled�
protobuf_port�arrow_flight_enabled�arrow_flight_portrrrrrrr
rs      r�!test_library_init_protocol_configrJ2s���� �.�.���!��	/��G���7�$�����7�$�������7����7����$�����������r �__main__)�__doc__�builtinsr�_pytest.assertion.rewrite�	assertion�rewriterr1r%�pytestrr>rDrJ�__name__�main�__file__�r r�<module>rVsH��*����	�
��
� �
� �z���F�K�K��
��r