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


Python gui.QgsAuthSettingsWidget类代码示例

本文整理汇总了Python中qgis.gui.QgsAuthSettingsWidget的典型用法代码示例。如果您正苦于以下问题:Python QgsAuthSettingsWidget类的具体用法?Python QgsAuthSettingsWidget怎么用?Python QgsAuthSettingsWidget使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了QgsAuthSettingsWidget类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: testWidgetUsername

 def testWidgetUsername(self):
     """
     Test the widget with username only
     """
     w = QgsAuthSettingsWidget(None, None, 'username')
     self.assertEqual(w.username(), 'username')
     self.assertEqual(w.password(), '')
     self.assertEqual(w.configId(), '')
     self.assertFalse(w.configurationTabIsSelected())
开发者ID:enzogis,项目名称:QGIS,代码行数:9,代码来源:test_authsettingswidget.py

示例2: testWidgetConfigId

 def testWidgetConfigId(self):
     """
     Test the widget with configId
     """
     w = QgsAuthSettingsWidget(None, self.auth_config.id())
     self.assertEqual(w.username(), '')
     self.assertEqual(w.password(), '')
     self.assertEqual(w.configId(), self.auth_config.id())
     self.assertTrue(w.configurationTabIsSelected())
     self.assertFalse(w.btnConvertToEncryptedIsEnabled())
开发者ID:enzogis,项目名称:QGIS,代码行数:10,代码来源:test_authsettingswidget.py

示例3: testWidgetNoArgs

 def testWidgetNoArgs(self):
     """
     Test the widget with no args
     """
     w = QgsAuthSettingsWidget()
     self.assertEqual(w.username(), '')
     self.assertEqual(w.password(), '')
     self.assertEqual(w.configId(), '')
     self.assertTrue(w.configurationTabIsSelected())
     self.assertFalse(w.btnConvertToEncryptedIsEnabled())
开发者ID:enzogis,项目名称:QGIS,代码行数:10,代码来源:test_authsettingswidget.py

示例4: testWidgetUsernameAndPassword

 def testWidgetUsernameAndPassword(self):
     """
     Test the widget with username and password
     """
     w = QgsAuthSettingsWidget(None, None, 'username', 'password')
     self.assertEqual(w.username(), 'username')
     self.assertEqual(w.password(), 'password')
     self.assertEqual(w.configId(), '')
     self.assertFalse(w.configurationTabIsSelected())
     self.assertTrue(w.btnConvertToEncryptedIsEnabled())
开发者ID:enzogis,项目名称:QGIS,代码行数:10,代码来源:test_authsettingswidget.py

示例5: test_storeCheckBoxes

    def test_storeCheckBoxes(self):
        """
        Test store cb setters and getters
        """
        w = QgsAuthSettingsWidget()
        self.assertFalse(w.storePasswordIsChecked())
        self.assertFalse(w.storeUsernameIsChecked())

        w = QgsAuthSettingsWidget()
        w.setStorePasswordChecked(True)
        self.assertTrue(w.storePasswordIsChecked())
        self.assertFalse(w.storeUsernameIsChecked())

        w = QgsAuthSettingsWidget()
        w.setStoreUsernameChecked(True)
        self.assertFalse(w.storePasswordIsChecked())
        self.assertTrue(w.storeUsernameIsChecked())

        w = QgsAuthSettingsWidget()
        w.setStoreUsernameChecked(True)
        w.setStorePasswordChecked(True)
        self.assertTrue(w.storePasswordIsChecked())
        self.assertTrue(w.storeUsernameIsChecked())
开发者ID:enzogis,项目名称:QGIS,代码行数:23,代码来源:test_authsettingswidget.py

示例6: test_setters

    def test_setters(self):
        """
        Test setters
        """
        w = QgsAuthSettingsWidget()
        w.setUsername('username')
        self.assertFalse(w.configurationTabIsSelected())
        self.assertEqual(w.username(), 'username')

        w = QgsAuthSettingsWidget()
        w.setPassword('password')
        self.assertEqual(w.password(), 'password')
        self.assertFalse(w.configurationTabIsSelected())

        w = QgsAuthSettingsWidget()
        w.setConfigId(self.auth_config.id())
        self.assertEqual(w.configId(), self.auth_config.id())
        self.assertTrue(w.configurationTabIsSelected())

        w = QgsAuthSettingsWidget()
        w.setUsername('username')
        w.setPassword('password')
        w.setConfigId(self.auth_config.id())
        self.assertEqual(w.configId(), self.auth_config.id())
        self.assertTrue(w.configurationTabIsSelected())

        w = QgsAuthSettingsWidget()
        w.setDataprovider('db2')
        self.assertEqual(w.dataprovider(), 'db2')
开发者ID:enzogis,项目名称:QGIS,代码行数:29,代码来源:test_authsettingswidget.py


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