Skip to content

Pythonicos/fakeserver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FakeServer - Mockable Webserver

Com o fakeserver você consegue simular comportamentos, downloads, etc, perfeito para execução de testes de integração. Você consegue fazer alterações das rotas em tempo de execução.

ROTAS PARA CONFIGURAÇÃO

TEMPLATES:

esses são os templates que já existem

APONTANDO SERVER

helper.DOMAIN = '0.0.0.0:8080'

ACOMPANHAR OS MOCKS EXISTENTES

ACESSE http://0.0.0.0:8080 os downloads e redirects configurados

RESETAR CONFIGURAÇÕES

helper.reset_mocks()

MUDAR TEMPLATE DE RESPOSTA

ao acessar teste.html ele responde not_found.html (sem redirect)

helper.set_url_to_template("teste.html", "not_found.html")

CRIAR REDIRECT

helper.set_redirect_chain_from_url("redirect1.html", [ "redirect2.html", "redirect3.html", "teste.html" ]) # sempre termina em um TEMPLATE ou DOWNLOAD de arquivo

CRIAR DOWNLOAD DE ARQUIVO

helper.set_filename_to_download("nomedoarquivo.txt", b'bytes do arquivo')

About

Mockable webserver

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published