本文整理汇总了Python中safe_qgis.tools.keywords_dialog.KeywordsDialog.on_pbnAddToList1_clicked方法的典型用法代码示例。如果您正苦于以下问题:Python KeywordsDialog.on_pbnAddToList1_clicked方法的具体用法?Python KeywordsDialog.on_pbnAddToList1_clicked怎么用?Python KeywordsDialog.on_pbnAddToList1_clicked使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类safe_qgis.tools.keywords_dialog.KeywordsDialog
的用法示例。
在下文中一共展示了KeywordsDialog.on_pbnAddToList1_clicked方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_on_pbn_add_to_list1_clicked
# 需要导入模块: from safe_qgis.tools.keywords_dialog import KeywordsDialog [as 别名]
# 或者: from safe_qgis.tools.keywords_dialog.KeywordsDialog import on_pbnAddToList1_clicked [as 别名]
def test_on_pbn_add_to_list1_clicked(self):
"""Test adding an item to the list using predefined form works"""
dialog = KeywordsDialog(PARENT, IFACE, layer=None)
dialog.reset(False)
dialog.radPredefined.setChecked(True)
dialog.cboKeyword.setCurrentIndex(2)
expected_result = 'foo'
dialog.lePredefinedValue.setText(expected_result)
dialog.on_pbnAddToList1_clicked()
result = dialog.get_value_for_key('datatype')
message = '\nGot: %s\nExpected: %s\n' % (result, expected_result)
self.assertEqual(result, expected_result, message)
示例2: test_on_pbnAddToList1_clicked
# 需要导入模块: from safe_qgis.tools.keywords_dialog import KeywordsDialog [as 别名]
# 或者: from safe_qgis.tools.keywords_dialog.KeywordsDialog import on_pbnAddToList1_clicked [as 别名]
def test_on_pbnAddToList1_clicked(self):
"""Test adding an item to the list using predefined form works"""
myDialog = KeywordsDialog(PARENT, IFACE)
myDialog.reset(False)
myDialog.radPredefined.setChecked(True)
myDialog.cboKeyword.setCurrentIndex(2)
myExpectedResult = 'foo'
myDialog.lePredefinedValue.setText(myExpectedResult)
myDialog.on_pbnAddToList1_clicked()
myResult = myDialog.get_value_for_key('datatype')
myMessage = ('\nGot: %s\nExpected: %s\n' %
(myResult, myExpectedResult))
assert myResult == myExpectedResult, myMessage