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