Skip to content
This repository has been archived by the owner on Apr 7, 2022. It is now read-only.

Commit

Permalink
[1LP][RFR] fixed finalizer cleanup for test_tagvis_infra_object (#8154)
Browse files Browse the repository at this point in the history
* fixed finalizer cleanup for test_tagvis_infra_object

* fixed check_item_visibility for hosts
  • Loading branch information
lina-is-here authored and izapolsk committed Nov 21, 2018
1 parent 33e27ee commit 26be371
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions cfme/fixtures/tag.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import pytest

from cfme.base.credential import Credential
from cfme.infrastructure.host import Host
from cfme.utils.appliance.implementations.ui import navigate_to
from cfme.utils.blockers import BZ
from cfme.utils.log import logger
Expand Down Expand Up @@ -119,6 +120,10 @@ def _check_item_visibility(vis_object, vis_expect):
vis_object.remove_tag(tag=tag)
with user_restricted:
try:
if isinstance(vis_object, Host):
# need to remove the link to the provider from the host,
# so the navigation goes Compute -> Infrastructure -> Hosts, not Providers
vis_object.parent.filters.update({'provider': None})
navigate_to(vis_object, 'Details')
actual_visibility = True
except Exception:
Expand Down
2 changes: 1 addition & 1 deletion cfme/tests/cloud_infra_common/test_tag_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,4 +147,4 @@ def test_tagvis_infra_object(infra_test_item, check_item_visibility, visibility,
4. Login as restricted user, iten is not visible for user
"""
check_item_visibility(infra_test_item, visibility)
request.addfinalizer(lambda: tag_cleanup(cloud_test_item, tag))
request.addfinalizer(lambda: tag_cleanup(infra_test_item, tag))

0 comments on commit 26be371

Please sign in to comment.