flexible testing of nested objects
Project description
Work - in - progress
PySome
PySome
brings the expect(...).to_be(...)
syntax to python for
easier and clearer testing of nested objects
Example:
from pysome import Some
from pysome.Some import SomeList, SomePartialDict
from pysome.expect import expect
# some large nested api response you want to test
api_response = {
"menu": {
"tags": [
{"id": 1, "z-index": 12},
{"id": 2, "name": "ax7"},
{"id": 5, "name": "ax7", "z-index": 12},
{"id": 2, "alias": "iivz"},
]
}
}
# test only for needed stuff
expect(api_response).to_be({
"menu": {
"tags": SomeList(SomePartialDict({
"id": Some(int)
}))
}
})
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pysome-0.0.1.tar.gz
(4.7 kB
view hashes)
Built Distribution
pysome-0.0.1-py3-none-any.whl
(5.5 kB
view hashes)