Skip to content

Commit 1a3359b

Browse files
author
Shakeel Mohamed
committed
add a storage password test with slashes
1 parent af1ba9e commit 1a3359b

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/test_storage_passwords.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,22 @@ def test_create(self):
4545
p.delete()
4646
self.assertEqual(start_count, len(self.storage_passwords))
4747

48+
def test_create_with_slashes(self):
49+
start_count = len(self.storage_passwords)
50+
realm = testlib.tmpname()
51+
username = testlib.tmpname()
52+
53+
p = self.storage_passwords.create("changeme", "\\" + username, realm)
54+
self.assertEqual(start_count + 1, len(self.storage_passwords))
55+
self.assertEqual(p.realm, realm)
56+
self.assertEqual(p.username, "\\" + username)
57+
self.assertEqual(p.clear_password, "changeme")
58+
self.assertEqual(p.name, realm + ":\\\\" + username + ":")
59+
print p.name
60+
61+
p.delete()
62+
self.assertEqual(start_count, len(self.storage_passwords))
63+
4864
def test_create_norealm(self):
4965
start_count = len(self.storage_passwords)
5066
username = testlib.tmpname()

0 commit comments

Comments
 (0)