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


Python KeywordsDialog.reset方法代码示例

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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