当前位置: 首页>>代码示例>>Python>>正文


Python KeywordsDialog.reset方法代码示例

本文整理汇总了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
开发者ID:fivejjs,项目名称:inasafe,代码行数:32,代码来源:test_keywords_dialog.py

示例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
开发者ID:fivejjs,项目名称:inasafe,代码行数:12,代码来源:test_keywords_dialog.py

示例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
开发者ID:fivejjs,项目名称:inasafe,代码行数:13,代码来源:test_keywords_dialog.py

示例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
开发者ID:fivejjs,项目名称:inasafe,代码行数:13,代码来源:test_keywords_dialog.py

示例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
开发者ID:fivejjs,项目名称:inasafe,代码行数:14,代码来源:test_keywords_dialog.py

示例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
开发者ID:fivejjs,项目名称:inasafe,代码行数:18,代码来源:test_keywords_dialog.py

示例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
开发者ID:fivejjs,项目名称:inasafe,代码行数:19,代码来源:test_keywords_dialog.py

示例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
开发者ID:fivejjs,项目名称:inasafe,代码行数:21,代码来源:test_keywords_dialog.py


注:本文中的safe_qgis.keywords_dialog.KeywordsDialog.reset方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。