def test_remove_mixed_keys(data): gold = deepcopy(data) del gold['b']['c'] del gold['a'] keys = {('b', 'c'), ('a', )} res = remove_extra_keys(data, keys) assert res == gold
def test_remove_mixed_keys(data): gold = deepcopy(data) del gold['b']['c'] del gold['a'] keys = {('b', 'c'), ('a',)} res = remove_extra_keys(data, keys) assert res == gold
def test_remove_multiple_nested(data): gold = deepcopy(data) gold['b'] = {} keys = {('b', 'c'), ('b', 'd')} res = remove_extra_keys(data, keys) assert res == gold
def test_remove_nested_key(data): gold = deepcopy(data) del gold['b']['c'] keys = {('b', 'c')} res = remove_extra_keys(data, keys) assert res == gold
def test_remove_multiple_first(data): gold = {'a': 1} keys = {('b',), ('e',)} res = remove_extra_keys(data, keys) assert res == gold
def test_remove_first_layer(data): gold = deepcopy(data) del gold['a'] keys = {('a',)} res = remove_extra_keys(data, keys) assert res == gold
def test_remove_one_missing_one_good(data): gold = deepcopy(data) del gold['a'] keys = {('x', 'y'), ('a',)} res = remove_extra_keys(data, keys) assert res == gold
def test_remove_nested_missing_both(data): gold = deepcopy(data) keys = {('y', 'x')} res = remove_extra_keys(data, keys) assert res == gold
def test_remove_multiple_first(data): gold = {'a': 1} keys = {('b', ), ('e', ), ('f', )} res = remove_extra_keys(data, keys) assert res == gold
def test_remove_one_missing_one_good(data): gold = deepcopy(data) del gold['a'] keys = {('x', 'y'), ('a', )} res = remove_extra_keys(data, keys) assert res == gold
def test_remove_nested_missing_first(data): gold = deepcopy(data) keys = {('x', 'c')} res = remove_extra_keys(data, keys) assert res == gold
def test_remove_single_missing(data): gold = deepcopy(data) keys = {('x', )} res = remove_extra_keys(data, keys) assert res == gold
def test_remove_single_missing(data): gold = deepcopy(data) keys = {('x',)} res = remove_extra_keys(data, keys) assert res == gold
def test_remove_first_layer(data): gold = deepcopy(data) del gold['a'] keys = {('a', )} res = remove_extra_keys(data, keys) assert res == gold