Skip to main content

Scruf

pipeline status coverage report PyPI

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.

Metadata

Release files for scruf 0.4.1

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

Source distribution (sdist)

Source distribution for scruf 0.4.1
File Size Uploaded Provenance Actions
scruf-0.4.1.tar.gz 13.6 kB Without provenance Details for scruf-0.4.1.tar.gz

Built distribution (wheel)

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

Total release size: 41.6 kB

Release files / scruf-0.4.1.tar.gz

Download URL scruf-0.4.1.tar.gz
Size 13.6 kB
Tags Source
SHA-256 checksum
How to use checksums
a4b9e747d62d1a32d018875bad5e5c752ca27a141d51403c225823c72ffed866
BLAKE2b-256 checksum
How to use checksums
5520644c25684f73fe8f9ad799ad9202cbd3e01e26700bb4c90e49c0d68a79fe
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / scruf-0.4.1-py3-none-any.whl

Download URL scruf-0.4.1-py3-none-any.whl
Size 28.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1446f7abe774040062532a7792cab4ad2f5760e76c1a94172bd0ff8a7d9c11ca
BLAKE2b-256 checksum
How to use checksums
7078ad5ad9fc329be898afeffbf80b3be9d0935edc63df193060d0db81e24b45
Upload date
Uploaded using Trusted Publishing?
What is 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

Security for scruf 0.4.1

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.

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