Functional testing for command line applications
Project description
Scruf is a functional testing framework for command line applications. It is heavily inspired by cram. This is currently early in development and while I aim to maintain the current interface breaking changes may occur.
usage: scruf [-h] [--no-cleanup] [-s SHELL] [-i INDENT] [-e ENV_FILE]
FILE [FILE ...]
positional arguments:
FILE File(s) to be tested
optional arguments:
-h, --help show this help message and exit
--no-cleanup Avoid cleaning up temporary test directory
-s SHELL, --shell SHELL
Path to shell to be used to run tests with. Default is
'/bin/sh'
-i INDENT, --indent INDENT
String to be used for detecting indentation when
parsing tests. Default is 4 spaces, use a literal '\t'
to denote a tab character
-e ENV_FILE, --env-file ENV_FILE
Name of config file to read environment variables from
--version show program's version number and exit
--strict Whether tests should be run in strict mode. In this
mode a test that does not check each line of output is
considered to have failed
Example test:
# in my_test.scf
# the following line is a test description
Verify 'cat' reads file contents
# Run some commands to setup environment
[SETUP]$ echo 'some text' > test.txt
[SETUP]$ echo '1234' >> test.txt
# The command to test (note indentation)
$ cat test.txt
some text
[RE] ^\d+$
Running:
scruf my_test.scf # Testing: my_test.scf 1..1 ok 1 - Verify 'cat' reads file contents
There are more examples under the examples/ directory in the source repo and in the documentation.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file scruf-0.4.1.tar.gz.
File metadata
- Download URL: scruf-0.4.1.tar.gz
- Upload date:
- Size: 13.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.9.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a4b9e747d62d1a32d018875bad5e5c752ca27a141d51403c225823c72ffed866
|
|
| MD5 |
0917fb15c7917eb804a8afd35aaa181f
|
|
| BLAKE2b-256 |
5520644c25684f73fe8f9ad799ad9202cbd3e01e26700bb4c90e49c0d68a79fe
|
File details
Details for the file scruf-0.4.1-py3-none-any.whl.
File metadata
- Download URL: scruf-0.4.1-py3-none-any.whl
- Upload date:
- Size: 28.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.9.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1446f7abe774040062532a7792cab4ad2f5760e76c1a94172bd0ff8a7d9c11ca
|
|
| MD5 |
03eb66cf7f4355828f4c9ab9ece482a7
|
|
| BLAKE2b-256 |
7078ad5ad9fc329be898afeffbf80b3be9d0935edc63df193060d0db81e24b45
|