コード例 #1
0
def test_registered_permission_sections():
    expected_sections = [
        ('graph_collection', (50, u'Graph Collections', True)),
        ('graph_tuning', (50, u'Graph tunings', True)),
        ('sla_configuration', (50, u'Service Level Agreements', True)),
        ('custom_graph', (50, u'Custom Graphs', True)),
        ('bookmark_list', (50, u'Bookmark lists', True)),
        ('custom_snapin', (50, u'Custom snapins', True)),
        ('sidesnap', (50, u'Sidebar snapins', True)),
        ('notification_plugin', (50, u'Notification plugins', True)),
        ('wato', (50, u"WATO - Check_MK's Web Administration Tool", False)),
        ('background_jobs', (50, u'Background jobs', False)),
        ('bi', (50, u'BI - Check_MK Business Intelligence', False)),
        ('general', (10, u'General Permissions', False)),
        ('mkeventd', (50, u'Event Console', False)),
        ('action', (50, u'Commands on host and services', True)),
        ('dashboard', (50, u'Dashboards', True)),
        ('report', (50, u'Reports', True)),
        ('nagvis', (50, u'NagVis', False)),
        ('view', (50, u'Views', True)),
        ('icons_and_actions', (50, u'Icons', True)),
    ]

    section_names = permission_section_registry.keys()
    assert sorted([s[0] for s in expected_sections]) == sorted(section_names)

    for name, (sort_index, title, do_sort) in expected_sections:
        section = permission_section_registry[name]()
        assert section.title == title
        assert section.sort_index == sort_index
        assert section.do_sort == do_sort
コード例 #2
0
ファイル: test_gui_config.py プロジェクト: tribe29/checkmk
def test_registered_permission_sections():
    expected_sections = [
        ("bookmark_list", (50, "Bookmark lists", True)),
        ("custom_snapin", (50, "Custom sidebar elements", True)),
        ("sidesnap", (50, "Sidebar elements", True)),
        ("notification_plugin", (50, "Notification plugins", True)),
        ("wato", (50, "Setup", False)),
        ("background_jobs", (50, "Background jobs", False)),
        ("bi", (50, "BI - Checkmk Business Intelligence", False)),
        ("general", (10, "General Permissions", False)),
        ("mkeventd", (50, "Event Console", False)),
        ("action", (50, "Commands on host and services", True)),
        ("dashboard", (50, "Dashboards", True)),
        ("nagvis", (50, "NagVis", False)),
        ("view", (50, "Views", True)),
        ("icons_and_actions", (50, "Icons", True)),
        ("pagetype_topic", (50, "Topics", True)),
    ]

    if not cmk_version.is_raw_edition():
        expected_sections += [
            ("agent_registration", (50, "Agent registration", False)),
            ("custom_graph", (50, "Custom graphs", True)),
            ("forecast_graph", (50, "Forecast graphs", True)),
            ("graph_collection", (50, "Graph collections", True)),
            ("graph_tuning", (50, "Graph tunings", True)),
            ("sla_configuration", (50, "Service Level Agreements", True)),
            ("report", (50, "Reports", True)),
        ]

    section_names = permission_section_registry.keys()
    assert sorted([s[0] for s in expected_sections]) == sorted(section_names)

    for name, (sort_index, title, do_sort) in expected_sections:
        section = permission_section_registry[name]()
        assert section.title == title
        assert section.sort_index == sort_index
        assert section.do_sort == do_sort