
    +$j<                     \    d dl Zd dlmc mZ d dlmZ d dlm	Z	 d dl
mZmZmZmZ d Zd ZdS )    N)
TestClient)app)redact_authorization_headerredact_client_secretredact_tokenredact_upload_urlc                     t          t                    } |                     d          }|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}}|                                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}}d S )Nz/api/health   ==)z3%(py2)s
{%(py2)s = %(py0)s.status_code
} == %(py5)sresponse)py0py2py5zassert %(py7)spy7statusok)z%(py1)s == %(py4)s)py1py4zassert %(py6)spy6)r   r   getstatus_code
@pytest_ar_call_reprcompare@py_builtinslocals_should_repr_global_name	_safereprAssertionError_format_explanationjson)clientr   @py_assert1@py_assert4@py_assert3@py_format6@py_format8@py_assert0@py_assert2@py_format5@py_format7s              S/home/agent/projects/AutoShorts_Dashboard/backend/tests/test_health_and_security.pytest_health_endpoint_reports_okr-      s   __Fzz-((H&3&3&&&&&&&&&&3&&&&&&&&&&&&8&&&&&8&&&&&&&&&&3&&&&&&&&&&&&&&&&&&&&&&&&&&&==??8$,,$,,,,,,,,,,$,,,,,$,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,    c                  r	   d} t          |           }d}||k    }|st          j        d|fd||f          dt          j                    v st          j        t                     rt          j        t                     ndt          j        |           t          j        |          t          j        |          dz  }dd|iz  }t          t          j        |                    d x} x}x}}d	} t          |           }d}||k    }|st          j        d|fd||f          d
t          j                    v st          j        t                    rt          j        t                    nd
t          j        |           t          j        |          t          j        |          dz  }dd|iz  }t          t          j        |                    d x} x}x}}d} t          |           }d}||k    }|st          j        d|fd||f          dt          j                    v st          j        t                    rt          j        t                    ndt          j        |           t          j        |          t          j        |          dz  }dd|iz  }t          t          j        |                    d x} x}x}}t          d          }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}||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}||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 S )Nabc123secretz
[REDACTED]r   )z0%(py4)s
{%(py4)s = %(py0)s(%(py2)s)
} == %(py7)sr   )r   r   r   r   zassert %(py9)spy9zsuper-secretr   zBearer abc123zBearer [REDACTED]r   z8https://upload.example.test/path?token=abc&signature=defabc)not in)z%(py1)s not in %(py3)sredacted)r   py3zassert %(py5)sr   def)in)z%(py1)s in %(py3)s)r   r   r   r   r   r   r   r   r    r   r   r   )r#   r%   @py_assert6@py_assert5r'   @py_format10r4   r(   r)   @py_format4r&   s              r,   +test_redaction_helpers_never_return_secretsr<      sc   &7<''7<7'<7777777777'<777777777777<77777<7777777777'7777<77777777777777777777777777777 .?//?<?/<??????????/<???????????????????????????/????<?????????????????????????????'6N&77N;NN7;NNNNNNNNNNN7;NNNNNNNNNNNNN&NNNNN&NNNNNNNNNN7NNNN;NNNNNNNNNNNNNNNNNNNNNNNNNNNNNN ![\\H 5          5     5                                            5          5     5                                           #<8##########<8#####<###########8#####8#############################r.   )builtinsr   _pytest.assertion.rewrite	assertionrewriter   fastapi.testclientr   app.mainr   app.security.redactionr   r   r   r   r-   r<    r.   r,   <module>rE      s                  ) ) ) ) ) )       u u u u u u u u u u u u- - -$ $ $ $ $r.   