clicheck

CLI acceptance testing based on output comparison


License
MIT
Install
pip install clicheck==0.1.0

Documentation

clicheck

Circle CI Build Status Build Status

CLI acceptance testing based on output comparison

Requirements

  • linux box
  • Python 2.6, 2.7 (python 3.x not supported)
  • argparse library
  • pyyaml library

Installation:

  • Either using pip directly for last stable version
    pip install clicheck

  • Or via github repository for latest version
    git clone https://github.com/sebbrochet/clicheck.git

  • cd into project directory
    cd clicheck

  • Install requirements with pip
    pip install -r requirements.txt

  • Install clicheck binary
    python setup.py install

Usage:

usage: clicheck [-h] [-s SCOPE] [-t TEST] [-u SUITE] [-w WAIT] [-c CONFIG]
                [-v]
                command

CLI acceptance testing based on output comparison.

positional arguments:
  command               Command to execute (check, run)

optional arguments:
  -h, --help            show this help message and exit
  -s SCOPE, --scope SCOPE
                        Limit command to act on scope defined in a file
  -t TEST, --test TEST  Specify the name of a specific test to test
  -u SUITE, --suite SUITE
                        Specify the name of the test suite to test
  -w WAIT, --wait WAIT  Time to wait in seconds between tests (default is 0)
  -c CONFIG, --config CONFIG
                        Configuration file to use
  -v, --version         Print program version and exit.

A test suite is described as a list of test defined in YAML format.
You may have a look on clicheck own acceptance tests made using clicheck (now that's meta!).

config format is one argument by line (i.e argname=value), argument names are the same ones than the CLI (scope, test, suite, wait). A line starting with a # is considered as comment and won't be interpreted. Don't put quotes between argument values

TEST DEFINITION:

Parameter required default type comments
name no "" string name of the test for documentation purpose or use with --scope or --test options
command yes string full command with arguments to execute
stdout no "" string or list of strings Text pattern or list of filenames with text patterns for comparison against STDOUT of command
stderr no "" string or list of strings Text pattern or list of filenames with text patterns for comparison against STDERR of command
wait no 0 positive int Number of seconds to wait after test execution

TESTS:

  • clicheck -u tests/clicheck_test_suite.yaml run