Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[auth] Tests for new setters methods
  • Loading branch information
elpaso committed Oct 2, 2017
1 parent 7c0ac6e commit c57b9e7
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tests/src/python/test_authsettingswidget.py
Expand Up @@ -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.