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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sgen-1.0.2.tar.gz.
File metadata
- Download URL: sgen-1.0.2.tar.gz
- Upload date:
- Size: 12.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
550371f2b7541093f52d9329cd0a6169bf7bfb94b3e49a7cc88b5d4874a0c1ba
|
|
| MD5 |
b82cb27efa9c18e752b1d59705586258
|
|
| BLAKE2b-256 |
4cbfcf992328245f8bd3df26c35a9e863b049b54cc12e2e835d08501ac65bdf5
|
File details
Details for the file sgen-1.0.2-py3-none-any.whl.
File metadata
- Download URL: sgen-1.0.2-py3-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a3131ebc1d6823a1265341e0c7ab46d7ee863ec99b5ca04cbbc123cf99b98f68
|
|
| MD5 |
e1b4c7f25d03e51558f7bb77d15b6814
|
|
| BLAKE2b-256 |
33fb03ab9dc40f894b4c56a004d40972b4da865320269047fb549b7bff869640
|