La cosa bella e' che lavorando con asyncio non avrei neanche bisogno di multiprocessing e queues, ma cosi' non si sconfina dal contesto test di unita' a quello dei test di interoperabilita'? On Aug 7, 2015 5:42 PM, "Manlio Perillo" <manlio.peri...@gmail.com> wrote:
> 2015-08-07 16:50 GMT+02:00 flandero <fland...@gmail.com>: > >> Ciao, >> sto usando una library per mockare su requests, chiamata httpretty. Un >> codice tipo questo: >> >> import httpretty >> import requests >> @httpretty.httprettified >> def prova(): >> httpretty.register_uri(method=httpretty.POST,uri='http://url/',body='ciao >> ciao') >> requests.post('http://url/', data={'a': 1}) >> print(httpretty.last_request().body) >> >> Molto bello, e rende testabili componenti che altrimenti non lo sarebbero. >> >> > Io quando devo testare un client HTTP lancio un server WSGI in un processo > separato (multiprocessing), > utilizzando una Queue per la comunicazione. > > > [...] > > Ciao Manlio > > _______________________________________________ > Python mailing list > Python@lists.python.it > http://lists.python.it/mailman/listinfo/python > >
_______________________________________________ Python mailing list Python@lists.python.it http://lists.python.it/mailman/listinfo/python