diff options
author | Radostin Stoyanov <rstoyanov1@gmail.com> | 2017-07-24 09:14:02 +0100 |
---|---|---|
committer | Radostin Stoyanov <rstoyanov1@gmail.com> | 2017-07-24 14:58:37 +0100 |
commit | 2b9dbe2547935f96b165e7f7d67e1af481bada40 (patch) | |
tree | 8c77706474ebc169015f9a6def786fff0d19b96e | |
parent | e92b724289120c262c635e6005703477ebaa3fe0 (diff) | |
download | virt-bootstrap.git-2b9dbe2547935f96b165e7f7d67e1af481bada40.tar.gz virt-bootstrap.git-2b9dbe2547935f96b165e7f7d67e1af481bada40.tar.xz virt-bootstrap.git-2b9dbe2547935f96b165e7f7d67e1af481bada40.zip |
tests: Add test suite
-rw-r--r-- | README.md | 12 | ||||
-rwxr-xr-x | setup.py | 5 | ||||
-rw-r--r-- | tests/__init__.py | 0 |
3 files changed, 16 insertions, 1 deletions
@@ -21,3 +21,15 @@ use the run script. For example to run virt-bootstrap, use a command like the following one: ./run src/virtBootstrap/virt_bootstrap.py --help + +The following commands will be useful for anyone writing patches: + + ./setup.py test # Run local unit test suite + ./setup.py pylint # Run a pylint script against the codebase + +Any patches shouldn't change the output of 'test' or 'pylint'. The 'pylint' requires `pylint` and `pycodestyle` to be installed. + +If [coverage](https://pypi.python.org/pypi/coverage/) is installed, you can generate report using: + + coverage run --source=virtBootstrap ./setup.py test + coverage report @@ -50,7 +50,7 @@ class CheckPylint(Command): """ res = 0 - files = ' '.join(["setup.py", "src/virtBootstrap/*.py"]) + files = ' '.join(["setup.py", "src/virtBootstrap/*.py", "tests/*.py"]) output_format = "colorized" if sys.stdout.isatty() else "text" print(">>> Running pycodestyle ...") @@ -82,6 +82,7 @@ setup( keywords='virtualization container rootfs', package_dir={"": "src"}, packages=['virtBootstrap'], + test_suite='tests', entry_points={ 'console_scripts': [ 'virt-bootstrap=virtBootstrap.virt_bootstrap:main', @@ -117,6 +118,8 @@ setup( # root password for root file system. install_requires=['passlib>=1.6.1'], + tests_require=['mock>=2.0'], + extras_require={ 'dev': [ 'pylint', diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tests/__init__.py |