Skip to main content

Functional testing tool

Project description

Refery

Refery is a functional test tool written in Python

Install

$ ./setup.py install

Usage

$ refery --help
usage: refery [-h] --exec EXEC --test-file TEST_FILE

options:
  -h, --help            show this help message and exit
  --exec EXEC           path to the tested executable
  --test-file TEST_FILE
                        path to the yaml test file

As you can see, refery takes two mandatory parameters:

  • The path to an executable file
  • The path to a YAML file describing the test suite. The content of this file is described in the next section

Writing tests

Test suites are described in a YAML file. Each test case is a YAML mapping accepting the following optional keys:

  • arg: YAML sequence containing the arguments passed to the executable
  • stdin: String passed a standard output
  • ref: Path to an executable with the desired behaviour
  • stdout: Expected standard output
  • stderr: Expected standard error
  • exit_code: Expected exit code
  • stdout_mode | stderr_mode: The testing mode of the standard output and error. Can be of two kinds:
    • strict:The actual value shall be the same as the expected value. This is the default mode
    • exists: If the expected value is not empty, the actual value shall not be empty and reciprocally
  • skipped: Boolean equals to true if the test case shall be ignored

If the ref is specified, it is used to test the standard output, standard error and exit code. If any of these fields is specified, its value is used instead of the ref.

For example, take the following test case:

hello:
  ref: bin/hello.sh
  exit_code: 0

The stdout and stderr are tested according to bin/hello.sh but the exit code must be equal to 0, not matter what is actually returned by bin/hello.sh.

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

refery-1.0.1.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

refery-1.0.1-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

Details for the file refery-1.0.1.tar.gz.

File metadata

  • Download URL: refery-1.0.1.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

File hashes

Hashes for refery-1.0.1.tar.gz
Algorithm Hash digest
SHA256 594250a45c2dfcc4f59467948276fcf3bbc322422ed69b71f8e591de174b4c51
MD5 48492754c814f19fc9361c8e01653bd1
BLAKE2b-256 ab134c5b11acb130f603eaa1b0f7d47c904490baf7119e6c1c17f412cf4257a7

See more details on using hashes here.

File details

Details for the file refery-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: refery-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 9.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

File hashes

Hashes for refery-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e326b4969953b19c10cd005cc906f89ca6c7107a66547fa1a123de6aa579b389
MD5 d7a05051c12d9f1e039b5f93181d6d80
BLAKE2b-256 af1bc670b4ae70c26e37c86630876cb5c8afc1ea8f8db83cfda7c8ee0f118061

See more details on using hashes here.

Supported by

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