tests_utils.py 513B

123456789101112131415
  1. import string
  2. from tracim_backend.lib.utils.utils import password_generator
  3. from tracim_backend.lib.utils.utils import ALLOWED_AUTOGEN_PASSWORD_CHAR
  4. from tracim_backend.lib.utils.utils import DEFAULT_PASSWORD_GEN_CHAR_LENGTH
  5. class TestPasswordGenerator(object):
  6. def test_password_generator_ok_nominal_case(self):
  7. password = password_generator()
  8. assert len(password) == DEFAULT_PASSWORD_GEN_CHAR_LENGTH
  9. for char in password:
  10. assert char in ALLOWED_AUTOGEN_PASSWORD_CHAR