Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove nailgun.entities imports in tests/foreman/endtoend #15083

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions tests/foreman/endtoend/test_api_endtoend.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

from deepdiff import DeepDiff
from fauxfactory import gen_string
from nailgun import client, entities
from nailgun import client
import pytest

from robottelo import constants
Expand Down Expand Up @@ -1006,39 +1006,41 @@ class TestEndToEnd:
def fake_manifest_is_set(self):
return setting_is_set('fake_manifest')

def test_positive_find_default_org(self):
def test_positive_find_default_org(self, class_target_sat):
"""Check if 'Default Organization' is present

:id: c6e45b36-d8b6-4507-8dcd-0645668496b9

:expectedresults: 'Default Organization' is found
"""
results = entities.Organization().search(
results = class_target_sat.api.Organization().search(
query={'search': f'name="{constants.DEFAULT_ORG}"'}
)
assert len(results) == 1
assert results[0].name == constants.DEFAULT_ORG

def test_positive_find_default_loc(self):
def test_positive_find_default_loc(self, class_target_sat):
"""Check if 'Default Location' is present

:id: 1f40b3c6-488d-4037-a7ab-250a02bf919a

:expectedresults: 'Default Location' is found
"""
results = entities.Location().search(query={'search': f'name="{constants.DEFAULT_LOC}"'})
results = class_target_sat.api.Location().search(
query={'search': f'name="{constants.DEFAULT_LOC}"'}
)
assert len(results) == 1
assert results[0].name == constants.DEFAULT_LOC

@pytest.mark.build_sanity
def test_positive_find_admin_user(self):
def test_positive_find_admin_user(self, class_target_sat):
"""Check if Admin User is present

:id: 892fdfcd-18c0-42ef-988b-f13a04097f5c

:expectedresults: Admin User is found and has Admin role
"""
results = entities.User().search(query={'search': 'login=admin'})
results = class_target_sat.api.User().search(query={'search': 'login=admin'})
assert len(results) == 1
assert results[0].login == 'admin'

Expand Down
Loading