Module change_pswd_func.log

View Source
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/env python

from typing import Generic, TypeVar

from .constants import (

    MAX_CHAR_CONTINUOUS_NUM,

    MAX_SP_CHAR_NUM,

    MAX_VALID_LENGTH,

    MIN_VALID_LENGTH

)

T = TypeVar('T')

class LogMsgVerifyPswd(Generic[T]):

    # TODO Can be used these msg to check which message is shown when validation is failed on unit test

    INVALID_LENGTH = '[NG] The length needs to be from {} to {}.'.format(MIN_VALID_LENGTH, MAX_VALID_LENGTH)

    INVALID_CHAR = '[NG] Included invalid char'

    NOT_ALL_PATTERNS = "[NG] All necessary patterns aren't included"

    OVER_CONTINUOUS_SAME_CHARS = '[NG] Included continous more than {} same chars'.format(MAX_CHAR_CONTINUOUS_NUM)

    OVER_SP_CHAR_NUM = '[NG] Included more than {} special characters'.format(MAX_SP_CHAR_NUM)

    MORE_THAN_HALF_OF_LENGTH = '[NG] 50 % of password should not be a number'

    VALID = '[OK] Valid password'

class LogMsgChangePaswd(Generic[T]):

    # TODO Can be used these msg to check which message is shown when validation is failed on unit test

    INVALID_OLD_PSWD = '[NG] Could not find old password in the system'

    INVALID_NEW_PSWD = '[NG] Could not change password due to invalid new password'

    SIMILAR_TO_OLD_ONE = '[NG] Could not change password due to similar to previous one'

    SUCCESS = '[OK] Changed password successfully'

Variables

MAX_CHAR_CONTINUOUS_NUM
MAX_SP_CHAR_NUM
MAX_VALID_LENGTH
MIN_VALID_LENGTH
T

Classes

LogMsgChangePaswd

class LogMsgChangePaswd(
    /,
    *args,
    **kwargs
)

Abstract base class for generic types.

A generic type is typically declared by inheriting from this class parameterized with one or more type variables. For example, a generic mapping type might be defined as::

class Mapping(Generic[KT, VT]): def getitem(self, key: KT) -> VT: ... # Etc.

This class can then be used as follows::

def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT: try: return mapping[key] except KeyError: return default

View Source
class LogMsgChangePaswd(Generic[T]):

    # TODO Can be used these msg to check which message is shown when validation is failed on unit test

    INVALID_OLD_PSWD = '[NG] Could not find old password in the system'

    INVALID_NEW_PSWD = '[NG] Could not change password due to invalid new password'

    SIMILAR_TO_OLD_ONE = '[NG] Could not change password due to similar to previous one'

    SUCCESS = '[OK] Changed password successfully'

Ancestors (in MRO)

  • typing.Generic

Class variables

INVALID_NEW_PSWD
INVALID_OLD_PSWD
SIMILAR_TO_OLD_ONE
SUCCESS

LogMsgVerifyPswd

class LogMsgVerifyPswd(
    /,
    *args,
    **kwargs
)

Abstract base class for generic types.

A generic type is typically declared by inheriting from this class parameterized with one or more type variables. For example, a generic mapping type might be defined as::

class Mapping(Generic[KT, VT]): def getitem(self, key: KT) -> VT: ... # Etc.

This class can then be used as follows::

def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT: try: return mapping[key] except KeyError: return default

View Source
class LogMsgVerifyPswd(Generic[T]):

    # TODO Can be used these msg to check which message is shown when validation is failed on unit test

    INVALID_LENGTH = '[NG] The length needs to be from {} to {}.'.format(MIN_VALID_LENGTH, MAX_VALID_LENGTH)

    INVALID_CHAR = '[NG] Included invalid char'

    NOT_ALL_PATTERNS = "[NG] All necessary patterns aren't included"

    OVER_CONTINUOUS_SAME_CHARS = '[NG] Included continous more than {} same chars'.format(MAX_CHAR_CONTINUOUS_NUM)

    OVER_SP_CHAR_NUM = '[NG] Included more than {} special characters'.format(MAX_SP_CHAR_NUM)

    MORE_THAN_HALF_OF_LENGTH = '[NG] 50 % of password should not be a number'

    VALID = '[OK] Valid password'

Ancestors (in MRO)

  • typing.Generic

Class variables

INVALID_CHAR
INVALID_LENGTH
MORE_THAN_HALF_OF_LENGTH
NOT_ALL_PATTERNS
OVER_CONTINUOUS_SAME_CHARS
OVER_SP_CHAR_NUM
VALID