Skip to content

Commit

Permalink
Write to test updating namespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
Balazs Bohar committed Sep 17, 2024
1 parent 8467591 commit 108dc17
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tests/test_attr_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 108dc17

Please sign in to comment.