Skip to content

superduper/pymockhttpserver.tornado

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mock_http
---------

mock_http is a python package for unit testing code that depends on web
services. It allows you to mock up the web service used by your software without
monkey-patching or modifying the code being tested. The mocked web service can
respond to specific requests with specific responses.

Installation
------------

mock_http is a setuptools package distributed through the Python Package Index.

To install from pypi:

pip install mock_http

Usage
-----

from unittest import TestCase
import httplib2

mock = MockHTTP(self.server_port)
mock.expects(method=GET, path='/index.html')
resp, status = self.http.request(
    uri = 'http://localhost:%s/index.html' % self.server_port)
assert resp['status'] == '200'
assert mock.verify()

About

Python mock HTTP server based on tornado

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages