Generating test data structures
Project description
Your welcome <3
Description
Sgen is a tool for generating test data structures in Python.
from pprint import pprint
from sgen import Sgen, fields
class Pet(SGen):
name = fields.String()
class User(SGen):
name = fields.String()
pet = fields.Nested(Pet(), required=True)
def main():
datasets = list(User().positive())
pprint(datasets, indent=2)
if __name__ == '__main__':
main()
# [ {'name': None, 'pet': {'name': None}},
# {'name': None, 'pet': {}},
# {'name': None, 'pet': {'name': 'fszxSnf'}},
# {'pet': {'name': None}},
# {'pet': {}},
# {'pet': {'name': 'RzGTdNzhr'}},
# {'name': 'ttr', 'pet': {'name': None}},
# {'name': 'ttr', 'pet': {}},
# {'name': 'ttr', 'pet': {'name': 'ZpvMOyR'}}]
In short, SGen can be used to:
Generating positive data structures
Generating negative data structures
Checking the functionality of data validation at the application input
Get It Now
pip install sgen
Documentation
Full documentation is available at here
Requirements
Python >= 3.8
Project Links
License
MIT licensed.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
sgen-1.0.2.tar.gz
(12.6 kB
view hashes)
Built Distribution
sgen-1.0.2-py3-none-any.whl
(8.1 kB
view hashes)