예제 #1
0
 def testConvertToEncrypted(self):
     """
     Test the widget to encrypted conversion
     """
     w = QgsAuthSettingsWidget(None, None, 'username', 'password')
     self.assertEqual(w.username(), 'username')
     self.assertEqual(w.password(), 'password')
     self.assertEqual(w.configId(), '')
     self.assertEqual(w.currentTabIndex(), 1)
     self.assertTrue(w.btnConvertToEncryptedIsEnabled())
     self.assertTrue(w.convertToEncrypted())
     self.assertNotEqual(w.configId(), '')
     self.assertEqual(w.username(), '')
     self.assertEqual(w.password(), '')
     self.assertEqual(w.currentTabIndex(), 0)
     self.assertFalse(w.btnConvertToEncryptedIsEnabled())
예제 #2
0
 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.assertEqual(w.currentTabIndex(), 1)
예제 #3
0
 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.assertEqual(w.currentTabIndex(), 0)
     self.assertFalse(w.btnConvertToEncryptedIsEnabled())
예제 #4
0
 def testWidgetNoArgs(self):
     """
     Test the widget with no args
     """
     w = QgsAuthSettingsWidget()
     self.assertEqual(w.username(), '')
     self.assertEqual(w.password(), '')
     self.assertEqual(w.configId(), '')
     self.assertEqual(w.currentTabIndex(), 0)
     self.assertFalse(w.btnConvertToEncryptedIsEnabled())
예제 #5
0
 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.assertEqual(w.currentTabIndex(), 1)
     self.assertTrue(w.btnConvertToEncryptedIsEnabled())