Skip to main content

Library for unittesting json REST apis built with pymacaron

Project description


Python library for unittesting json REST apis built with pymacaron, including support for JWT authentication, Error formats used by pymacaron and compatible with 'pymtest', the testing tool used in pymacaron microservices.


    from pymacaron_unit.testcase import PyMacaronTestCase

    class Tests(PyMacaronTestCase):

        def setUp(self):
   = ''
            self.port = 80

        def test_make_some_calls(self):

            # Test that GET returns a json structure
            j = self.assertGetReturnJson(

            # Same, with setting the Authorization http header to a JWT token
            j = self.assertGetReturnJson(
                auth="Bearer %s" % self.token

            # Do a POST
            j = self.assertPostReturnJson(
                    'foo': 'bar',

See pymacaron_unit/ for a complete list of test methods.


See test/ :-)


Erwan Lemonnier

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pymacaron-unit, version 1.0.20
Filename, size File type Python version Upload date Hashes
Filename, size pymacaron-unit-1.0.20.tar.gz (5.2 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page