mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-27 21:38:01 +00:00
test(credentials): cover masking of generated user passwords
This commit is contained in:
1 file changed
+17
@@ -0,0 +1,17 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import unittest
|
||||
from unittest.mock import patch
|
||||
|
||||
from cli.administration.inventory.provision import passwords
|
||||
|
||||
|
||||
class TestPasswordMasking(unittest.TestCase):
|
||||
def test_a_user_password_is_registered_for_masking(self) -> None:
|
||||
with patch.object(passwords, "mask") as masked:
|
||||
password = passwords.generate_user_password()
|
||||
masked.assert_called_once_with(password)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in new issue
Block a user