add back in support of towervars lost in merge

This commit is contained in:
AlanCoding
2017-12-13 14:28:04 -05:00
parent bd91e8eb54
commit 1b0bca8229
3 changed files with 29 additions and 2 deletions

View File

@@ -13,6 +13,28 @@ from awx.main.models import (
from awx.main.utils.filters import SmartFilter
@pytest.mark.django_db
class TestInventoryScript:
def test_hostvars(self, inventory):
inventory.hosts.create(name='ahost', variables={"foo": "bar"})
assert inventory.get_script_data(
hostvars=True
)['_meta']['hostvars']['ahost'] == {
'foo': 'bar'
}
def test_towervars(self, inventory):
host = inventory.hosts.create(name='ahost')
assert inventory.get_script_data(
hostvars=True,
towervars=True
)['_meta']['hostvars']['ahost'] == {
'remote_tower_enabled': 'true',
'remote_tower_id': host.id
}
@pytest.mark.django_db
class TestSCMUpdateFeatures: