
    i                         d Z ddlZddlmc mZ ddlZddlZej                  j                  dd       ddlmZ d Zd Zy)u   Langfuse集成测试    Nz!/home/jang/Projects/ai-researcher)LangfuseClientc                     t               } | j                  }d}||k(  }|st        j                  d|fd||f      dt	        j
                         v st        j                  |       rt        j                  |       ndt        j                  |      t        j                  |      dz  }dd|iz  }t        t        j                  |            dx}x}}y)	u#   测试无配置时Langfuse被禁用F==)z/%(py2)s
{%(py2)s = %(py0)s.enabled
} == %(py5)sclient)py0py2py5zassert %(py7)spy7N)
r   enabled
@pytest_ar_call_reprcompare@py_builtinslocals_should_repr_global_name	_safereprAssertionError_format_explanation)r   @py_assert1@py_assert4@py_assert3@py_format6@py_format8s         =/home/jang/Projects/ai-researcher/tests/unit/test_langfuse.py%test_langfuse_disabled_without_configr   	   sw    F>>"U">U"""">U""""""6"""6""">"""U"""""""    c                     t               } d| _        d| _        d| _        | j	                         }d}||v }|st        j                  d|fd||f      t        j                  |      dt        j                         v st        j                  |      rt        j                  |      nddz  }d	d
|iz  }t        t        j                  |            dx}}|d   }|j                  }d} ||      }|stdt        j                  |      t        j                  |      t        j                  |      t        j                  |      dz  }t        t        j                  |            dx}x}x}}|d   }d}	||	k(  }|slt        j                  d|fd||	f      t        j                  |      t        j                  |	      dz  }
dd|
iz  }t        t        j                  |            dx}x}}	y)u   测试请求头格式zpk-testzsk-testTAuthorization)in)z%(py1)s in %(py3)sheaders)py1py3zassert %(py5)sr
   NzBasic zLassert %(py7)s
{%(py7)s = %(py3)s
{%(py3)s = %(py1)s.startswith
}(%(py5)s)
})r!   r"   r
   r   zContent-Typezapplication/jsonr   )z%(py1)s == %(py4)s)r!   py4zassert %(py6)spy6)r   
public_key
secret_keyr   _get_headersr   r   r   r   r   r   r   r   
startswith)r   r    @py_assert0@py_assert2@py_format4r   r   @py_assert6r   r   @py_format5@py_format7s               r   test_get_headers_formatr/      sF   F!F!FFN!!#G%?g%%%%?g%%%?%%%%%%g%%%g%%%%%%%?#8#..8x8.x88888#888.888x8888888888>"8&88"&88888"&8888"888&88888888r   )__doc__builtinsr   _pytest.assertion.rewrite	assertionrewriter   pytestsyspathinsert src.integrations.langfuse_clientr   r   r/    r   r   <module>r;      s2        
 6 7 ;#9r   