Ejemplo n.º 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'
Ejemplo n.º 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'] == '######'
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 5
0
def test_mask_dic_values_dic_empty():
    dic = {}
    with pytest.raises(ValueError, match='dic cannot be empty'):
        mask_dic_values(dic, ['key'])