cmdtest is a simple way to test command line programs.
from cmdtest import Program, File
cat = Program('cat')
@cat.test
def cat_should_echo_single_file():
assert cat(File('hello')).out == 'hello'
@cat.test
def cat_should_combine_files():
assert cat(File('hello'), File('world')).out == 'helloworld'
if __name__ == '__main__':
cat.run()
Installation
Available from PyPI with either pip or easy_install:
$ pip install cmdtest
$ easy_install cmdtest
This will also pull in the Attest dependencies.
Release files for cmdtest 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| cmdtest-0.1.1.tar.gz | 2.1 kB | Details |
Release files / cmdtest-0.1.1.tar.gz
| Download URL | cmdtest-0.1.1.tar.gz |
|---|---|
| Size | 2.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7ba8ea75d2c5ba84608dbec41a597f7181ef5e4c4fb01351238dd64c41e43614
|
|
BLAKE2b-256 checksum How to use checksums |
abe2ab4391add273dde21aeb95398737c0a005265199b3aa5e50454e81e54a8a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |