1
0
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:
Ryan Petrello 2019-01-25 11:11:12 -05:00
parent 5cdab1b57a
commit 88eaf1154a
No known key found for this signature in database
GPG Key ID: F2AA5F2122351777
19 changed files with 33 additions and 32 deletions

View File

@ -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

View 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