コード例 #1
0
def test_copy_key_failure():
    """ Check that key that copy_key doesn't break when key doesn't exist """
    old_dict = {'test_key': 'test_value'}
    new_dict = {}
    key = 'test_key_fake'
    yamls_to_certification.copy_key(new_dict, old_dict, key)
    assert new_dict == {}
コード例 #2
0
def test_copy_key_success():
    """ Check that key is transfered to new dict using a deep copy """
    old_dict = {'test_key': 'test_value'}
    new_dict_1 = {}
    new_dict_2 = {}
    key = 'test_key'
    yamls_to_certification.copy_key(new_dict_1, old_dict, key)
    yamls_to_certification.copy_key(new_dict_2, old_dict, key)
    assert old_dict == new_dict_1
    assert old_dict == new_dict_2