A wrapper to make writing functional / regression / acceptance black-box tests easier. Tasty functional testing.
This wrapper provides you a way to write readable functional tests for command line applications in very simple way. This is an automation toolkit with a clean, well-designed and consistent interface. It provides a core of commonly used functionalities for testing command line applications.
- 2.6
- 2.7
- 3.3
- 3.4
- 3.5
- 3.6
- PyPy
import os
import sys
from funtest import FunctionalTestRunner
folder = os.path.dirname(os.path.abspath(sys.argv[0]))
new_folder1 = os.path.join(folder, 'new_folder1')
ftr = FunctionalTestRunner(new_folder1)
assert ftr.get_cwd() == new_folder1
ftr.mkdir('new_folder2')
with ftr.cd('new_folder2'):
new_folder2 = os.path.join(new_folder1, 'new_folder2')
assert ftr.get_cwd() == new_folder2
ftr.rmtree()
assert ftr.get_cwd() == new_folder1
output = ftr.run('ipconfig')
assert 'DNS Suffix' in output
You can easily use this wrapper to build your test scenarios within some python testing framework (e.g. pytest, nose, unittest or any other) or even python BDD framework (e.g. behave, lettuce, freshen or any other).
MIT licensed library. See LICENSE for details.
If you have suggestions for improving the funtest, please open an issue or pull request on GitHub.