Skip to main content

Wheatly

About

Wheatly is an approach to developing integration tests in a more natural way. While some technical knowledge is still required, this framework aims to allow for tests to be written using more of a natural language approach while still allowing for the flexibility needed to create robust tests.

Usage

Create some directory you want to store you plugins in (see the plugins directory for examples). The only required plugin is a config.py file which takes the following form:

lexicon = {
    'model': {
        'class': "Model",
        'tokens': [
            'model',
            'models',
        ],
        'actions': {
            'get': [
                'get',
                'gets',
                'getting',
                'got'
            ],
            'delete': [
                'delete',
                'deleted',
                'deleting',
                'deletes'
            ]
        },
        'modifiers': {}
    }
}

Each object in the lexicon variable should correspond to a same name file within the same plugin directory. Each of these files will represent some sort of object you want to work with (or an object to encapsulate various actions). They should take this form (notice that the name of the class matches the lexicon's class field):

import config
import wheatly.utils as utils

class Model:
    def __init__(self):
        self.name = 'model'
        self.tokens = config.lexicon[self.name]['tokens']
        self.actions = config.lexicon[self.name]['actions']
        self.modifiers = config.lexicon[self.name]['modifiers']

    def action_get(self, context, logger, args={}, modifiers=[]):
        # perform get actions for this object
        print('get!')
        # return modified context and success or fail
        return context, True

    def action_delete(self, context, logger, args={}, modifiers=[]):
        # perform delete actions for this object 
        print('delete!')
        # return modified context and success or fail
        return context, True

    def __str__(self):
        return f'{self.name}()'

    def __repr__(self):
        return f'{self.name}()'

After writing any modules you want to use, create a test file with the following form:

tests:
  example:
    # Execute some HTTP request
    - curl:
        host: https://pypi.org
        path: project/calligraphy-scripting
        method: get
        # Set this to a dictionary if you want to send some JSON data alone with the request
        data: ~
        response_type: html
    # Execute a wait with the duration in seconds
    - wait: 5
    # Text of what to do
    - get a model:
        # Optional dictionary for any arguments you want to pass along
        foo: bar

Currently you can use curl and wait to run custom globally available actions. You can also write natural language actions which Wheatly will parse and run via the plugins you wrote.

To run your test, first generate the test JSON via:

python src/main.py generate -p ./plugins -i examples/example.yaml -o examples/example.json

You can then run the generated test JSON via:

python src/main.py run -p ./plugins -i examples/example.json

TODO:

  • Add summary command

Metadata

Release files for wheatly 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for wheatly 0.1.0
File Size Uploaded Provenance Actions
wheatly-0.1.0.tar.gz 8.3 kB Without provenance Details for wheatly-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for wheatly 0.1.0
File Interpreter ABI Platform Actions
wheatly-0.1.0-py3-none-any.whl Python 3 none any Details for wheatly-0.1.0-py3-none-any.whl

Total release size: 17.4 kB

Release files / wheatly-0.1.0.tar.gz

Download URL wheatly-0.1.0.tar.gz
Size 8.3 kB
Tags Source
SHA-256 checksum
How to use checksums
1ea23fbe7f4086a1c2c758ccb2de48d7b4a1eedc43afe02d314d8db305db693a
BLAKE2b-256 checksum
How to use checksums
efb113cdb8744071aa97fc4d6530a01f2e5774eaaf22cf854738832a75d20312
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.4.2 CPython/3.10.0 Linux/5.15.90.1-microsoft-standard-WSL2

Release files / wheatly-0.1.0-py3-none-any.whl

Download URL wheatly-0.1.0-py3-none-any.whl
Size 9.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7703ab24c9c796217993501229a3e85f7649951b1a05310d7259aa76608391c7
BLAKE2b-256 checksum
How to use checksums
0f1d009b10c1dc3751d802bdb39154e01afd3080dec70092ab8ae5edd4484251
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.4.2 CPython/3.10.0 Linux/5.15.90.1-microsoft-standard-WSL2

Security for wheatly 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page