| client = <FlaskClient <Flask 'app'>>
|
| tokens = {'access_token': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmcmVzaCI6ZmFsc2UsImlhdCI6MTcxNTgwMzMwMiwianRpIjoiZDMxNTMyOTA...VqMWpHakgtZEt6RGJmcGVvTjliTHJ6MDhGWWpPZEQ4d3MwXzZpR1Z2dXBValNGcmh5VGM9In0.JZ1irjLjnt3YbPnkVucC9L65BRG6Nh1tL3_DAyG2L60'}
|
| template_id = '821e098c6b0b41f587c15d21713e48e1'
|
| contract_type = 'Non Disclosure Agreement', expect = 200
|
| work_flow_cache = {'contract_type': 'f6c8b4ca533d42b59f0197977dd06da8', 'doc_ids': {'Document Discovery': ['f8f089b107274d32b19b2e59bb9e...e': 'Confidentiality', 'create_time': 1715803304, 'create_uid': '5cc01cb2a3124838a63ae5d88c75e65e', ...}, ...]}}}, ...}
|
|
|
| @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}"},
|
| )
|
| if result.status_code != expect:
|
| print(result.json)
|
| breakpoint()
|
| print(result.json)
|
| > assert result.status_code == expect
|
| E assert 500 == 200
|
| E + where 500 = <WrapperTestResponse 39 bytes [500 INTERNAL SERVER ERROR]>.status_code
|
|
|
| tests/test_15_draft.py:107: AssertionError
|