Skip to main content

A fixture generator based on type annotations.

Project description

https://img.shields.io/pypi/v/fistro.svg https://img.shields.io/pypi/pyversions/fistro.svg https://img.shields.io/circleci/project/github/kingoodie/fistro.svg https://codecov.io/gh/kingoodie/fistro/branch/master/graph/badge.svg

A fixture generator based on type annotations.

Examples

>>> from dataclasses import dataclass
>>> from datetime import datetime, date
>>>
>>> from fistro.fistro import generate
>>>
>>>
>>> @dataclass
>>> class Employee:
>>>     id: int
>>>     birthday: date
>>>     last_access: datetime
>>>     password: str
>>>     name: str = 'Carlos Sánchez'
>>>
>>>
>>> employee = generate(Employee)()
>>> print(employee)

It will show something like this:

>>> Employee(id=7621035066, name='Carlos Sánchez', birthday=datetime.date(259, 2, 21), last_access=datetime.datetime(2190, 11, 7, 7, 3, 20), password=":F'5nr\x0ch~")

Installation

>>> pip install fistro

Credits

In memoriam of Chiquito de la Calzada.

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

fistro-0.2.0.tar.gz (5.2 kB view hashes)

Uploaded Source

Built Distribution

fistro-0.2.0-py3-none-any.whl (13.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page