summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2016-12-15 09:42:20 +0100
committerAndrew Bartlett <abartlet@samba.org>2016-12-20 01:11:24 +0100
commit63dabd2f35224a7ee7468d435e67baa0e059358c (patch)
treebf00570aa11387f79a4f4f7bb607d7bc1e9ad22e /python
parentd29f7dc13bb705a0cab6de2aeac70c42d83a7af8 (diff)
downloadsamba-63dabd2f35224a7ee7468d435e67baa0e059358c.tar.gz
tests/credentials.py: verify the difference of parse_string("someone") and parse_string("someone%")
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'python')
-rw-r--r--python/samba/tests/credentials.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/python/samba/tests/credentials.py b/python/samba/tests/credentials.py
index c27edd77f4f..ad3f663e14d 100644
--- a/python/samba/tests/credentials.py
+++ b/python/samba/tests/credentials.py
@@ -70,6 +70,16 @@ class CredentialsTests(samba.tests.TestCase):
self.assertEqual("", self.creds.get_username())
self.assertEqual(None, self.creds.get_password())
+ def test_parse_string_empty_pw(self):
+ self.creds.parse_string("someone%")
+ self.assertEqual("someone", self.creds.get_username())
+ self.assertEqual("", self.creds.get_password())
+
+ def test_parse_string_none_pw(self):
+ self.creds.parse_string("someone")
+ self.assertEqual("someone", self.creds.get_username())
+ self.assertEqual(None, self.creds.get_password())
+
def test_parse_string_user_pw_domain(self):
self.creds.parse_string("dom\\someone%secr")
self.assertEqual("someone", self.creds.get_username())