def test_adding_child_with_note(): client = ArchivesSpaceClient(**AUTH) uri = client.add_child('/repositories/2/resources/5', title='Test child', level='item', notes=[{'type': 'odd', 'content': 'This is a test note'}]) assert uri == '/repositories/2/archival_objects/24'
def test_posting_contentless_note(): client = ArchivesSpaceClient(**AUTH) uri = client.add_child('/repositories/2/resources/1', title='Test child', level='recordgrp', notes=[{'type': 'odd', 'content': ''}]) assert client.get_record(uri)['notes'] == []
def test_posting_multiple_notes(): client = ArchivesSpaceClient(**AUTH) uri = client.add_child('/repositories/2/resources/1', title='Test child', level='recordgrp', notes=[{'type': 'odd', 'content': 'General'}, {'type': 'accessrestrict', 'content': 'Access'}]) record = client.get_record(uri) assert record['notes'][0]['type'] == 'odd' assert record['notes'][0]['subnotes'][0]['content'] == 'General' assert record['notes'][1]['type'] == 'accessrestrict' assert record['notes'][1]['subnotes'][0]['content'] == 'Access'
def test_add_child_resource_component(): client = ArchivesSpaceClient(**AUTH) uri = client.add_child('/repositories/2/archival_objects/1', title='Test child', level='item') assert uri == '/repositories/2/archival_objects/5'