You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
616 B
18 lines
616 B
7 years ago
|
|
||
|
def test_crypt_context_to_settings():
|
||
|
from ordr.security import crypt_context_settings_to_string
|
||
|
settings = {
|
||
|
'no_prefix': 'should not appear',
|
||
|
'prefix.something': 'left unchanged',
|
||
|
'prefix.schemes': 'adjust list',
|
||
|
'prefix.depreceated': 'do, not, adjust, this, list'
|
||
|
}
|
||
|
result = crypt_context_settings_to_string(settings, 'prefix.')
|
||
|
expected_lines = {
|
||
|
'[passlib]',
|
||
|
'something = left unchanged',
|
||
|
'schemes = adjust,list',
|
||
|
'depreceated = do, not, adjust, this, list',
|
||
|
}
|
||
|
assert set(result.split('\n')) == expected_lines
|