servicemock

Mock DSL for requests_mock


Licenses
GPL-3.0/GPL-3.0+
Install
pip install servicemock==0.1.1

Documentation

Servicemock

Build Status

Unittest example

import unittest
import servicemock as sm


class TestService(sm.ServiceMockTestCase):

    def test(self):
        # If the expected request is not made the test will fail
        sm.expect('http://service.com').to_receive(sm.Request('GET', '/v1/users')).and_responds(sm.HTTP200Ok(sm.JSON({'status': 'ok'})))