CodeSampleX

Exemplo

requests 2.34.2: Preserve Session state and environment CA verification settings when manually preparing and sending Requests 2.34.2 calls

Amostra verificada para pypi requests 2.34.2: Preserve Session state and environment CA verification settings when manually preparing and sending Requests…

sha256:98f0ab60b35b9e2f6b5004f999315e13dca1143e3072aa3eb69f870e8c878f99

Esta rede oferece uma coisa: uma amostra que compila. Ela a executou em um sandbox e guardou o recibo assinado. Não classifica nem garante nada — se o mesmo código compila onde você está, ela não mediu. Quantas chaves de assinatura distintas enviaram um recibo de contrato aprovado. Uma é só o autor; mais de uma significa que outra pessoa também o compilou. Uma chave é gerada por conta própria e não tem identidade registrada por trás, então conta chaves, não pessoas. MIT-0

Evidência de execução

O ambiente declarado e as execuções assinadas ficam separados, para você ver exatamente o que esta amostra executou e onde.

Base da evidência
Contrato assinado aprovado
Recibos de verificação
2
Chaves de assinatura que o compilaram
2
Ambiente declarado python 3.12 linux x64 python 3.12 python 3.12 pip

Ambientes das execuções de verificação

Ambiente Contrato Etapas Execução
python 3.12 · linux alpine/x64 · docker ed25519:d91480838ac982c9 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · python@1
2026-08-17
python 3.12 · linux alpine/x64 · docker ed25519:2175b912ea1c23b1 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · python@1
2026-08-18

Caso

HOW
Objetivo
Preserve Session state and environment CA verification settings when manually preparing and sending Requests 2.34.2 calls
Pacotes
Símbolos
  • requests.Request.prepare
  • requests.Session.prepare_request
  • requests.Session.merge_environment_settings
  • requests.Session.send
  • requests.Session.get
Ambiente
python 3.12
Criado
2026-08-17T03:54:11Z

Contrato

  1. assert Request.prepare omits Session default headers and cookies while Session.prepare_request applies both
  2. assert a per-request header value of None removes that inherited header without mutating the Session default
  3. assert Session.send of a prepared request uses Session.verify and does not consult REQUESTS_CA_BUNDLE by itself
  4. assert Session.get and an explicit merge_environment_settings plus Session.send both pass REQUESTS_CA_BUNDLE to the recording adapter as verify
  5. assert explicit verify false overrides the environment CA bundle and trust_env false ignores it
  6. assert the recording adapter completes every request path without DNS, TLS, a listening socket, or an external service

Arquivos

  • NOTES.md
  • csx.json
  • requirements.in
  • requirements.lock
  • requirements.txt
  • test/contract.py

Baixar o artefato de código-fonte (tar.gz)

Seeder de origem

csx-seed