本文整理汇总了Python中safe_qgis.tools.keywords_dialog.KeywordsDialog.reset方法的典型用法代码示例。如果您正苦于以下问题:Python KeywordsDialog.reset方法的具体用法?Python KeywordsDialog.reset怎么用?Python KeywordsDialog.reset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类safe_qgis.tools.keywords_dialog.KeywordsDialog
的用法示例。
在下文中一共展示了KeywordsDialog.reset方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_add_warnings_for_colons
# 需要导入模块: from safe_qgis.tools.keywords_dialog import KeywordsDialog [as 别名]
# 或者: from safe_qgis.tools.keywords_dialog.KeywordsDialog import reset [as 别名]
def test_add_warnings_for_colons(self):
"""Test add entry to list works."""
dialog = KeywordsDialog(PARENT, IFACE)
dialog.reset(False)
dialog.add_list_entry('bar', 'fo:o')
result = dialog.get_value_for_key('bar')
expected_result = 'fo.o'
message = '\nGot: %s\nExpected: %s\n' % (result, expected_result)
self.assertEqual(result, expected_result, message)
#
# Check the user gets a message if they put colons in the value
#
expected_result = 'Colons are not allowed, replaced with "."'
result = str(dialog.lblMessage.text())
message = (
'lblMessage error \nGot: %s\nExpected: %s\n' %
(result, expected_result))
self.assertEqual(result, expected_result, message)
#
# Check the user gets a message if they put colons in the key
#
dialog.add_list_entry('ba:r', 'foo')
expected_result = 'Colons are not allowed, replaced with "."'
result = str(dialog.lblMessage.text())
message = (
'lblMessage error \nGot: %s\nExpected: %s\n' %
(result, expected_result))
self.assertEqual(result, expected_result, message)
示例2: test_addWarningsForColons
# 需要导入模块: from safe_qgis.tools.keywords_dialog import KeywordsDialog [as 别名]
# 或者: from safe_qgis.tools.keywords_dialog.KeywordsDialog import reset [as 别名]
def test_addWarningsForColons(self):
"""Test add entry to list works"""
myDialog = KeywordsDialog(PARENT, IFACE)
myDialog.reset(False)
myDialog.add_list_entry('bar', 'fo:o')
myResult = myDialog.get_value_for_key('bar')
myExpectedResult = 'fo.o'
myMessage = ('\nGot: %s\nExpected: %s\n' %
(myResult, myExpectedResult))
#print 'Dict', myDialog.getKeywords()
assert myResult == myExpectedResult, myMessage
#
# Check the user gets a message if they put colons in the value
#
myExpectedResult = 'Colons are not allowed, replaced with "."'
myResult = str(myDialog.lblMessage.text())
myMessage = ('lblMessage error \nGot: %s\nExpected: %s\n' %
(myResult, myExpectedResult))
#print 'Dict', myDialog.getKeywords()
assert myResult == myExpectedResult, myMessage
#
# Check the user gets a message if they put colons in the key
#
myDialog.add_list_entry('ba:r', 'foo')
myExpectedResult = 'Colons are not allowed, replaced with "."'
myResult = str(myDialog.lblMessage.text())
myMessage = ('lblMessage error \nGot: %s\nExpected: %s\n' %
(myResult, myExpectedResult))
#print 'Dict', myDialog.getKeywords()
assert myResult == myExpectedResult, myMessage
示例3: test_reset
# 需要导入模块: from safe_qgis.tools.keywords_dialog import KeywordsDialog [as 别名]
# 或者: from safe_qgis.tools.keywords_dialog.KeywordsDialog import reset [as 别名]
def test_reset(self):
"""Test form reset works."""
dialog = KeywordsDialog(PARENT, IFACE)
dialog.leTitle.setText('Foo')
dialog.reset(False)
expected_result = ''
result = dialog.leTitle.text()
message = '\nGot: %s\nExpected: %s\n' % (result, expected_result)
self.assertEqual(result, expected_result, message)
示例4: test_set_category
# 需要导入模块: from safe_qgis.tools.keywords_dialog import KeywordsDialog [as 别名]
# 或者: from safe_qgis.tools.keywords_dialog.KeywordsDialog import reset [as 别名]
def test_set_category(self):
"""Test set category works."""
dialog = KeywordsDialog(PARENT, IFACE)
dialog.reset(False)
dialog.set_category('hazard')
expected_result = 'hazard'
result = dialog.get_value_for_key('category')
message = '\nGot: %s\nExpected: %s\n' % (result, expected_result)
self.assertEqual(result, expected_result, message)
示例5: test_add_list_entry
# 需要导入模块: from safe_qgis.tools.keywords_dialog import KeywordsDialog [as 别名]
# 或者: from safe_qgis.tools.keywords_dialog.KeywordsDialog import reset [as 别名]
def test_add_list_entry(self):
"""Test add entry to list works."""
dialog = KeywordsDialog(PARENT, IFACE)
dialog.reset(False)
dialog.add_list_entry('bar', 'foo')
result = dialog.get_value_for_key('bar')
expected_result = 'foo'
message = '\nGot: %s\nExpected: %s\n' % (result, expected_result)
self.assertEqual(result, expected_result, message)
示例6: test_reset
# 需要导入模块: from safe_qgis.tools.keywords_dialog import KeywordsDialog [as 别名]
# 或者: from safe_qgis.tools.keywords_dialog.KeywordsDialog import reset [as 别名]
def test_reset(self):
"""Test form reset works"""
myDialog = KeywordsDialog(PARENT, IFACE)
myDialog.leTitle.setText('Foo')
myDialog.reset(False)
myExpectedResult = ''
myResult = myDialog.leTitle.text()
myMessage = ('\nGot: %s\nExpected: %s\n' %
(myResult, myExpectedResult))
assert myResult == myExpectedResult, myMessage
示例7: test_remove_iItem_by_key
# 需要导入模块: from safe_qgis.tools.keywords_dialog import KeywordsDialog [as 别名]
# 或者: from safe_qgis.tools.keywords_dialog.KeywordsDialog import reset [as 别名]
def test_remove_iItem_by_key(self):
"""Test remove item by its key works."""
dialog = KeywordsDialog(PARENT, IFACE)
dialog.reset(False)
dialog.add_list_entry('bar', 'foo')
dialog.remove_item_by_key('bar')
result = dialog.lstKeywords.count()
expected_result = 0
message = '\nGot: %s\nExpected: %s\n' % (result, expected_result)
self.assertEqual(result, expected_result, message)
示例8: test_setCategory
# 需要导入模块: from safe_qgis.tools.keywords_dialog import KeywordsDialog [as 别名]
# 或者: from safe_qgis.tools.keywords_dialog.KeywordsDialog import reset [as 别名]
def test_setCategory(self):
"""Test set category works"""
myDialog = KeywordsDialog(PARENT, IFACE)
myDialog.reset(False)
myDialog.set_category('hazard')
myExpectedResult = 'hazard'
myResult = myDialog.get_value_for_key('category')
myMessage = ('\nGot: %s\nExpected: %s\n' %
(myResult, myExpectedResult))
#print 'Dict', myDialog.getKeywords()
assert myResult == myExpectedResult, myMessage
示例9: test_addListEntry
# 需要导入模块: from safe_qgis.tools.keywords_dialog import KeywordsDialog [as 别名]
# 或者: from safe_qgis.tools.keywords_dialog.KeywordsDialog import reset [as 别名]
def test_addListEntry(self):
"""Test add entry to list works"""
myDialog = KeywordsDialog(PARENT, IFACE)
myDialog.reset(False)
myDialog.add_list_entry('bar', 'foo')
myResult = myDialog.get_value_for_key('bar')
myExpectedResult = 'foo'
myMessage = ('\nGot: %s\nExpected: %s\n' %
(myResult, myExpectedResult))
#print 'Dict', myDialog.getKeywords()
assert myResult == myExpectedResult, myMessage
示例10: test_removeItemByKey
# 需要导入模块: from safe_qgis.tools.keywords_dialog import KeywordsDialog [as 别名]
# 或者: from safe_qgis.tools.keywords_dialog.KeywordsDialog import reset [as 别名]
def test_removeItemByKey(self):
"""Test remove item by its key works"""
myDialog = KeywordsDialog(PARENT, IFACE)
myDialog.reset(False)
myDialog.add_list_entry('bar', 'foo')
myDialog.remove_item_by_key('bar')
myResult = myDialog.lstKeywords.count()
myExpectedResult = 0
myMessage = ('\nGot: %s\nExpected: %s\n' %
(myResult, myExpectedResult))
#print 'Dict', myDialog.getKeywords()
assert myResult == myExpectedResult, myMessage
示例11: test_on_pbn_add_to_list1_clicked
# 需要导入模块: from safe_qgis.tools.keywords_dialog import KeywordsDialog [as 别名]
# 或者: from safe_qgis.tools.keywords_dialog.KeywordsDialog import reset [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)
示例12: test_on_pbn_add_to_list2_clicked
# 需要导入模块: from safe_qgis.tools.keywords_dialog import KeywordsDialog [as 别名]
# 或者: from safe_qgis.tools.keywords_dialog.KeywordsDialog import reset [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)
示例13: test_on_pbnAddToList1_clicked
# 需要导入模块: from safe_qgis.tools.keywords_dialog import KeywordsDialog [as 别名]
# 或者: from safe_qgis.tools.keywords_dialog.KeywordsDialog import reset [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
示例14: test_on_pbn_remove_clicked
# 需要导入模块: from safe_qgis.tools.keywords_dialog import KeywordsDialog [as 别名]
# 或者: from safe_qgis.tools.keywords_dialog.KeywordsDialog import reset [as 别名]
def test_on_pbn_remove_clicked(self):
"""Test pressing remove works on key list"""
dialog = KeywordsDialog(PARENT, IFACE)
dialog.reset(False)
result = dialog.lstKeywords.count()
expected_result = 0
message = '\nGot: %s\nExpected: %s\n' % (result, expected_result)
self.assertEqual(result, expected_result, message)
dialog.add_list_entry('bar', 'foo')
result = dialog.lstKeywords.count()
expected_result = 1
message = '\nGot: %s\nExpected: %s\n' % (result, expected_result)
self.assertEqual(result, expected_result, message)
示例15: test_on_pbnAddToList2_clicked
# 需要导入模块: from safe_qgis.tools.keywords_dialog import KeywordsDialog [as 别名]
# 或者: from safe_qgis.tools.keywords_dialog.KeywordsDialog import reset [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