mirror of
https://github.com/ansible/awx.git
synced 2024-11-01 08:21:15 +03:00
move awx.main.utils.ansible tests data into the correct location
This commit is contained in:
parent
5cdab1b57a
commit
88eaf1154a
@ -1,32 +0,0 @@
|
||||
import os
|
||||
import os.path
|
||||
|
||||
import pytest
|
||||
|
||||
from awx.main.utils.ansible import could_be_playbook, could_be_inventory
|
||||
|
||||
HERE, _ = os.path.split(__file__)
|
||||
|
||||
|
||||
@pytest.mark.parametrize('filename', os.listdir(os.path.join(HERE, 'playbooks', 'valid')))
|
||||
def test_could_be_playbook(filename):
|
||||
path = os.path.join(HERE, 'playbooks', 'valid')
|
||||
assert could_be_playbook(HERE, path, filename).endswith(filename)
|
||||
|
||||
|
||||
@pytest.mark.parametrize('filename', os.listdir(os.path.join(HERE, 'playbooks', 'invalid')))
|
||||
def test_is_not_playbook(filename):
|
||||
path = os.path.join(HERE, 'playbooks', 'invalid')
|
||||
assert could_be_playbook(HERE, path, filename) is None
|
||||
|
||||
|
||||
@pytest.mark.parametrize('filename', os.listdir(os.path.join(HERE, 'inventories', 'valid')))
|
||||
def test_could_be_inventory(filename):
|
||||
path = os.path.join(HERE, 'inventories', 'valid')
|
||||
assert could_be_inventory(HERE, path, filename).endswith(filename)
|
||||
|
||||
|
||||
@pytest.mark.parametrize('filename', os.listdir(os.path.join(HERE, 'inventories', 'invalid')))
|
||||
def test_is_not_inventory(filename):
|
||||
path = os.path.join(HERE, 'inventories', 'invalid')
|
||||
assert could_be_inventory(HERE, path, filename) is None
|
33
awx/main/tests/unit/utils/test_ansible.py
Normal file
33
awx/main/tests/unit/utils/test_ansible.py
Normal file
@ -0,0 +1,33 @@
|
||||
import os
|
||||
import os.path
|
||||
|
||||
import pytest
|
||||
|
||||
from awx.main.tests import data
|
||||
from awx.main.utils.ansible import could_be_playbook, could_be_inventory
|
||||
|
||||
DATA = os.path.join(os.path.dirname(data.__file__), 'ansible_utils')
|
||||
|
||||
|
||||
@pytest.mark.parametrize('filename', os.listdir(os.path.join(DATA, 'playbooks', 'valid')))
|
||||
def test_could_be_playbook(filename):
|
||||
path = os.path.join(DATA, 'playbooks', 'valid')
|
||||
assert could_be_playbook(DATA, path, filename).endswith(filename)
|
||||
|
||||
|
||||
@pytest.mark.parametrize('filename', os.listdir(os.path.join(DATA, 'playbooks', 'invalid')))
|
||||
def test_is_not_playbook(filename):
|
||||
path = os.path.join(DATA, 'playbooks', 'invalid')
|
||||
assert could_be_playbook(DATA, path, filename) is None
|
||||
|
||||
|
||||
@pytest.mark.parametrize('filename', os.listdir(os.path.join(DATA, 'inventories', 'valid')))
|
||||
def test_could_be_inventory(filename):
|
||||
path = os.path.join(DATA, 'inventories', 'valid')
|
||||
assert could_be_inventory(DATA, path, filename).endswith(filename)
|
||||
|
||||
|
||||
@pytest.mark.parametrize('filename', os.listdir(os.path.join(DATA, 'inventories', 'invalid')))
|
||||
def test_is_not_inventory(filename):
|
||||
path = os.path.join(DATA, 'inventories', 'invalid')
|
||||
assert could_be_inventory(DATA, path, filename) is None
|
Loading…
Reference in New Issue
Block a user