pymacaron-unit
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.
Synopsis
from pymacaron_unit.testcase import PyMacaronTestCase
class Tests(PyMacaronTestCase):
def setUp(self):
super.setUp()
self.host = 'api.fixer.io'
self.port = 80
def test_make_some_calls(self):
# Test that GET returns a json structure
j = self.assertGetReturnJson(
"v1/hello",
)
# Same, with setting the Authorization http header to a JWT token
j = self.assertGetReturnJson(
"v1/hello",
auth="Bearer %s" % self.token
)
# Do a POST
j = self.assertPostReturnJson(
"v1/hello",
{
'foo': 'bar',
}
)
See pymacaron_unit/testcase.py for a complete list of test methods.
Examples
See test/test_unit.py :-)
Author
Erwan Lemonnier
github.com/pymacaron
github.com/erwan-lemonnier
www.linkedin.com/in/erwan-lemonnier/
Metadata
Release files for pymacaron-unit 1.0.20
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pymacaron-unit-1.0.20.tar.gz | 5.2 kB | Details |
Release files / pymacaron-unit-1.0.20.tar.gz
| Download URL | pymacaron-unit-1.0.20.tar.gz |
|---|---|
| Size | 5.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bbe296e6000fbb623b8d8657dadfad58b60a8a26e55f71c908ac27b38c7de6b4
|
|
BLAKE2b-256 checksum How to use checksums |
df0881dda4daa8491db23b5858a7c7ccd9f54ab0bff5848d60630bbcf77315a5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.15.0 pkginfo/1.7.0 requests/2.25.1 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.5.9
|