Skip to content

Commit ec76d1e

Browse files
committed
Update test_storage_passwords.py
- added test case for check spaces in username
1 parent 526e5d7 commit ec76d1e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/test_storage_passwords.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,16 @@ def test_delete(self):
222222
self.storage_passwords.delete(username + "/foo", "/myrealm")
223223
self.assertEqual(start_count, len(self.storage_passwords))
224224

225+
def test_spaces_in_username(self):
226+
start_count = len(self.storage_passwords)
227+
realm = testlib.tmpname()
228+
username = " user1 "
229+
230+
p = self.storage_passwords.create("changeme", username, realm)
231+
self.assertEqual(p.username, username)
232+
233+
p.delete()
234+
self.assertEqual(start_count, len(self.storage_passwords))
225235

226236
if __name__ == "__main__":
227237
try:

0 commit comments

Comments
 (0)