New paste Repaste Download
client = <FlaskClient <Flask 'app'>>
tokens = {'access_token': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmcmVzaCI6ZmFsc2UsImlhdCI6MTcxNTgwMDI5NCwianRpIjoiYWZkOTY0MmI...83R2toUDlmeU9JRDE1YlNyNnVxektWWFF4Q1J0a3pCY0hjUVV5RjZ2WFozbENUa0h0N1E9In0.4Cq27IypM2l_Xxtvw2NlPaITc2jp4VinyLBj2xP-g0o'}
template_id = '524eb519354d4386a8e9fb10a76af3ef'
contract_type = 'Non Disclosure Agreement', expect = 200
work_flow_cache = {'contract_type': '75501dc99bd04563be254b6de66107d2', 'doc_ids': {'Document Discovery': ['203ac88e197a4491853fde5c617f...e': 'Confidentiality', 'create_time': 1715800296, 'create_uid': '21e3e2eb48ba42a99c315aca1f4c83db', ...}, ...]}}}, ...}
    @pytest.mark.parametrize(
        "template_id, contract_type, expect",
        [
            (
                "c2bebd2fc65747919fdf4e5659556437",
                "Non Disclosure Agreement",
                200,
            ),  # Valid input
            (None, "standard_contract", 400),  # Missing template_id
            (123, "standard_contract", 400),  # Wrong type for template_id
        ],
    )
    def test_get_key_term_specifications(
        client: FlaskClient,
        tokens: Dict[str, str],
        template_id: int,
        contract_type: str,
        expect: int,
        work_flow_cache: dict,
    ) -> None:
        """
        Tests the /variables/list endpoint.
        """
        token = tokens["access_token"]  # Assuming your token handling
        if expect == 200:
            template_ids = work_flow_cache.get("template_ids")
            if template_ids:
                document_drafting_list = template_ids.get("['Document Drafting']")
                if document_drafting_list:
                    template_id = document_drafting_list[0]
    
        payload = {"template_id": template_id, "contract_type": contract_type}
        result = client.post(
            path="/v1/variables/list",
            json=payload,
            headers={"Authorization": f"Bearer {token}"},
        )
    
>       assert result.status_code == expect
E       assert 500 == 200
E        +  where 500 = <WrapperTestResponse streamed [500 INTERNAL SERVER ERROR]>.status_code
tests/test_15_draft.py:104: AssertionError
Filename: None. Size: 2kb. View raw, , hex, or download this file.

This paste expires on 2024-05-22 19:09:56.487076. Pasted through deprecated-web.