Skip to main content

Python test by send / expect.

Project description

Python test drive utility

A nifty utility to test things.

The test case file drives a send / expect engine. The expect is then evaluated and the result is printed in a green colored 'OK' or a red colored 'ERR'.

./testvdrive.py testcase.txt

If you installed from pip, use:

testvdrive testcase.txt

The test case file contains the test instructions, one line per test. The format:

#   Context_string  Send_string     Expect_string   Find/Compare
#   --------------  -----------     -------------   ------------
#    for the user   what to test    what to expect  True if Find

Example test cases:

[ "Echo Command", "", "", True],                # NOOP
[ "Test ls", "ls", "Make", True],               # Do we have a Make file
[ "DF command", "df", "blocks", "regex" ],      # Search regex
[ "DF mregex", "df", ".*blo",  "mregex" ],      # Match regex

The output of example test cases (colored in terminal):

Echo Command     	 OK
Test ls          	 OK
DF command       	 OK
DF mregex        	 OK

// EOF

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

testvdrive-1.2.0.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

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

testvdrive-1.2.0-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file testvdrive-1.2.0.tar.gz.

File metadata

  • Download URL: testvdrive-1.2.0.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for testvdrive-1.2.0.tar.gz
Algorithm Hash digest
SHA256 f8fe1534ab18a26793c466acd4fcb12df7a5595d51d580cd14dd8550cd1138db
MD5 4e61071dbb4270df7e36959737d67342
BLAKE2b-256 a7c7b45829945ccf02838f190229be87e3dc8ecb7c7674d56b1ab3e99ec10430

See more details on using hashes here.

File details

Details for the file testvdrive-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: testvdrive-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for testvdrive-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5528ea90bae0da272a0ac737bf300849047fa8a2284c504ffba80b64eb1f2555
MD5 7b7d1d0021f83721cc7987abeb0c18d4
BLAKE2b-256 7e0a3a00cc3d20761375f211ddd5a0f83b14c4d1ede6e6b0efd509539db1f91c

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