diff --git a/.travis.yml b/.travis.yml index 73c331db8..d9a1c9365 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,5 +9,5 @@ install: - pip install ansible-lint pytest script: - if [[ -n $(grep --exclude-dir=.git -P "\xa0" -r .) ]]; then echo 'NBSP characters found'; exit 1; fi - - pytest -vvvv library/ plugins/ + - pytest -vvvv tests/library/ tests/plugins/filter/ - for i in $(ls -1 roles/); do ANSIBLE_LOG_PATH=/dev/null ansible-lint -x 204 -v roles/$i/; if [ $? -ne 0 ]; then exit 1; fi; done diff --git a/library/test_ceph_crush.py b/tests/library/test_ceph_crush.py similarity index 98% rename from library/test_ceph_crush.py rename to tests/library/test_ceph_crush.py index 7c46b4abb..becd7f88b 100644 --- a/library/test_ceph_crush.py +++ b/tests/library/test_ceph_crush.py @@ -1,4 +1,6 @@ -from . import ceph_crush +import sys +sys.path.append('./library') +import ceph_crush import pytest diff --git a/library/test_ceph_key.py b/tests/library/test_ceph_key.py similarity index 99% rename from library/test_ceph_key.py rename to tests/library/test_ceph_key.py index 3350e1a62..b06178e3a 100644 --- a/library/test_ceph_key.py +++ b/tests/library/test_ceph_key.py @@ -1,6 +1,8 @@ import json import os -from . import ceph_key +import sys +sys.path.append('./library') +import ceph_key import mock diff --git a/library/test_ceph_volume.py b/tests/library/test_ceph_volume.py similarity index 99% rename from library/test_ceph_volume.py rename to tests/library/test_ceph_volume.py index cf0d9ff64..1254c1c7a 100644 --- a/library/test_ceph_volume.py +++ b/tests/library/test_ceph_volume.py @@ -1,4 +1,6 @@ -from . import ceph_volume +import sys +sys.path.append('./library') +import ceph_volume import mock import os diff --git a/plugins/filter/test_ipaddrs_in_ranges.py b/tests/plugins/filter/test_ipaddrs_in_ranges.py similarity index 95% rename from plugins/filter/test_ipaddrs_in_ranges.py rename to tests/plugins/filter/test_ipaddrs_in_ranges.py index 3fb2135c0..6357d93b7 100644 --- a/plugins/filter/test_ipaddrs_in_ranges.py +++ b/tests/plugins/filter/test_ipaddrs_in_ranges.py @@ -1,4 +1,6 @@ -from . import ipaddrs_in_ranges +import sys +sys.path.append('./plugins/filter') +import ipaddrs_in_ranges filter_plugin = ipaddrs_in_ranges.FilterModule()