Skip to main content

No project description provided

Project description

Behaviour Driven Development (BDD) testing library.

Rumex is trying to be more of a library rather than a framework. This approach aims to increase flexibility and reduce dependency on design choices made by designers of alternative frameworks.

Installation

pip install rumex

Basic example

import rumex

example_file = rumex.InputFile(
    text='''
        Name: Basic example

        Scenario: Simple arithmetics

            Given an integer 1
            And an integer 2
            When addition is performed
            Then the result is 3
    ''',
    uri='in place file, just an example',
)

steps = rumex.StepMapper()


class Context:

    def __init__(self):
        self.integers = []
        self.sum = None


@steps(r'an integer (\d+)')
def store_integer(integer: int, *, context: Context):
    context.integers.append(integer)


@steps(r'addition is performed')
def add(*, context: Context):
    context.sum = sum(context.integers)


@steps(r'the result is (\d+)')
def check_result(expected_result: int, *, context: Context):
    assert expected_result == context.sum


rumex.run(
    files=[example_file],
    steps=steps,
    context_maker=Context,
)

More examples

Perhaps the best way to discover Rumex’s fetures is to look at the examples:

docs/examples

API

For API documentation see docs/api

Some alternatives

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

rumex-0.6.1.tar.gz (14.8 kB view hashes)

Uploaded Source

Built Distribution

rumex-0.6.1-py3-none-any.whl (18.7 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