diff --git a/tests/test_attr_update.py b/tests/test_attr_update.py index b662388..ce36d78 100644 --- a/tests/test_attr_update.py +++ b/tests/test_attr_update.py @@ -9,3 +9,29 @@ def test_attr_update_new(test_cache): it1 = test_cache.search('testattrupdate')[0] assert it1.attrs == {**attrs0, **attrs1} + + +def test_update_attr_namespaces(test_cache): + + attrs0 = { + 'foo': 'bar', + 'attrdict': { + 'numbers': [0, 1, 2, 3, 4] + } + } + + it = test_cache.best_or_new('updatenamespace', attrs = attrs0) + it1 = test_cache.search('updatenamespace')[0] + + assert it1.attrs == attrs0 + + attrs1 = { + 'foo': 'bar', + 'attrdict': { + 'numbers': [5, 6, 7, 8] + } + } + test_cache.update(it.uri, update = {'attrs': attrs1}) + it2 = test_cache.search('updatenamespace')[0] + + assert it2.attrs == attrs1