Switch to tox
This commit is contained in:
parent
d34fd49278
commit
5c338fda5e
|
@ -1,5 +1,5 @@
|
||||||
.*.swp
|
.*.swp
|
||||||
.env
|
.tox
|
||||||
*.pyc
|
*.pyc
|
||||||
build/
|
build/
|
||||||
dist/
|
dist/
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
language: python
|
language: python
|
||||||
python:
|
python:
|
||||||
- "2.7"
|
- "2.7"
|
||||||
install: make test_env
|
script: tox -e py27
|
||||||
script: make test
|
|
||||||
|
|
19
README.rst
19
README.rst
|
@ -75,20 +75,27 @@ Run as ``root``::
|
||||||
Developing
|
Developing
|
||||||
~~~~~~~~~~
|
~~~~~~~~~~
|
||||||
|
|
||||||
Checkout and create an environment::
|
First of all, install *tox* utility. It's likely to be in your distribution
|
||||||
|
repositories under name of ``python-tox``. Alternatively, you can install it
|
||||||
|
from PyPI.
|
||||||
|
|
||||||
|
Next checkout and create environments::
|
||||||
|
|
||||||
git clone https://github.com/Divius/ironic-discoverd.git
|
git clone https://github.com/Divius/ironic-discoverd.git
|
||||||
cd ironic-discoverd
|
cd ironic-discoverd
|
||||||
make test_env
|
tox
|
||||||
|
|
||||||
Run test suite::
|
Repeat *tox* command each time you need to run tests. If you don't have Python
|
||||||
|
interpreter of one of supported versions (currently 2.6, 2.7 and 3.3), use
|
||||||
|
``-e`` flag to select only some environments, e.g.
|
||||||
|
|
||||||
make test
|
::
|
||||||
|
|
||||||
|
tox -e py27
|
||||||
|
|
||||||
Install and run::
|
Install and run::
|
||||||
|
|
||||||
source .env/bin/activate
|
source .tox/py27/bin/activate
|
||||||
python setup.py develop
|
|
||||||
ironic-discoverd example.conf
|
ironic-discoverd example.conf
|
||||||
|
|
||||||
Of course you may have to modify ``example.conf`` to match your OpenStack
|
Of course you may have to modify ``example.conf`` to match your OpenStack
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
from ironicclient import exceptions
|
from ironicclient import exceptions
|
||||||
|
@ -115,3 +117,7 @@ class TestDiscover(unittest.TestCase):
|
||||||
cli.node.update.assert_any_call('uuid1', patch)
|
cli.node.update.assert_any_call('uuid1', patch)
|
||||||
cli.node.update.assert_any_call('uuid3', patch)
|
cli.node.update.assert_any_call('uuid3', patch)
|
||||||
self.assertEqual(2, cli.node.update.call_count)
|
self.assertEqual(2, cli.node.update.call_count)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
unittest.main()
|
||||||
|
|
Loading…
Reference in New Issue