mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Web UI integration tests: PEP8 fixes
Tests modified to comply with PEP8 rules with exception of rule E501 (long lines). Done by autopep8 tool and 2 manual modifications. https://fedorahosted.org/freeipa/ticket/3744
This commit is contained in:
parent
8a3d8aeca3
commit
6ec5e5fec6
@ -34,18 +34,6 @@ USER_GROUP_DATA = {
|
||||
],
|
||||
'mod': [
|
||||
('textarea', 'description', 'user group rule description'),
|
||||
#(
|
||||
#'add_table_record',
|
||||
#'automemberinclusiveregex',
|
||||
#(
|
||||
#'table-widget',
|
||||
#{
|
||||
#'fields': [
|
||||
#('textbox', 'automemberinclusiveregex', 'testregex')
|
||||
#]
|
||||
#},
|
||||
#)
|
||||
#)
|
||||
],
|
||||
}
|
||||
|
||||
@ -59,6 +47,7 @@ HOST_GROUP_DATA = {
|
||||
],
|
||||
}
|
||||
|
||||
|
||||
class test_automember(UI_driver):
|
||||
|
||||
def test_crud(self):
|
||||
|
@ -59,6 +59,7 @@ KEY_DATA = {
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
class test_automount(UI_driver):
|
||||
|
||||
def test_crud(self):
|
||||
|
@ -25,6 +25,7 @@ from ipatests.test_webui.ui_driver import UI_driver
|
||||
|
||||
ENTITY = 'cert'
|
||||
|
||||
|
||||
class test_cert(UI_driver):
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
@ -33,7 +34,6 @@ class test_cert(UI_driver):
|
||||
if not self.has_ca():
|
||||
self.skip('CA not configured')
|
||||
|
||||
|
||||
def test_read(self):
|
||||
"""
|
||||
Basic read: cert
|
||||
|
@ -39,6 +39,7 @@ DATA2 = {
|
||||
],
|
||||
}
|
||||
|
||||
|
||||
class test_config(UI_driver):
|
||||
|
||||
def test_mod(self):
|
||||
|
@ -40,8 +40,8 @@ DATA = {
|
||||
],
|
||||
}
|
||||
|
||||
class test_delegation(UI_driver):
|
||||
|
||||
class test_delegation(UI_driver):
|
||||
|
||||
def test_crud(self):
|
||||
"""
|
||||
|
@ -66,6 +66,7 @@ CONFIG_MOD_DATA = {
|
||||
],
|
||||
}
|
||||
|
||||
|
||||
class test_dns(UI_driver):
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
@ -97,7 +98,6 @@ class test_dns(UI_driver):
|
||||
self.navigate_by_breadcrumb("DNS Zones")
|
||||
self.delete_record(ZONE_PKEY)
|
||||
|
||||
|
||||
def test_config_crud(self):
|
||||
"""
|
||||
Basic CRUD: dnsconfig
|
||||
|
@ -153,7 +153,6 @@ class test_group(UI_driver):
|
||||
self.add_associations([group.PKEY], 'member_group')
|
||||
self.add_associations([group.PKEY5], 'memberof_group')
|
||||
|
||||
|
||||
self.add_record(netgroup.ENTITY, netgroup.DATA)
|
||||
self.navigate_to_record(netgroup.PKEY)
|
||||
self.add_table_associations('memberuser_group', [group.PKEY4])
|
||||
|
@ -30,6 +30,7 @@ import ipatests.test_webui.data_sudo as sudo
|
||||
|
||||
ENTITY = 'host'
|
||||
|
||||
|
||||
class host_tasks(UI_driver):
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
|
@ -29,6 +29,7 @@ import ipatests.test_webui.data_hbac as hbac
|
||||
import ipatests.test_webui.test_rbac as rbac
|
||||
import ipatests.test_webui.data_sudo as sudo
|
||||
|
||||
|
||||
class test_hostgroup(UI_driver):
|
||||
|
||||
def test_crud(self):
|
||||
@ -111,7 +112,6 @@ class test_hostgroup(UI_driver):
|
||||
self.add_associations([hostgroup.PKEY], 'member_hostgroup')
|
||||
self.add_associations([hostgroup.PKEY5], 'memberof_hostgroup')
|
||||
|
||||
|
||||
self.add_record(hbac.RULE_ENTITY, hbac.RULE_DATA)
|
||||
self.navigate_to_record(hbac.RULE_PKEY)
|
||||
self.add_table_associations('memberhost_hostgroup', [hostgroup.PKEY4])
|
||||
|
@ -39,6 +39,7 @@ DATA2 = {
|
||||
],
|
||||
}
|
||||
|
||||
|
||||
class test_krbtpolicy(UI_driver):
|
||||
|
||||
def test_mod(self):
|
||||
|
@ -60,6 +60,7 @@ ENTITIES = [
|
||||
# TODO: add conditional
|
||||
]
|
||||
|
||||
|
||||
class test_navigation(UI_driver):
|
||||
|
||||
def test_url_navigation(self):
|
||||
@ -139,7 +140,6 @@ class test_navigation(UI_driver):
|
||||
self.navigate_by_menu('ipaserver/trusts/trustconfig', False)
|
||||
self.navigate_by_menu('ipaserver/config', False)
|
||||
|
||||
|
||||
def assert_e_url(self, url, e):
|
||||
"""
|
||||
Assert correct url for entity
|
||||
|
@ -42,6 +42,7 @@ DATA = {
|
||||
],
|
||||
}
|
||||
|
||||
|
||||
class test_pwpolicy(UI_driver):
|
||||
|
||||
def test_crud(self):
|
||||
|
@ -26,6 +26,7 @@ from ipatests.test_webui.ui_driver import UI_driver
|
||||
ENTITY = 'idrange'
|
||||
PKEY = 'itest-range'
|
||||
|
||||
|
||||
class test_range(UI_driver):
|
||||
|
||||
def get_shifts(self, idranges=None):
|
||||
|
@ -65,6 +65,7 @@ PERMISSION_DATA = {
|
||||
],
|
||||
}
|
||||
|
||||
|
||||
class test_rbac(UI_driver):
|
||||
|
||||
def test_crud(self):
|
||||
|
@ -25,6 +25,7 @@ from ipatests.test_webui.ui_driver import UI_driver
|
||||
|
||||
ENTITY = 'realmdomains'
|
||||
|
||||
|
||||
class test_realmdomains(UI_driver):
|
||||
|
||||
def test_read(self):
|
||||
|
@ -37,8 +37,8 @@ DATA = {
|
||||
],
|
||||
}
|
||||
|
||||
class test_selfservice(UI_driver):
|
||||
|
||||
class test_selfservice(UI_driver):
|
||||
|
||||
def test_crud(self):
|
||||
"""
|
||||
|
@ -40,6 +40,7 @@ DATA = {
|
||||
],
|
||||
}
|
||||
|
||||
|
||||
class test_selinuxusermap(UI_driver):
|
||||
|
||||
def test_crud(self):
|
||||
|
@ -25,6 +25,7 @@ from ipatests.test_webui.ui_driver import UI_driver
|
||||
|
||||
ENTITY = 'service'
|
||||
|
||||
|
||||
class sevice_tasks(UI_driver):
|
||||
|
||||
def prep_data(self):
|
||||
|
@ -29,6 +29,7 @@ import ipatests.test_webui.data_group as group
|
||||
import ipatests.test_webui.data_hostgroup as hostgroup
|
||||
from ipatests.test_webui.test_host import host_tasks, ENTITY as HOST_ENTITY
|
||||
|
||||
|
||||
class test_sudo(UI_driver):
|
||||
|
||||
def test_crud(self):
|
||||
|
@ -29,6 +29,7 @@ import ipatests.test_webui.data_hbac as hbac
|
||||
import ipatests.test_webui.test_rbac as rbac
|
||||
import ipatests.test_webui.data_sudo as sudo
|
||||
|
||||
|
||||
class test_user(UI_driver):
|
||||
|
||||
def test_crud(self):
|
||||
@ -128,7 +129,6 @@ class test_user(UI_driver):
|
||||
self.delete(hbac.RULE_ENTITY, [hbac.RULE_DATA])
|
||||
self.delete(sudo.RULE_ENTITY, [sudo.RULE_DATA])
|
||||
|
||||
|
||||
def test_actions(self):
|
||||
"""
|
||||
Test user actions
|
||||
|
@ -75,6 +75,7 @@ DEFAULT_BROWSER = 'firefox'
|
||||
DEFAULT_PORT = 4444
|
||||
DEFAULT_TYPE = 'local'
|
||||
|
||||
|
||||
class UI_driver(object):
|
||||
"""
|
||||
Base class for all UI integration tests
|
||||
@ -129,7 +130,6 @@ class UI_driver(object):
|
||||
if 'type' not in c:
|
||||
c['type'] = DEFAULT_TYPE
|
||||
|
||||
|
||||
def setUp(self):
|
||||
"""
|
||||
Test setup
|
||||
@ -288,7 +288,6 @@ class UI_driver(object):
|
||||
"""
|
||||
return "contains(concat(' ',normalize-space(@%s), ' '),' %s ')" % (attr, val)
|
||||
|
||||
|
||||
def init_app(self):
|
||||
"""
|
||||
Load and login
|
||||
@ -432,11 +431,13 @@ class UI_driver(object):
|
||||
|
||||
# get facet title
|
||||
el = self.find(".facet-header h3 *:first-child", By.CSS_SELECTOR, facet)
|
||||
if el: info["title"] = el.text
|
||||
if el:
|
||||
info["title"] = el.text
|
||||
|
||||
# get facet pkey
|
||||
el = self.find(".facet-header h3 span.facet-pkey", By.CSS_SELECTOR, facet)
|
||||
if el: info["pkey"] = el.text
|
||||
if el:
|
||||
info["pkey"] = el.text
|
||||
|
||||
return info
|
||||
|
||||
@ -677,7 +678,6 @@ class UI_driver(object):
|
||||
else:
|
||||
self.del_multivalued(name, value, parent)
|
||||
|
||||
|
||||
def check_option(self, name, value=None, parent=None):
|
||||
"""
|
||||
Find checkbox or radio with name which matches ^NAME\d$
|
||||
@ -901,7 +901,6 @@ class UI_driver(object):
|
||||
self.wait_for_request(n=2)
|
||||
self.wait()
|
||||
|
||||
|
||||
def delete(self, entity, data_list, facet='search', navigate=True):
|
||||
"""
|
||||
Delete entity records:
|
||||
@ -999,7 +998,6 @@ class UI_driver(object):
|
||||
|
||||
assert valid, "Values don't match. Expected: '%s', Got: '%s'" % (expected, actual)
|
||||
|
||||
|
||||
def find_record(self, entity, data, facet='search', dummy='XXXXXXX'):
|
||||
"""
|
||||
Test search functionality of search facet.
|
||||
@ -1011,7 +1009,6 @@ class UI_driver(object):
|
||||
|
||||
self.assert_facet(entity, facet)
|
||||
|
||||
|
||||
facet = self.get_facet()
|
||||
search_field_s = '.search-filter input[name=filter]'
|
||||
key = data.get('pkey')
|
||||
@ -1081,7 +1078,6 @@ class UI_driver(object):
|
||||
self.dialog_button_click('ok')
|
||||
self.wait_for_request()
|
||||
|
||||
|
||||
# check for error
|
||||
self.assert_no_error_dialog()
|
||||
self.wait_for_request()
|
||||
@ -1190,7 +1186,6 @@ class UI_driver(object):
|
||||
if delete:
|
||||
self.delete_record(pkey, data.get('del'))
|
||||
|
||||
|
||||
def add_table_record(self, name, data, parent=None):
|
||||
"""
|
||||
Add record to dnsrecord table, association table and similar
|
||||
@ -1364,7 +1359,6 @@ class UI_driver(object):
|
||||
# add multiple at once and test table delete button
|
||||
self.add_table_associations(table, keys, delete=True)
|
||||
|
||||
|
||||
def skip(self, reason):
|
||||
"""
|
||||
Skip tests
|
||||
@ -1401,7 +1395,6 @@ class UI_driver(object):
|
||||
dialogs = self.get_dialogs(name)
|
||||
assert len(dialogs) == 1, 'No or more than one dialog opened'
|
||||
|
||||
|
||||
def assert_no_error_dialog(self):
|
||||
"""
|
||||
Assert that no error dialog is opened
|
||||
@ -1447,7 +1440,6 @@ class UI_driver(object):
|
||||
s = "table[name='%s'] " % table_name
|
||||
self.assert_button_enabled(name, s, enabled)
|
||||
|
||||
|
||||
def assert_facet(self, entity, facet=None):
|
||||
"""
|
||||
Assert that current facet is correct
|
||||
@ -1485,7 +1477,6 @@ class UI_driver(object):
|
||||
else:
|
||||
assert visible, "Element not visible: %s" % selector
|
||||
|
||||
|
||||
def assert_record(self, pkey, parent=None, table_name=None, negative=False):
|
||||
"""
|
||||
Assert that record is in current search table
|
||||
|
Loading…
Reference in New Issue
Block a user