9 lines
1.0 KiB
Python
9 lines
1.0 KiB
Python
from pathlib import Path
|
|
import importlib.util,json,re
|
|
OUT=Path(__file__).resolve().parent;spec=importlib.util.spec_from_file_location('transport',OUT/'consumer-lot-lib.py');lib=importlib.util.module_from_spec(spec);spec.loader.exec_module(lib)
|
|
c=lib.Client();pre=json.loads((OUT/'option-B6-preflight.json').read_text(encoding='utf-8'));route='/carteira/'+pre['public_portfolios'][0]['id']
|
|
status,headers,body=c.request('GET',route,accept='application/json');assert headers.get('X-Investmoz-QA-Target')==lib.TARGET
|
|
data=json.loads(body);message=data.get('message','');assert isinstance(message,str)and len(message)<300 and not any(x in message.lower()for x in ['password','secret','token','cookie','sql:'])
|
|
proof={'route':route,'status':status,'message':message,'active_writes':0,'browser_observed':False,'response_other_fields_recorded':False}
|
|
dest=OUT/'option-B6-portfolio-status.json';assert not dest.exists();dest.write_text(json.dumps(proof,ensure_ascii=False,indent=2)+'\n',encoding='utf-8');print(json.dumps(proof,ensure_ascii=False))
|