This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: all | |
gather_facts: false | |
vars: | |
secret_value: "Something secret" | |
tasks: | |
- name: task with stdout | |
command: 'echo {{ secret_value }}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# TOXENV=py27-ansible_stable tox -- -x -s --trace-config | |
... | |
=========================================================================================================================================================================== test session starts ============================================================================================================================================================================ | |
platform darwin -- Python 2.7.10, pytest-2.8.4, py-1.4.31, pluggy-0.3.1 | |
using: pytest-2.8.4 pylib-1.4.31 | |
setuptools registered plugins: | |
pytest-ansible-1.2.5 at /Users/jlaska/Projects/pytest-ansible.git/pytest_ansible/plugin.pyc | |
pytest-cov-2.2.0 at /Users/jlaska/Projects/pytest-ansible.git/.tox/py27-ansible_stable/lib/python2.7/site-packages/pytest_cov/plugin.pyc | |
active plugins: | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Traceback (most recent call last): | |
File "rax.py", line 420, in <module> | |
main() | |
File "rax.py", line 413, in main | |
_list(regions) | |
File "rax.py", line 280, in _list | |
metadata = vol.volume_image_metadata | |
File "/Users/jlaska/Downloads/VirtualEnvs/ansible/lib/python2.7/site-packages/pyrax/resource.py", line 92, in __getattr__ | |
"'%s'." % (self.__class__, key)) | |
AttributeError: '<class 'pyrax.cloudblockstorage.CloudBlockStorageVolume'>' object has no attribute 'volume_image_metadata'. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Traceback (most recent call last): | |
File "./plugins/inventory/rax.py", line 284, in <module> | |
main() | |
File "./plugins/inventory/rax.py", line 277, in main | |
_list(regions) | |
File "./plugins/inventory/rax.py", line 187, in _list | |
imagegroup = 'image-%s' % images[server.image['id']] | |
TypeError: string indices must be integers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pytest | |
@pytest.fixture(scope="function") | |
def user_one(request): | |
return dict(username="one", first_name="One", last_name="User", email="one@example.com") | |
@pytest.fixture(scope="function") | |
def user_two(request): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PLAY [A play with unicode: ¢ £ ¤ ¥] ******************************************* | |
GATHERING FACTS *************************************************************** | |
ok: [127.0.0.1] | |
TASK: [A task name with unicode: è é ê ë] ************************************* | |
ok: [127.0.0.1] => { | |
"msg": "hi there" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/tox.ini b/tox.ini | |
index fe8e1be..7f3f57b 100644 | |
--- a/tox.ini | |
+++ b/tox.ini | |
@@ -8,9 +8,10 @@ envlist = | |
[testenv] | |
setenv = | |
PYTHONPATH = {toxinidir}:{toxinidir}/lib/ | |
+ NOSETESTS = 'nosetests' | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/tests/requirements.txt b/tests/requirements.txt | |
index 0a6a42c..fb8f594 100644 | |
--- a/tests/requirements.txt | |
+++ b/tests/requirements.txt | |
@@ -1,5 +1,7 @@ | |
coverage>=3.7.1 | |
fauxquests>=1.1 | |
+nose | |
+nosexml | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import pytest | |
import yaml | |
from inflect import engine | |
# General purpose fixtures, typically defined elsewhere and included in a top-level conftest | |
@pytest.fixture(scope="class") | |
def organization(request): | |
return "organization" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PLAY [add 10 hosts to inventory] ********************************************** | |
GATHERING FACTS *************************************************************** | |
ok: [local] | |
TASK: [create inventory] ****************************************************** | |
ok: [local] => (item=0) | |
ok: [local] => (item=1) | |
ok: [local] => (item=2) |