Skip to content
Permalink
Browse files

[auth] Tests for new setters methods

  • Loading branch information
elpaso committed Oct 2, 2017
1 parent 7c0ac6e commit c57b9e7e739ac7433932555f72487e207f28258b
Showing with 26 additions and 0 deletions.
  1. +26 −0 tests/src/python/test_authsettingswidget.py
@@ -139,6 +139,32 @@ def testConvertToEncrypted(self):
self.assertEqual(w.currentTabIndex(), 0)
self.assertFalse(w.btnConvertToEncryptedIsEnabled())

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

w = QgsAuthSettingsWidget()
w.setPassword('password')
self.assertEqual(w.password(), 'password')
self.assertEqual(w.currentTabIndex(), 1)

w = QgsAuthSettingsWidget()
w.setConfigId(self.auth_config.id())
self.assertEqual(w.configId(), self.auth_config.id())
self.assertEqual(w.currentTabIndex(), 0)

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


if __name__ == '__main__':
unittest.main()

0 comments on commit c57b9e7

Please sign in to comment.
You can’t perform that action at this time.