def test_no_duplicate_settings(self): count1 = 0 for key in UserProfileGroups.get_setting_groups_list(): settings = UserProfileGroups.SETTINGS_GROUPS[key]["settings"] count1 += len(settings) count2 = len(UserProfileGroups.get_all_settings_list()) self.assertEqual(count1, count2)
def show_attached_profiles_dialog(self): window_title = _("Profiles Attached to Options") items = self.ui.pages_tree.selectedItems() if items: page = self.item_to_page[items[0]] name = page.NAME else: name = '' if name not in UserProfileGroups.get_setting_groups_list(): message_box = QtWidgets.QMessageBox(self) message_box.setIcon(QtWidgets.QMessageBox.Information) message_box.setWindowModality(QtCore.Qt.WindowModal) message_box.setWindowTitle(window_title) message_box.setText( _("The options on this page are not currently available to be managed using profiles." )) message_box.setStandardButtons(QtWidgets.QMessageBox.Ok) return message_box.exec_() profile_dialog = AttachedProfilesDialog(parent=self, option_group=name) profile_dialog.show() profile_dialog.raise_() profile_dialog.activateWindow()
def page_has_profile_options(self, page): try: name = page.PARENT if page.PARENT in UserProfileGroups.SETTINGS_GROUPS else page.NAME except AttributeError: return False return name in UserProfileGroups.get_setting_groups_list()
def test_groups_have_items(self): for key in UserProfileGroups.get_setting_groups_list(): settings = UserProfileGroups.SETTINGS_GROUPS[key]["settings"] self.assertNotEqual(settings, {})
def test_has_groups(self): keys = list(UserProfileGroups.get_setting_groups_list()) self.assertNotEqual(keys, [])
def test_settings_have_titles(self): for key in UserProfileGroups.get_setting_groups_list(): settings = UserProfileGroups.SETTINGS_GROUPS[key]["settings"] self.assertNotEqual(settings, {}) for key, title, fields in settings: self.assertNotEqual(title.strip(), "")
def test_settings_have_no_blank_keys(self): for key in UserProfileGroups.get_setting_groups_list(): settings = UserProfileGroups.SETTINGS_GROUPS[key]["settings"] for key, title, fields in settings: self.assertNotEqual(key.strip(), "")