本文整理汇总了Python中safe_qgis.keywords_dialog.KeywordsDialog.reset方法的典型用法代码示例。如果您正苦于以下问题:Python KeywordsDialog.reset方法的具体用法?Python KeywordsDialog.reset怎么用?Python KeywordsDialog.reset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类safe_qgis.keywords_dialog.KeywordsDialog
的用法示例。
在下文中一共展示了KeywordsDialog.reset方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_addWarningsForColons
# 需要导入模块: from safe_qgis.keywords_dialog import KeywordsDialog [as 别名]
# 或者: from safe_qgis.keywords_dialog.KeywordsDialog import reset [as 别名]
def test_addWarningsForColons(self):
"""Test add entry to list works"""
myDialog = KeywordsDialog(PARENT, IFACE)
myDialog.reset(False)
myDialog.addListEntry('bar', 'fo:o')
myResult = myDialog.getValueForKey('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.addListEntry('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
示例2: test_reset
# 需要导入模块: from safe_qgis.keywords_dialog import KeywordsDialog [as 别名]
# 或者: from safe_qgis.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
示例3: test_setCategory
# 需要导入模块: from safe_qgis.keywords_dialog import KeywordsDialog [as 别名]
# 或者: from safe_qgis.keywords_dialog.KeywordsDialog import reset [as 别名]
def test_setCategory(self):
"""Test set category works"""
myDialog = KeywordsDialog(PARENT, IFACE)
myDialog.reset(False)
myDialog.setCategory('hazard')
myExpectedResult = 'hazard'
myResult = myDialog.getValueForKey('category')
myMessage = ('\nGot: %s\nExpected: %s\n' %
(myResult, myExpectedResult))
#print 'Dict', myDialog.getKeywords()
assert myResult == myExpectedResult, myMessage
示例4: test_addListEntry
# 需要导入模块: from safe_qgis.keywords_dialog import KeywordsDialog [as 别名]
# 或者: from safe_qgis.keywords_dialog.KeywordsDialog import reset [as 别名]
def test_addListEntry(self):
"""Test add entry to list works"""
myDialog = KeywordsDialog(PARENT, IFACE)
myDialog.reset(False)
myDialog.addListEntry('bar', 'foo')
myResult = myDialog.getValueForKey('bar')
myExpectedResult = 'foo'
myMessage = ('\nGot: %s\nExpected: %s\n' %
(myResult, myExpectedResult))
#print 'Dict', myDialog.getKeywords()
assert myResult == myExpectedResult, myMessage
示例5: test_removeItemByKey
# 需要导入模块: from safe_qgis.keywords_dialog import KeywordsDialog [as 别名]
# 或者: from safe_qgis.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.addListEntry('bar', 'foo')
myDialog.removeItemByKey('bar')
myResult = myDialog.lstKeywords.count()
myExpectedResult = 0
myMessage = ('\nGot: %s\nExpected: %s\n' %
(myResult, myExpectedResult))
#print 'Dict', myDialog.getKeywords()
assert myResult == myExpectedResult, myMessage
示例6: test_on_pbnAddToList1_clicked
# 需要导入模块: from safe_qgis.keywords_dialog import KeywordsDialog [as 别名]
# 或者: from safe_qgis.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)
# Work around for commented out line below
myDialog.on_pbnAddToList1_clicked()
#QTest.mouseClick(myDialog.pbnAddToList1, QtCore.Qt.LeftButton)
myResult = myDialog.getValueForKey('datatype')
myMessage = ('\nGot: %s\nExpected: %s\n' %
(myResult, myExpectedResult))
assert myResult == myExpectedResult, myMessage
示例7: test_on_pbnAddToList2_clicked
# 需要导入模块: from safe_qgis.keywords_dialog import KeywordsDialog [as 别名]
# 或者: from safe_qgis.keywords_dialog.KeywordsDialog import reset [as 别名]
def test_on_pbnAddToList2_clicked(self):
"""Test adding an item to the list using user defened 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)
# Work around for commented out line below
myDialog.on_pbnAddToList2_clicked()
#QTest.mouseClick(myDialog.pbnAddToList2, QtCore.Qt.LeftButton)
myResult = myDialog.getValueForKey('foo')
myMessage = ('\nGot: %s\nExpected: %s\n' %
(myResult, myExpectedResult))
print 'Dict', myDialog.getKeywords()
assert myResult == myExpectedResult, myMessage
示例8: test_on_pbnRemove_clicked
# 需要导入模块: from safe_qgis.keywords_dialog import KeywordsDialog [as 别名]
# 或者: from safe_qgis.keywords_dialog.KeywordsDialog import reset [as 别名]
def test_on_pbnRemove_clicked(self):
"""Test pressing remove works on key list"""
myDialog = KeywordsDialog(PARENT, IFACE)
myDialog.reset(False)
myResult = myDialog.lstKeywords.count()
myExpectedResult = 0
myMessage = ('\nGot: %s\nExpected: %s\n' %
(myResult, myExpectedResult))
#print 'Dict', myDialog.getKeywords()
assert myResult == myExpectedResult, myMessage
myDialog.addListEntry('bar', 'foo')
myResult = myDialog.lstKeywords.count()
myExpectedResult = 1
myMessage = ('\nGot: %s\nExpected: %s\n' %
(myResult, myExpectedResult))
#print 'Dict', myDialog.getKeywords()
assert myResult == myExpectedResult, myMessage