mirror of
https://github.com/ansible/awx.git
synced 2026-04-09 03:59:21 -02:30
Fix migration issues, tests, and templates
This commit is contained in:
@@ -9,7 +9,6 @@ from awx.api.views import (
|
||||
JobTemplateLabelList,
|
||||
JobTemplateSurveySpec,
|
||||
InventoryInventorySourcesUpdate,
|
||||
InventoryHostsList,
|
||||
HostInsights,
|
||||
)
|
||||
|
||||
@@ -17,8 +16,6 @@ from awx.main.models import (
|
||||
Host,
|
||||
)
|
||||
|
||||
from awx.main.managers import HostManager
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def mock_response_new(mocker):
|
||||
@@ -223,17 +220,3 @@ class TestHostInsights():
|
||||
|
||||
assert resp.data['error'] == 'The Insights Credential for "inventory_name_here" was not found.'
|
||||
assert resp.status_code == 404
|
||||
|
||||
|
||||
class TestInventoryHostsList(object):
|
||||
|
||||
def test_host_list_smart_inventory(self, mocker):
|
||||
Inventory = namedtuple('Inventory', ['kind', 'host_filter', 'hosts', 'organization_id'])
|
||||
obj = Inventory(kind='smart', host_filter='localhost', hosts=HostManager(), organization_id=None)
|
||||
obj.hosts.instance = obj
|
||||
|
||||
with mock.patch.object(InventoryHostsList, 'get_parent_object', return_value=obj):
|
||||
with mock.patch('awx.main.utils.filters.SmartFilter.query_from_string') as mock_query:
|
||||
view = InventoryHostsList()
|
||||
view.get_queryset()
|
||||
mock_query.assert_called_once_with('localhost')
|
||||
|
||||
Reference in New Issue
Block a user