Beispiel #1
0
def test_mask_dic_values_key_not_exists():
    dic = {'key': 'secret_value'}
    keys = ['key1']

    new_dic = mask_dic_values(dic, keys)

    assert new_dic['key'] == 'secret_value'
Beispiel #2
0
def test_mask_dic_values_change_value():
    dic = {'key': 'secret_value'}
    keys = ['key']

    new_dic = mask_dic_values(dic, keys)

    assert new_dic['key'] == '######'
Beispiel #3
0
def test_mask_dic_values_keys_is_none():
    dic = {'key': 'value'}
    keys = None
    with pytest.raises(ValueError, match='keys cannot be null'):
        mask_dic_values(dic, keys)
Beispiel #4
0
def test_mask_dic_values_keys_is_empty():
    dic = {'key': 'value'}
    keys = []
    with pytest.raises(ValueError, match='keys cannot be empty'):
        mask_dic_values(dic, keys)
Beispiel #5
0
def test_mask_dic_values_dic_empty():
    dic = {}
    with pytest.raises(ValueError, match='dic cannot be empty'):
        mask_dic_values(dic, ['key'])