Skip to content
/ sgen Public

Sgen is a tool for generating test data structures in Python.

Notifications You must be signed in to change notification settings

Apels1nA/sgen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SGen

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.

About

Sgen is a tool for generating test data structures in Python.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages