summaryrefslogtreecommitdiff
path: root/test/units/plugins/lookup/test_password.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/units/plugins/lookup/test_password.py')
-rw-r--r--test/units/plugins/lookup/test_password.py17
1 files changed, 14 insertions, 3 deletions
diff --git a/test/units/plugins/lookup/test_password.py b/test/units/plugins/lookup/test_password.py
index 15207b2f39..318bc10ba6 100644
--- a/test/units/plugins/lookup/test_password.py
+++ b/test/units/plugins/lookup/test_password.py
@@ -330,23 +330,34 @@ class TestRandomPassword(unittest.TestCase):
class TestParseContent(unittest.TestCase):
def test_empty_password_file(self):
- plaintext_password, salt = password._parse_content(u'')
+ plaintext_password, salt, ident = password._parse_content(u'')
self.assertEqual(plaintext_password, u'')
self.assertEqual(salt, None)
+ self.assertEqual(ident, None)
def test(self):
expected_content = u'12345678'
file_content = expected_content
- plaintext_password, salt = password._parse_content(file_content)
+ plaintext_password, salt, ident = password._parse_content(file_content)
self.assertEqual(plaintext_password, expected_content)
self.assertEqual(salt, None)
+ self.assertEqual(ident, None)
def test_with_salt(self):
expected_content = u'12345678 salt=87654321'
file_content = expected_content
- plaintext_password, salt = password._parse_content(file_content)
+ plaintext_password, salt, ident = password._parse_content(file_content)
self.assertEqual(plaintext_password, u'12345678')
self.assertEqual(salt, u'87654321')
+ self.assertEqual(ident, None)
+
+ def test_with_salt_and_ident(self):
+ expected_content = u'12345678 salt=87654321 ident=2a'
+ file_content = expected_content
+ plaintext_password, salt, ident = password._parse_content(file_content)
+ self.assertEqual(plaintext_password, u'12345678')
+ self.assertEqual(salt, u'87654321')
+ self.assertEqual(ident, u'2a')
class TestFormatContent(unittest.TestCase):