From 3dcf65d7b70dcafe488a7797122ab07d9e16e26e Mon Sep 17 00:00:00 2001 From: Douglas Cerna Date: Wed, 3 Jul 2024 14:04:54 -0600 Subject: [PATCH] Remove vcrpy dependency --- pyproject.toml | 1 - requirements-dev.txt | 30 +- .../atom/test_add_child_resource.yaml | 31 - .../test_add_child_resource_component.yaml | 31 - .../atom/test_add_digital_object.yaml | 31 - .../atom/test_adding_child_with_note.yaml | 31 - tests/fixtures/atom/test_augment_ids.yaml | 160 -- tests/fixtures/atom/test_collection_list.yaml | 29 - .../atom/test_count_collection_ids.yaml | 28 - .../test_count_collection_ids_search.yaml | 28 - tests/fixtures/atom/test_date_expression.yaml | 55 - .../atom/test_delete_record_resource.yaml | 80 - .../atom/test_edit_archival_object.yaml | 110 -- .../atom/test_edit_record_empty_note.yaml | 116 -- tests/fixtures/atom/test_empty_dates.yaml | 295 --- .../atom/test_find_collection_ids.yaml | 28 - .../atom/test_find_collection_ids_search.yaml | 28 - .../atom/test_find_collections_search.yaml | 114 -- ...st_find_collections_search_no_results.yaml | 27 - ...nent_parent_with_non_top_level_parent.yaml | 54 - ...omponent_parent_with_top_level_parent.yaml | 54 - .../atom/test_find_resource_children.yaml | 107 -- ...resource_children_recursion_level_two.yaml | 81 - ...onent_children_at_max_recursion_level.yaml | 54 - .../atom/test_identifier_exact_match.yaml | 159 -- .../atom/test_levels_of_description.yaml | 27 - .../atom/test_listing_collections.yaml | 188 -- ...est_listing_collections_search_spaces.yaml | 80 - .../atom/test_listing_collections_sort.yaml | 387 ---- tests/fixtures/atom/test_note.yaml | 193 -- .../atom/test_posting_contentless_note.yaml | 56 - tests/fixtures/test_add_child_resource.yaml | 71 - .../test_add_child_resource_component.yaml | 73 - tests/fixtures/test_add_digital_object.yaml | 138 -- .../test_add_digital_object_component.yaml | 74 - .../test_add_digital_object_note.yaml | 160 -- ...t_add_nested_digital_object_component.yaml | 99 - ...ct_to_a_record_with_a_singlepart_note.yaml | 147 -- .../fixtures/test_adding_child_with_note.yaml | 77 - tests/fixtures/test_augment_ids.yaml | 156 -- tests/fixtures/test_client_logout.yaml | 47 - tests/fixtures/test_contentless_notes.yaml | 139 -- tests/fixtures/test_count_collection_ids.yaml | 49 - .../test_count_collection_ids_search.yaml | 47 - tests/fixtures/test_date_expression.yaml | 75 - .../test_delete_record_archival_object.yaml | 93 - .../fixtures/test_delete_record_resource.yaml | 92 - tests/fixtures/test_edit_archival_object.yaml | 134 -- .../fixtures/test_edit_record_empty_note.yaml | 157 -- .../test_edit_record_multiple_notes.yaml | 107 -- tests/fixtures/test_empty_dates.yaml | 225 --- tests/fixtures/test_find_by_id_refid.yaml | 48 - tests/fixtures/test_find_collection_ids.yaml | 70 - .../test_find_collection_ids_search.yaml | 47 - .../fixtures/test_find_component_parent.yaml | 68 - .../fixtures/test_find_resource_children.yaml | 158 -- ...ource_children_at_max_recursion_level.yaml | 83 - ...test_find_resource_children_recursion.yaml | 160 -- ...onent_children_at_max_recursion_level.yaml | 77 - tests/fixtures/test_find_resource_id.yaml | 46 - .../fixtures/test_identifier_exact_match.yaml | 124 -- tests/fixtures/test_identifier_wildcard.yaml | 241 --- tests/fixtures/test_listing_collections.yaml | 101 -- .../test_listing_collections_search.yaml | 115 -- ...est_listing_collections_search_spaces.yaml | 74 - .../test_listing_collections_sort.yaml | 177 -- .../test_posting_contentless_note.yaml | 98 - .../fixtures/test_posting_multiple_notes.yaml | 104 -- tests/fixtures/test_resource_type.yaml | 24 - tests/fixtures/test_singlepart_note.yaml | 109 -- tests/test_archivesspace_client.py | 1608 +++++++++++++++-- tests/test_atom_client.py | 799 ++++++-- 72 files changed, 2196 insertions(+), 6988 deletions(-) delete mode 100644 tests/fixtures/atom/test_add_child_resource.yaml delete mode 100644 tests/fixtures/atom/test_add_child_resource_component.yaml delete mode 100644 tests/fixtures/atom/test_add_digital_object.yaml delete mode 100644 tests/fixtures/atom/test_adding_child_with_note.yaml delete mode 100644 tests/fixtures/atom/test_augment_ids.yaml delete mode 100644 tests/fixtures/atom/test_collection_list.yaml delete mode 100644 tests/fixtures/atom/test_count_collection_ids.yaml delete mode 100644 tests/fixtures/atom/test_count_collection_ids_search.yaml delete mode 100644 tests/fixtures/atom/test_date_expression.yaml delete mode 100644 tests/fixtures/atom/test_delete_record_resource.yaml delete mode 100644 tests/fixtures/atom/test_edit_archival_object.yaml delete mode 100644 tests/fixtures/atom/test_edit_record_empty_note.yaml delete mode 100644 tests/fixtures/atom/test_empty_dates.yaml delete mode 100644 tests/fixtures/atom/test_find_collection_ids.yaml delete mode 100644 tests/fixtures/atom/test_find_collection_ids_search.yaml delete mode 100644 tests/fixtures/atom/test_find_collections_search.yaml delete mode 100644 tests/fixtures/atom/test_find_collections_search_no_results.yaml delete mode 100644 tests/fixtures/atom/test_find_component_parent_with_non_top_level_parent.yaml delete mode 100644 tests/fixtures/atom/test_find_component_parent_with_top_level_parent.yaml delete mode 100644 tests/fixtures/atom/test_find_resource_children.yaml delete mode 100644 tests/fixtures/atom/test_find_resource_children_recursion_level_two.yaml delete mode 100644 tests/fixtures/atom/test_find_resource_component_children_at_max_recursion_level.yaml delete mode 100644 tests/fixtures/atom/test_identifier_exact_match.yaml delete mode 100644 tests/fixtures/atom/test_levels_of_description.yaml delete mode 100644 tests/fixtures/atom/test_listing_collections.yaml delete mode 100644 tests/fixtures/atom/test_listing_collections_search_spaces.yaml delete mode 100644 tests/fixtures/atom/test_listing_collections_sort.yaml delete mode 100644 tests/fixtures/atom/test_note.yaml delete mode 100644 tests/fixtures/atom/test_posting_contentless_note.yaml delete mode 100644 tests/fixtures/test_add_child_resource.yaml delete mode 100644 tests/fixtures/test_add_child_resource_component.yaml delete mode 100644 tests/fixtures/test_add_digital_object.yaml delete mode 100644 tests/fixtures/test_add_digital_object_component.yaml delete mode 100644 tests/fixtures/test_add_digital_object_note.yaml delete mode 100644 tests/fixtures/test_add_nested_digital_object_component.yaml delete mode 100644 tests/fixtures/test_adding_a_digital_object_to_a_record_with_a_singlepart_note.yaml delete mode 100644 tests/fixtures/test_adding_child_with_note.yaml delete mode 100644 tests/fixtures/test_augment_ids.yaml delete mode 100644 tests/fixtures/test_client_logout.yaml delete mode 100644 tests/fixtures/test_contentless_notes.yaml delete mode 100644 tests/fixtures/test_count_collection_ids.yaml delete mode 100644 tests/fixtures/test_count_collection_ids_search.yaml delete mode 100644 tests/fixtures/test_date_expression.yaml delete mode 100644 tests/fixtures/test_delete_record_archival_object.yaml delete mode 100644 tests/fixtures/test_delete_record_resource.yaml delete mode 100644 tests/fixtures/test_edit_archival_object.yaml delete mode 100644 tests/fixtures/test_edit_record_empty_note.yaml delete mode 100644 tests/fixtures/test_edit_record_multiple_notes.yaml delete mode 100644 tests/fixtures/test_empty_dates.yaml delete mode 100644 tests/fixtures/test_find_by_id_refid.yaml delete mode 100644 tests/fixtures/test_find_collection_ids.yaml delete mode 100644 tests/fixtures/test_find_collection_ids_search.yaml delete mode 100644 tests/fixtures/test_find_component_parent.yaml delete mode 100644 tests/fixtures/test_find_resource_children.yaml delete mode 100644 tests/fixtures/test_find_resource_children_at_max_recursion_level.yaml delete mode 100644 tests/fixtures/test_find_resource_children_recursion.yaml delete mode 100644 tests/fixtures/test_find_resource_component_children_at_max_recursion_level.yaml delete mode 100644 tests/fixtures/test_find_resource_id.yaml delete mode 100644 tests/fixtures/test_identifier_exact_match.yaml delete mode 100644 tests/fixtures/test_identifier_wildcard.yaml delete mode 100644 tests/fixtures/test_listing_collections.yaml delete mode 100644 tests/fixtures/test_listing_collections_search.yaml delete mode 100644 tests/fixtures/test_listing_collections_search_spaces.yaml delete mode 100644 tests/fixtures/test_listing_collections_sort.yaml delete mode 100644 tests/fixtures/test_posting_contentless_note.yaml delete mode 100644 tests/fixtures/test_posting_multiple_notes.yaml delete mode 100644 tests/fixtures/test_resource_type.yaml delete mode 100644 tests/fixtures/test_singlepart_note.yaml diff --git a/pyproject.toml b/pyproject.toml index 8996687..1faaaa9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -61,7 +61,6 @@ dev = [ "pytest-mock", "pytest", "ruff", - "vcrpy", ] [tool.setuptools.dynamic] diff --git a/requirements-dev.txt b/requirements-dev.txt index f1d0398..fcaf464 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -12,22 +12,18 @@ charset-normalizer==3.3.2 # via requests click==8.1.7 # via pip-tools -coverage[toml]==7.5.3 +coverage[toml]==7.5.4 # via # agentarchives (pyproject.toml) # pytest-cov exceptiongroup==1.2.1 # via pytest idna==3.7 - # via - # requests - # yarl -importlib-metadata==7.1.0 + # via requests +importlib-metadata==8.0.0 # via build iniconfig==2.0.0 # via pytest -multidict==6.0.5 - # via yarl mysqlclient==2.2.4 # via agentarchives (pyproject.toml) packaging==24.1 @@ -51,11 +47,9 @@ pytest-cov==5.0.0 # via agentarchives (pyproject.toml) pytest-mock==3.14.0 # via agentarchives (pyproject.toml) -pyyaml==6.0.1 - # via vcrpy requests==2.32.3 # via agentarchives (pyproject.toml) -ruff==0.4.9 +ruff==0.5.0 # via agentarchives (pyproject.toml) tomli==2.0.1 # via @@ -63,23 +57,15 @@ tomli==2.0.1 # coverage # pip-tools # pytest -urllib3==1.26.19 - # via - # requests - # vcrpy -vcrpy==6.0.1 - # via agentarchives (pyproject.toml) +urllib3==2.2.2 + # via requests wheel==0.43.0 # via pip-tools -wrapt==1.16.0 - # via vcrpy -yarl==1.9.4 - # via vcrpy zipp==3.19.2 # via importlib-metadata # The following packages are considered to be unsafe in a requirements file: -pip==24.0 +pip==24.1.1 # via pip-tools -setuptools==70.1.0 +setuptools==70.2.0 # via pip-tools diff --git a/tests/fixtures/atom/test_add_child_resource.yaml b/tests/fixtures/atom/test_add_child_resource.yaml deleted file mode 100644 index 849bb4b..0000000 --- a/tests/fixtures/atom/test_add_child_resource.yaml +++ /dev/null @@ -1,31 +0,0 @@ -interactions: -- request: - body: '{"level_of_description": "subfonds", "notes": [], "parent_slug": "test-fonds", - "title": "Second subfonds"}' - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['106'] - Content-type: [application/json] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: POST - uri: http://127.0.0.1/api/informationobjects - response: - body: {string: !!python/unicode '{"id":463,"slug":"second-subfonds","parent_id":436}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['51'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 29 Mar 2016 21:10:55 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=100'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - set-cookie: [symfony=2pfjc5h6p6a8k2d0obraubnck0; path=/; HttpOnly, symfony=a8mr48sspdgof17k6ju2t56rs4; - path=/ica-atom; HttpOnly] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 201, message: Created} -version: 1 diff --git a/tests/fixtures/atom/test_add_child_resource_component.yaml b/tests/fixtures/atom/test_add_child_resource_component.yaml deleted file mode 100644 index 6eb99cd..0000000 --- a/tests/fixtures/atom/test_add_child_resource_component.yaml +++ /dev/null @@ -1,31 +0,0 @@ -interactions: -- request: - body: '{"level_of_description": "item", "notes": [], "parent_slug": "second-subfonds", - "title": "Test child"}' - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['102'] - Content-type: [application/json] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: POST - uri: http://127.0.0.1/api/informationobjects - response: - body: {string: !!python/unicode '{"id":464,"slug":"test-child","parent_id":463}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['46'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 29 Mar 2016 21:10:55 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=100'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - set-cookie: [symfony=vi8nonlsfsleak8lmr6g6ofbl2; path=/; HttpOnly, symfony=d8e04q28f769b2a4jojoc9a5v7; - path=/ica-atom; HttpOnly] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 201, message: Created} -version: 1 diff --git a/tests/fixtures/atom/test_add_digital_object.yaml b/tests/fixtures/atom/test_add_digital_object.yaml deleted file mode 100644 index 75e7616..0000000 --- a/tests/fixtures/atom/test_add_digital_object.yaml +++ /dev/null @@ -1,31 +0,0 @@ -interactions: -- request: - body: '{"media_type": "text", "uri": "http://www.artefactual.com/wp-content/uploads/2016/04/cat.jpg", - "information_object_slug": "test-child", "name": "kitty.jpg"}' - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['156'] - Content-type: [application/json] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: POST - uri: http://127.0.0.1/api/digitalobjects - response: - body: {string: !!python/unicode '{"id":478,"slug":"kitty-jpg"}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['29'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 19 Apr 2016 03:48:29 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=100'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - set-cookie: [symfony=eoto6ut2nkbejvarp4k3iknkm6; path=/; HttpOnly, symfony=g5brdvdhv60ucsa4m9umbq1ou2; - path=/; HttpOnly] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 201, message: Created} -version: 1 diff --git a/tests/fixtures/atom/test_adding_child_with_note.yaml b/tests/fixtures/atom/test_adding_child_with_note.yaml deleted file mode 100644 index a2d0860..0000000 --- a/tests/fixtures/atom/test_adding_child_with_note.yaml +++ /dev/null @@ -1,31 +0,0 @@ -interactions: -- request: - body: '{"level_of_description": "subfonds", "notes": [{"content": "This is a test - note", "type": "general"}], "parent_slug": "test-fonds", "title": "Another subfonds"}' - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['160'] - Content-type: [application/json] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: POST - uri: http://127.0.0.1/api/informationobjects - response: - body: {string: !!python/unicode '{"id":465,"slug":"another-subfonds","parent_id":436}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['52'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 29 Mar 2016 21:10:55 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=100'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - set-cookie: [symfony=s1pnscpqle5j9jedbvjsd211l7; path=/; HttpOnly, symfony=g4u62jqlpjreisv08qe09ustp0; - path=/ica-atom; HttpOnly] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 201, message: Created} -version: 1 diff --git a/tests/fixtures/atom/test_augment_ids.yaml b/tests/fixtures/atom/test_augment_ids.yaml deleted file mode 100644 index 06d5e46..0000000 --- a/tests/fixtures/atom/test_augment_ids.yaml +++ /dev/null @@ -1,160 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects/tree/top-level-fonds - response: - body: {string: !!python/unicode '{"title":"Top Fonds","identifier":"toplevelfonds","slug":"top-level-fonds","children":[{"title":"Dawg - Child","identifier":"dogchild","slug":"child-of-top-level","level":"Subfonds","children":[{"title":"Dawg - Item","identifier":"dogitem","slug":"item-level","level":"Item"}]}]}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['275'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 29 Mar 2016 21:10:55 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=100'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - set-cookie: [symfony=srlemcbml67cubcjaoq03rtdt1; path=/; HttpOnly] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Cookie: [symfony=srlemcbml67cubcjaoq03rtdt1] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects/top-level-fonds - response: - body: {string: !!python/unicode '{"reference_code":"toplevelfonds","title":"Top - Fonds","publication_status":"Published"}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['87'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 29 Mar 2016 21:10:55 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=99'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Cookie: [symfony=srlemcbml67cubcjaoq03rtdt1] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects/child-of-top-level - response: - body: {string: !!python/unicode '{"parent":"top-level-fonds","reference_code":"toplevelfonds-dogchild","title":"Dawg - Child","publication_status":"Published","level_of_description":"Subfonds"}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['158'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 29 Mar 2016 21:10:55 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=98'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Cookie: [symfony=srlemcbml67cubcjaoq03rtdt1] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects/tree/test-fonds - response: - body: {string: !!python/unicode '{"title":"Test fonds","identifier":"testfonds","slug":"test-fonds","level":"Fonds","children":[{"title":"Test - subfonds","identifier":"testsubfonds","slug":"test-subfonds","level":"Subfonds","children":[{"title":"Test - item","identifier":"testitem","slug":"test-item","level":"Item"}]}]}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['285'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 29 Mar 2016 21:10:55 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=97'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Cookie: [symfony=srlemcbml67cubcjaoq03rtdt1] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects/test-fonds - response: - body: {string: !!python/unicode '{"reference_code":"testfonds","title":"Test fonds","publication_status":"Draft","level_of_description":"Fonds","notes":["Note - content"]}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['136'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 29 Mar 2016 21:10:55 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=96'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Cookie: [symfony=srlemcbml67cubcjaoq03rtdt1] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects/test-subfonds - response: - body: {string: !!python/unicode '{"parent":"test-fonds","reference_code":"testfonds-testsubfonds","title":"Test - subfonds","publication_status":"Draft","level_of_description":"Subfonds"}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['152'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 29 Mar 2016 21:10:55 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=95'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -version: 1 diff --git a/tests/fixtures/atom/test_collection_list.yaml b/tests/fixtures/atom/test_collection_list.yaml deleted file mode 100644 index 684ec3a..0000000 --- a/tests/fixtures/atom/test_collection_list.yaml +++ /dev/null @@ -1,29 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects/tree/test-fonds - response: - body: {string: !!python/unicode '{"title":"Test fonds","identifier":"testfonds","slug":"test-fonds","level":"Fonds","children":[{"title":"Test - subfonds","identifier":"testsubfonds","slug":"test-subfonds","level":"Subfonds","children":[{"title":"Test - item","identifier":"testitem","slug":"test-item","level":"Item"}]}]}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['285'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 29 Mar 2016 21:10:53 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=100'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - set-cookie: [symfony=17u4tcuj7sc9rhs5vo0nadst27; path=/ica-atom; HttpOnly] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -version: 1 diff --git a/tests/fixtures/atom/test_count_collection_ids.yaml b/tests/fixtures/atom/test_count_collection_ids.yaml deleted file mode 100644 index 532e21b..0000000 --- a/tests/fixtures/atom/test_count_collection_ids.yaml +++ /dev/null @@ -1,28 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects?skip=0&sq0=&topLod=1&limit=50&sf0=_all - response: - body: {string: !!python/unicode '{"total":2,"results":[{"reference_code":"toplevelfonds","slug":"top-level-fonds","title":"Top - Fonds"},{"reference_code":"testfonds","slug":"test-fonds","title":"Test fonds","level_of_description":"Fonds"}]}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['206'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 29 Mar 2016 21:10:55 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=100'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - set-cookie: [symfony=3fovbubheu53v3a4ndc3l9d1k4; path=/; HttpOnly] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -version: 1 diff --git a/tests/fixtures/atom/test_count_collection_ids_search.yaml b/tests/fixtures/atom/test_count_collection_ids_search.yaml deleted file mode 100644 index d1ea143..0000000 --- a/tests/fixtures/atom/test_count_collection_ids_search.yaml +++ /dev/null @@ -1,28 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects?skip=0&sq0=%22Top%22&topLod=1&limit=50&sf0=_all - response: - body: {string: !!python/unicode '{"total":1,"results":[{"reference_code":"F1","slug":"top-level-fonds","title":"Top - Fonds"}]}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['92'] - content-type: [application/json; charset=utf-8] - date: ['Wed, 20 Apr 2016 02:32:33 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=100'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - set-cookie: [symfony=5vemusdjh74g34g7lveqs7pps1; path=/; HttpOnly] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -version: 1 diff --git a/tests/fixtures/atom/test_date_expression.yaml b/tests/fixtures/atom/test_date_expression.yaml deleted file mode 100644 index 381e268..0000000 --- a/tests/fixtures/atom/test_date_expression.yaml +++ /dev/null @@ -1,55 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects/tree/second-subfonds - response: - body: {string: !!python/unicode '{"title":"Test edited subseries w\/ empty note","identifier":null,"slug":"second-subfonds","level":"Subfonds","children":[{"title":"Test - child","identifier":null,"slug":"test-child","level":"Item"}]}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['199'] - content-type: [application/json; charset=utf-8] - date: ['Mon, 18 Apr 2016 05:38:36 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=100'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - set-cookie: [symfony=od6m6rjhua9adk8buh6nuhfq84; path=/; HttpOnly] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Cookie: [symfony=od6m6rjhua9adk8buh6nuhfq84] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects/second-subfonds - response: - body: {string: !!python/unicode '{"parent":"test-fonds","title":"Test edited subseries - w\/ empty note","publication_status":"Published","level_of_description":"Subfonds","dates":[{"date":"November, - 2014 to November, 2015","start_date":"2014-11-01","end_date":"2015-11-01","type":"Creation"}]}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['259'] - content-type: [application/json; charset=utf-8] - date: ['Mon, 18 Apr 2016 05:38:36 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=99'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -version: 1 diff --git a/tests/fixtures/atom/test_delete_record_resource.yaml b/tests/fixtures/atom/test_delete_record_resource.yaml deleted file mode 100644 index 9ab19de..0000000 --- a/tests/fixtures/atom/test_delete_record_resource.yaml +++ /dev/null @@ -1,80 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects/another-subfonds - response: - body: {string: !!python/unicode '{"parent":"test-fonds","title":"Another subfonds","publication_status":"Published","level_of_description":"Subfonds","notes":["This - is a test note"]}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['149'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 29 Mar 2016 21:10:55 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=100'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - set-cookie: [symfony=sf0bqge9b6632hp613eciag3l7; path=/ica-atom; HttpOnly] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['0'] - Cookie: [symfony=sf0bqge9b6632hp613eciag3l7] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: DELETE - uri: http://127.0.0.1/api/informationobjects/another-subfonds - response: - body: {string: !!python/unicode ''} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['0'] - content-type: [text/html; charset=utf-8] - date: ['Tue, 29 Mar 2016 21:10:55 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=99'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - set-cookie: [symfony=8mlrmak0gkv42uuiadef1np714; path=/ica-atom; HttpOnly] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 204, message: No Content} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Cookie: [symfony=8mlrmak0gkv42uuiadef1np714] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects/another-subfonds - response: - body: {string: !!python/unicode ''} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['0'] - content-type: [text/html; charset=utf-8] - date: ['Tue, 29 Mar 2016 21:10:55 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=98'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 404, message: Information object not found} -version: 1 diff --git a/tests/fixtures/atom/test_edit_archival_object.yaml b/tests/fixtures/atom/test_edit_archival_object.yaml deleted file mode 100644 index 931d858..0000000 --- a/tests/fixtures/atom/test_edit_archival_object.yaml +++ /dev/null @@ -1,110 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects/second-subfonds - response: - body: {string: !!python/unicode '{"parent":"test-fonds","title":"Second subfonds","publication_status":"Published","level_of_description":"Subfonds","dates":[{"end_date":"2015-01-01","type":"Creation"}]}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['170'] - content-type: [application/json; charset=utf-8] - date: ['Wed, 30 Mar 2016 04:31:37 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=100'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - set-cookie: [symfony=ge313ua9klqk1vjtinvnk20lj7; path=/; HttpOnly] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Cookie: [symfony=ge313ua9klqk1vjtinvnk20lj7] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects/second-subfonds - response: - body: {string: !!python/unicode '{"parent":"test-fonds","title":"Second subfonds","publication_status":"Published","level_of_description":"Subfonds","dates":[{"end_date":"2015-01-01","type":"Creation"}]}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['170'] - content-type: [application/json; charset=utf-8] - date: ['Wed, 30 Mar 2016 04:31:37 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=99'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -- request: - body: '{"publication_status": "Published", "dates": [{"date": "November, 2014 - to November, 2015", "start_date": "2014-11-01", "end_date": "2015-11-01"}], - "parent": "test-fonds", "title": "Test edited subfonds", "notes": [{"content": - "This is a test note", "type": "general"}], "level_of_description": "Subfonds"}' - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['305'] - Content-type: [application/json] - Cookie: [symfony=ge313ua9klqk1vjtinvnk20lj7] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: PUT - uri: http://127.0.0.1/api/informationobjects/second-subfonds - response: - body: {string: !!python/unicode '{"id":463,"parent_id":436}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['26'] - content-type: [application/json; charset=utf-8] - date: ['Wed, 30 Mar 2016 04:31:37 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=98'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - set-cookie: [symfony=tgt7oobl488t9jle9fbshllmg6; path=/; HttpOnly] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Cookie: [symfony=tgt7oobl488t9jle9fbshllmg6] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects/second-subfonds - response: - body: {string: !!python/unicode '{"parent":"test-fonds","title":"Test edited subfonds","publication_status":"Published","level_of_description":"Subfonds","dates":[{"date":"November, - 2014 to November, 2015","start_date":"2014-11-01","end_date":"2015-11-01","type":"Creation"}],"notes":["This - is a test note"]}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['275'] - content-type: [application/json; charset=utf-8] - date: ['Wed, 30 Mar 2016 04:31:37 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=97'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -version: 1 diff --git a/tests/fixtures/atom/test_edit_record_empty_note.yaml b/tests/fixtures/atom/test_edit_record_empty_note.yaml deleted file mode 100644 index 2b86c33..0000000 --- a/tests/fixtures/atom/test_edit_record_empty_note.yaml +++ /dev/null @@ -1,116 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects/second-subfonds - response: - body: {string: !!python/unicode '{"parent":"test-fonds","title":"Test edited subseries - w\/ empty note","publication_status":"Published","level_of_description":"Subfonds","dates":[{"date":"November, - 2014 to November, 2015","start_date":"2014-11-01","end_date":"2015-11-01","type":"Creation"}],"notes":["Gen - note"]}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['280'] - content-type: [application/json; charset=utf-8] - date: ['Sun, 17 Apr 2016 08:37:38 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=100'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - set-cookie: [symfony=vhhfjsuddobcl7vcmodg0p9cc5; path=/; HttpOnly] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Cookie: [symfony=vhhfjsuddobcl7vcmodg0p9cc5] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects/second-subfonds - response: - body: {string: !!python/unicode '{"parent":"test-fonds","title":"Test edited subseries - w\/ empty note","publication_status":"Published","level_of_description":"Subfonds","dates":[{"date":"November, - 2014 to November, 2015","start_date":"2014-11-01","end_date":"2015-11-01","type":"Creation"}],"notes":["Gen - note"]}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['280'] - content-type: [application/json; charset=utf-8] - date: ['Sun, 17 Apr 2016 08:37:38 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=99'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -- request: - body: '{"publication_status": "Published", "dates": [{"date": "November, 2014 - to November, 2015", "start_date": "2014-11-01", "end_date": "2015-11-01"}], - "parent": "test-fonds", "title": "Test edited subseries w/ empty note", "notes": - [{"content": "", "type": "general"}], "level_of_description": "Subfonds"}' - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['301'] - Content-type: [application/json] - Cookie: [symfony=vhhfjsuddobcl7vcmodg0p9cc5] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: PUT - uri: http://127.0.0.1/api/informationobjects/second-subfonds - response: - body: {string: !!python/unicode '{"id":463,"parent_id":436}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['26'] - content-type: [application/json; charset=utf-8] - date: ['Sun, 17 Apr 2016 08:37:38 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=98'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - set-cookie: [symfony=j2sqetsq0ki852pv58e7sgn5k0; path=/; HttpOnly] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Cookie: [symfony=j2sqetsq0ki852pv58e7sgn5k0] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects/second-subfonds - response: - body: {string: !!python/unicode '{"parent":"test-fonds","title":"Test edited subseries - w\/ empty note","publication_status":"Published","level_of_description":"Subfonds","dates":[{"date":"November, - 2014 to November, 2015","start_date":"2014-11-01","end_date":"2015-11-01","type":"Creation"}]}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['259'] - content-type: [application/json; charset=utf-8] - date: ['Sun, 17 Apr 2016 08:37:38 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=97'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -version: 1 diff --git a/tests/fixtures/atom/test_empty_dates.yaml b/tests/fixtures/atom/test_empty_dates.yaml deleted file mode 100644 index 59ce432..0000000 --- a/tests/fixtures/atom/test_empty_dates.yaml +++ /dev/null @@ -1,295 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects/tree/test-child - response: - body: {string: !!python/unicode '{"title":"Test child","identifier":null,"slug":"test-child","level":"Item"}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['75'] - content-type: [application/json; charset=utf-8] - date: ['Mon, 18 Apr 2016 06:19:54 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=100'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - set-cookie: [symfony=e46f5vca29tg78h3lj2dipusp0; path=/; HttpOnly] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Cookie: [symfony=e46f5vca29tg78h3lj2dipusp0] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects/test-child - response: - body: {string: !!python/unicode '{"parent":"second-subfonds","title":"Test child","publication_status":"Published","level_of_description":"Item"}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['112'] - content-type: [application/json; charset=utf-8] - date: ['Mon, 18 Apr 2016 06:19:54 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=99'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Cookie: [symfony=e46f5vca29tg78h3lj2dipusp0] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects/tree/test-child - response: - body: {string: !!python/unicode '{"title":"Test child","identifier":null,"slug":"test-child","level":"Item"}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['75'] - content-type: [application/json; charset=utf-8] - date: ['Mon, 18 Apr 2016 06:19:54 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=98'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Cookie: [symfony=e46f5vca29tg78h3lj2dipusp0] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects/test-child - response: - body: {string: !!python/unicode '{"parent":"second-subfonds","title":"Test child","publication_status":"Published","level_of_description":"Item"}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['112'] - content-type: [application/json; charset=utf-8] - date: ['Mon, 18 Apr 2016 06:19:54 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=97'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Cookie: [symfony=e46f5vca29tg78h3lj2dipusp0] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects?skip=0&sq0=&topLod=1&limit=30&sf0=_all - response: - body: {string: !!python/unicode '{"total":2,"results":[{"reference_code":"testfonds","slug":"test-fonds","title":"Test - fonds","level_of_description":"Fonds"},{"reference_code":"toplevelfonds","slug":"top-level-fonds","title":"Top - Fonds"}]}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['206'] - content-type: [application/json; charset=utf-8] - date: ['Mon, 18 Apr 2016 06:19:54 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=96'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Cookie: [symfony=e46f5vca29tg78h3lj2dipusp0] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects/test-fonds - response: - body: {string: !!python/unicode '{"reference_code":"testfonds","title":"Test fonds","publication_status":"Draft","level_of_description":"Fonds","dates":[{"start_date":"2014-01-01","end_date":"2015-01-01","type":"Creation"}],"notes":["Note - content"]}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['216'] - content-type: [application/json; charset=utf-8] - date: ['Mon, 18 Apr 2016 06:19:54 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=95'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Cookie: [symfony=e46f5vca29tg78h3lj2dipusp0] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects/tree/test-fonds - response: - body: {string: !!python/unicode '{"title":"Test fonds","identifier":"testfonds","slug":"test-fonds","level":"Fonds","children":[{"title":"Test - subfonds","identifier":"testsubfonds","slug":"test-subfonds","level":"Subfonds","children":[{"title":"Test - item","identifier":"testitem","slug":"test-item","level":"Item"}]},{"title":"Test - edited subseries w\/ empty note","identifier":null,"slug":"second-subfonds","level":"Subfonds","children":[{"title":"Test - child","identifier":null,"slug":"test-child","level":"Item"}]},{"title":"Yet - another subfonds","identifier":null,"slug":"yet-another-subfonds","level":"Subfonds"}]}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['585'] - content-type: [application/json; charset=utf-8] - date: ['Mon, 18 Apr 2016 06:19:54 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=94'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Cookie: [symfony=e46f5vca29tg78h3lj2dipusp0] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects/tree/test-fonds - response: - body: {string: !!python/unicode '{"title":"Test fonds","identifier":"testfonds","slug":"test-fonds","level":"Fonds","children":[{"title":"Test - subfonds","identifier":"testsubfonds","slug":"test-subfonds","level":"Subfonds","children":[{"title":"Test - item","identifier":"testitem","slug":"test-item","level":"Item"}]},{"title":"Test - edited subseries w\/ empty note","identifier":null,"slug":"second-subfonds","level":"Subfonds","children":[{"title":"Test - child","identifier":null,"slug":"test-child","level":"Item"}]},{"title":"Yet - another subfonds","identifier":null,"slug":"yet-another-subfonds","level":"Subfonds"}]}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['585'] - content-type: [application/json; charset=utf-8] - date: ['Mon, 18 Apr 2016 06:19:54 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=93'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Cookie: [symfony=e46f5vca29tg78h3lj2dipusp0] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects/top-level-fonds - response: - body: {string: !!python/unicode '{"reference_code":"toplevelfonds","title":"Top - Fonds","publication_status":"Published"}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['87'] - content-type: [application/json; charset=utf-8] - date: ['Mon, 18 Apr 2016 06:19:54 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=92'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Cookie: [symfony=e46f5vca29tg78h3lj2dipusp0] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects/tree/top-level-fonds - response: - body: {string: !!python/unicode '{"title":"Top Fonds","identifier":"toplevelfonds","slug":"top-level-fonds","children":[{"title":"Dawg - Child","identifier":"dogchild","slug":"child-of-top-level","level":"Subfonds","children":[{"title":"Dawg - Item","identifier":"dogitem","slug":"item-level","level":"Item"}]}]}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['275'] - content-type: [application/json; charset=utf-8] - date: ['Mon, 18 Apr 2016 06:19:54 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=91'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Cookie: [symfony=e46f5vca29tg78h3lj2dipusp0] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects/tree/top-level-fonds - response: - body: {string: !!python/unicode '{"title":"Top Fonds","identifier":"toplevelfonds","slug":"top-level-fonds","children":[{"title":"Dawg - Child","identifier":"dogchild","slug":"child-of-top-level","level":"Subfonds","children":[{"title":"Dawg - Item","identifier":"dogitem","slug":"item-level","level":"Item"}]}]}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['275'] - content-type: [application/json; charset=utf-8] - date: ['Mon, 18 Apr 2016 06:19:54 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=90'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -version: 1 diff --git a/tests/fixtures/atom/test_find_collection_ids.yaml b/tests/fixtures/atom/test_find_collection_ids.yaml deleted file mode 100644 index 2029504..0000000 --- a/tests/fixtures/atom/test_find_collection_ids.yaml +++ /dev/null @@ -1,28 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects?skip=0&sq0=&topLod=1&limit=50&sf0=_all - response: - body: {string: !!python/unicode '{"total":2,"results":[{"reference_code":"toplevelfonds","slug":"top-level-fonds","title":"Top - Fonds"},{"reference_code":"testfonds","slug":"test-fonds","title":"Test fonds","level_of_description":"Fonds"}]}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['206'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 29 Mar 2016 21:10:54 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=100'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - set-cookie: [symfony=044fbep5kchre4r65haabg4lp3; path=/; HttpOnly] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -version: 1 diff --git a/tests/fixtures/atom/test_find_collection_ids_search.yaml b/tests/fixtures/atom/test_find_collection_ids_search.yaml deleted file mode 100644 index 6c1b3e4..0000000 --- a/tests/fixtures/atom/test_find_collection_ids_search.yaml +++ /dev/null @@ -1,28 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects?skip=0&sq0=%22Test%5C+fonds%22&topLod=1&limit=50&sf0=_all - response: - body: {string: !!python/unicode '{"total":1,"results":[{"reference_code":"F2","slug":"test-fonds","title":"Test - fonds","level_of_description":"Fonds"}]}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['119'] - content-type: [application/json; charset=utf-8] - date: ['Wed, 20 Apr 2016 03:05:54 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=100'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - set-cookie: [symfony=72tr4rtmltfkrv1um4698igvo0; path=/; HttpOnly] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -version: 1 diff --git a/tests/fixtures/atom/test_find_collections_search.yaml b/tests/fixtures/atom/test_find_collections_search.yaml deleted file mode 100644 index 5f979e8..0000000 --- a/tests/fixtures/atom/test_find_collections_search.yaml +++ /dev/null @@ -1,114 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects?skip=0&sq0=%22Test%5C+fonds%22&topLod=1&limit=30&sf0=_all - response: - body: {string: !!python/unicode '{"total":1,"results":[{"reference_code":"F2","slug":"test-fonds","title":"Test - fonds","level_of_description":"Fonds"}]}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['119'] - content-type: [application/json; charset=utf-8] - date: ['Wed, 20 Apr 2016 02:10:33 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=100'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - set-cookie: [symfony=qnmqfttv93mj2vp8opr7faq9n5; path=/; HttpOnly] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Cookie: [symfony=qnmqfttv93mj2vp8opr7faq9n5] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects/test-fonds - response: - body: {string: !!python/unicode '{"reference_code":"F2","title":"Test fonds","publication_status":"Draft","level_of_description":"Fonds","dates":[{"start_date":"2014-01-01","end_date":"2015-01-01","type":"Creation"}],"notes":["Note - content"]}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['209'] - content-type: [application/json; charset=utf-8] - date: ['Wed, 20 Apr 2016 02:10:33 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=99'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Cookie: [symfony=qnmqfttv93mj2vp8opr7faq9n5] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects/tree/test-fonds - response: - body: {string: !!python/unicode '{"title":"Test fonds","identifier":"F2","slug":"test-fonds","level":"Fonds","children":[{"title":"Test - subfonds","identifier":"testsubfonds","slug":"test-subfonds","level":"Subfonds","children":[{"title":"Test - item","identifier":"testitem","slug":"test-item","level":"Item"}]},{"title":"Test - edited subseries w\/ empty note","identifier":null,"slug":"second-subfonds","level":"Subfonds","children":[{"title":"Test - child","identifier":null,"slug":"test-child","level":"Item"}]},{"title":"Yet - another subfonds","identifier":null,"slug":"yet-another-subfonds","level":"Subfonds"}]}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['578'] - content-type: [application/json; charset=utf-8] - date: ['Wed, 20 Apr 2016 02:10:33 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=98'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Cookie: [symfony=qnmqfttv93mj2vp8opr7faq9n5] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects/tree/test-fonds - response: - body: {string: !!python/unicode '{"title":"Test fonds","identifier":"F2","slug":"test-fonds","level":"Fonds","children":[{"title":"Test - subfonds","identifier":"testsubfonds","slug":"test-subfonds","level":"Subfonds","children":[{"title":"Test - item","identifier":"testitem","slug":"test-item","level":"Item"}]},{"title":"Test - edited subseries w\/ empty note","identifier":null,"slug":"second-subfonds","level":"Subfonds","children":[{"title":"Test - child","identifier":null,"slug":"test-child","level":"Item"}]},{"title":"Yet - another subfonds","identifier":null,"slug":"yet-another-subfonds","level":"Subfonds"}]}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['578'] - content-type: [application/json; charset=utf-8] - date: ['Wed, 20 Apr 2016 02:10:33 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=97'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -version: 1 diff --git a/tests/fixtures/atom/test_find_collections_search_no_results.yaml b/tests/fixtures/atom/test_find_collections_search_no_results.yaml deleted file mode 100644 index 44da1d9..0000000 --- a/tests/fixtures/atom/test_find_collections_search_no_results.yaml +++ /dev/null @@ -1,27 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects?skip=0&sq0=%22Nonexistent%22&topLod=1&limit=30&sf0=_all - response: - body: {string: !!python/unicode '{"total":0,"results":[]}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['24'] - content-type: [application/json; charset=utf-8] - date: ['Wed, 20 Apr 2016 02:33:25 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=100'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - set-cookie: [symfony=2lqlh79idlianavtmfjbbeupj1; path=/; HttpOnly] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -version: 1 diff --git a/tests/fixtures/atom/test_find_component_parent_with_non_top_level_parent.yaml b/tests/fixtures/atom/test_find_component_parent_with_non_top_level_parent.yaml deleted file mode 100644 index 830f465..0000000 --- a/tests/fixtures/atom/test_find_component_parent_with_non_top_level_parent.yaml +++ /dev/null @@ -1,54 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects/test-item - response: - body: {string: !!python/unicode '{"parent":"test-subfonds","reference_code":"testfonds-testsubfonds-testitem","title":"Test - item","publication_status":"Draft","level_of_description":"Item"}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['156'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 29 Mar 2016 21:10:54 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=100'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - set-cookie: [symfony=n4dg59rg5jaii9gmkduhportr2; path=/; HttpOnly] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Cookie: [symfony=n4dg59rg5jaii9gmkduhportr2] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects/test-subfonds - response: - body: {string: !!python/unicode '{"parent":"test-fonds","reference_code":"testfonds-testsubfonds","title":"Test - subfonds","publication_status":"Draft","level_of_description":"Subfonds"}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['152'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 29 Mar 2016 21:10:54 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=99'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -version: 1 diff --git a/tests/fixtures/atom/test_find_component_parent_with_top_level_parent.yaml b/tests/fixtures/atom/test_find_component_parent_with_top_level_parent.yaml deleted file mode 100644 index 5a959bd..0000000 --- a/tests/fixtures/atom/test_find_component_parent_with_top_level_parent.yaml +++ /dev/null @@ -1,54 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects/test-subfonds - response: - body: {string: !!python/unicode '{"parent":"test-fonds","reference_code":"testfonds-testsubfonds","title":"Test - subfonds","publication_status":"Draft","level_of_description":"Subfonds"}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['152'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 29 Mar 2016 21:10:54 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=100'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - set-cookie: [symfony=76l5nubifslo5eh44jofl0ea12; path=/; HttpOnly] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Cookie: [symfony=76l5nubifslo5eh44jofl0ea12] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects/test-fonds - response: - body: {string: !!python/unicode '{"reference_code":"testfonds","title":"Test fonds","publication_status":"Draft","level_of_description":"Fonds","notes":["Note - content"]}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['136'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 29 Mar 2016 21:10:54 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=99'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -version: 1 diff --git a/tests/fixtures/atom/test_find_resource_children.yaml b/tests/fixtures/atom/test_find_resource_children.yaml deleted file mode 100644 index 9284ea6..0000000 --- a/tests/fixtures/atom/test_find_resource_children.yaml +++ /dev/null @@ -1,107 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects/tree/test-fonds - response: - body: {string: !!python/unicode '{"title":"Test fonds","identifier":"testfonds","slug":"test-fonds","level":"Fonds","children":[{"title":"Test - subfonds","identifier":"testsubfonds","slug":"test-subfonds","level":"Subfonds","children":[{"title":"Test - item","identifier":"testitem","slug":"test-item","level":"Item"}]}]}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['285'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 29 Mar 2016 21:10:54 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=100'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - set-cookie: [symfony=5l69rp4c5l92tmd4i3qveoaie3; path=/; HttpOnly] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Cookie: [symfony=5l69rp4c5l92tmd4i3qveoaie3] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects/test-fonds - response: - body: {string: !!python/unicode '{"reference_code":"testfonds","title":"Test fonds","publication_status":"Draft","level_of_description":"Fonds","notes":["Note - content"]}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['136'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 29 Mar 2016 21:10:54 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=99'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Cookie: [symfony=5l69rp4c5l92tmd4i3qveoaie3] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects/test-subfonds - response: - body: {string: !!python/unicode '{"parent":"test-fonds","reference_code":"testfonds-testsubfonds","title":"Test - subfonds","publication_status":"Draft","level_of_description":"Subfonds"}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['152'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 29 Mar 2016 21:10:54 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=98'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Cookie: [symfony=5l69rp4c5l92tmd4i3qveoaie3] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects/test-item - response: - body: {string: !!python/unicode '{"parent":"test-subfonds","reference_code":"testfonds-testsubfonds-testitem","title":"Test - item","publication_status":"Draft","level_of_description":"Item"}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['156'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 29 Mar 2016 21:10:54 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=97'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -version: 1 diff --git a/tests/fixtures/atom/test_find_resource_children_recursion_level_two.yaml b/tests/fixtures/atom/test_find_resource_children_recursion_level_two.yaml deleted file mode 100644 index 1ee6249..0000000 --- a/tests/fixtures/atom/test_find_resource_children_recursion_level_two.yaml +++ /dev/null @@ -1,81 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects/tree/test-fonds - response: - body: {string: !!python/unicode '{"title":"Test fonds","identifier":"testfonds","slug":"test-fonds","level":"Fonds","children":[{"title":"Test - subfonds","identifier":"testsubfonds","slug":"test-subfonds","level":"Subfonds","children":[{"title":"Test - item","identifier":"testitem","slug":"test-item","level":"Item"}]}]}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['285'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 29 Mar 2016 21:10:54 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=100'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - set-cookie: [symfony=3ju9esq7947n2fdkm6ae3751n6; path=/ica-atom; HttpOnly] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Cookie: [symfony=3ju9esq7947n2fdkm6ae3751n6] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects/test-fonds - response: - body: {string: !!python/unicode '{"reference_code":"testfonds","title":"Test fonds","publication_status":"Draft","level_of_description":"Fonds","notes":["Note - content"]}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['136'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 29 Mar 2016 21:10:54 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=99'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Cookie: [symfony=3ju9esq7947n2fdkm6ae3751n6] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects/test-subfonds - response: - body: {string: !!python/unicode '{"parent":"test-fonds","reference_code":"testfonds-testsubfonds","title":"Test - subfonds","publication_status":"Draft","level_of_description":"Subfonds"}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['152'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 29 Mar 2016 21:10:54 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=98'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -version: 1 diff --git a/tests/fixtures/atom/test_find_resource_component_children_at_max_recursion_level.yaml b/tests/fixtures/atom/test_find_resource_component_children_at_max_recursion_level.yaml deleted file mode 100644 index 9936d0b..0000000 --- a/tests/fixtures/atom/test_find_resource_component_children_at_max_recursion_level.yaml +++ /dev/null @@ -1,54 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects/tree/test-subfonds - response: - body: {string: !!python/unicode '{"title":"Test subfonds","identifier":"testsubfonds","slug":"test-subfonds","level":"Subfonds","children":[{"title":"Test - item","identifier":"testitem","slug":"test-item","level":"Item"}]}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['188'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 29 Mar 2016 21:10:54 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=100'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - set-cookie: [symfony=s841n1bokv7pukbsvm0f12gve1; path=/; HttpOnly] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Cookie: [symfony=s841n1bokv7pukbsvm0f12gve1] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects/test-subfonds - response: - body: {string: !!python/unicode '{"parent":"test-fonds","reference_code":"testfonds-testsubfonds","title":"Test - subfonds","publication_status":"Draft","level_of_description":"Subfonds"}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['152'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 29 Mar 2016 21:10:54 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=99'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -version: 1 diff --git a/tests/fixtures/atom/test_identifier_exact_match.yaml b/tests/fixtures/atom/test_identifier_exact_match.yaml deleted file mode 100644 index f3a4834..0000000 --- a/tests/fixtures/atom/test_identifier_exact_match.yaml +++ /dev/null @@ -1,159 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects?skip=0&sq1=F1&sq0=&sf0=_all&sf1=identifier&limit=50&topLod=1 - response: - body: {string: !!python/unicode '{"total":1,"results":[{"reference_code":"F1","slug":"top-level-fonds","title":"Top - Fonds"}]}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['92'] - content-type: [application/json; charset=utf-8] - date: ['Wed, 20 Apr 2016 02:48:01 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=100'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - set-cookie: [symfony=a1od040v9p5v1inec7s0nh3bg0; path=/; HttpOnly] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Cookie: [symfony=a1od040v9p5v1inec7s0nh3bg0] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects?skip=0&sq1=F1&sq0=&sf0=_all&sf1=identifier&limit=50&topLod=1 - response: - body: {string: !!python/unicode '{"total":1,"results":[{"reference_code":"F1","slug":"top-level-fonds","title":"Top - Fonds"}]}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['92'] - content-type: [application/json; charset=utf-8] - date: ['Wed, 20 Apr 2016 02:48:02 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=99'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Cookie: [symfony=a1od040v9p5v1inec7s0nh3bg0] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects?skip=0&sq1=F1&sq0=&sf0=_all&sf1=identifier&limit=30&topLod=1 - response: - body: {string: !!python/unicode '{"total":1,"results":[{"reference_code":"F1","slug":"top-level-fonds","title":"Top - Fonds"}]}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['92'] - content-type: [application/json; charset=utf-8] - date: ['Wed, 20 Apr 2016 02:48:02 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=98'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Cookie: [symfony=a1od040v9p5v1inec7s0nh3bg0] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects/top-level-fonds - response: - body: {string: !!python/unicode '{"reference_code":"F1","title":"Top Fonds","publication_status":"Published"}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['76'] - content-type: [application/json; charset=utf-8] - date: ['Wed, 20 Apr 2016 02:48:02 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=97'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Cookie: [symfony=a1od040v9p5v1inec7s0nh3bg0] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects/tree/top-level-fonds - response: - body: {string: !!python/unicode '{"title":"Top Fonds","identifier":"F1","slug":"top-level-fonds","children":[{"title":"Dawg - Child","identifier":"dogchild","slug":"child-of-top-level","level":"Subfonds","children":[{"title":"Dawg - Item","identifier":"dogitem","slug":"item-level","level":"Item"}]}]}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['264'] - content-type: [application/json; charset=utf-8] - date: ['Wed, 20 Apr 2016 02:48:02 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=96'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Cookie: [symfony=a1od040v9p5v1inec7s0nh3bg0] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects/tree/top-level-fonds - response: - body: {string: !!python/unicode '{"title":"Top Fonds","identifier":"F1","slug":"top-level-fonds","children":[{"title":"Dawg - Child","identifier":"dogchild","slug":"child-of-top-level","level":"Subfonds","children":[{"title":"Dawg - Item","identifier":"dogitem","slug":"item-level","level":"Item"}]}]}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['264'] - content-type: [application/json; charset=utf-8] - date: ['Wed, 20 Apr 2016 02:48:02 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=95'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -version: 1 diff --git a/tests/fixtures/atom/test_levels_of_description.yaml b/tests/fixtures/atom/test_levels_of_description.yaml deleted file mode 100644 index 9a65290..0000000 --- a/tests/fixtures/atom/test_levels_of_description.yaml +++ /dev/null @@ -1,27 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/taxonomies/34 - response: - body: {string: !!python/unicode '[{"name":"Collection"},{"name":"File"},{"name":"Fonds"},{"name":"Item"},{"name":"Part"},{"name":"Series"},{"name":"Subfonds"},{"name":"Subseries"}]'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['147'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 29 Mar 2016 21:10:53 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=100'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - set-cookie: [symfony=su6c9atbn59n8fancsj1g6ubg4; path=/; HttpOnly] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -version: 1 diff --git a/tests/fixtures/atom/test_listing_collections.yaml b/tests/fixtures/atom/test_listing_collections.yaml deleted file mode 100644 index d6f9d95..0000000 --- a/tests/fixtures/atom/test_listing_collections.yaml +++ /dev/null @@ -1,188 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects?skip=0&sq0=&topLod=1&limit=30&sf0=_all - response: - body: {string: !!python/unicode '{"total":2,"results":[{"reference_code":"toplevelfonds","slug":"top-level-fonds","title":"Top - Fonds"},{"reference_code":"testfonds","slug":"test-fonds","title":"Test fonds","level_of_description":"Fonds"}]}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['206'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 29 Mar 2016 21:10:53 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=100'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - set-cookie: [symfony=7npobt1qt3ji3dluufj9rfcjb0; path=/ica-atom; HttpOnly] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Cookie: [symfony=7npobt1qt3ji3dluufj9rfcjb0] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects/top-level-fonds - response: - body: {string: !!python/unicode '{"reference_code":"toplevelfonds","title":"Top - Fonds","publication_status":"Published"}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['87'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 29 Mar 2016 21:10:53 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=99'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Cookie: [symfony=7npobt1qt3ji3dluufj9rfcjb0] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects/tree/top-level-fonds - response: - body: {string: !!python/unicode '{"title":"Top Fonds","identifier":"toplevelfonds","slug":"top-level-fonds","children":[{"title":"Dawg - Child","identifier":"dogchild","slug":"child-of-top-level","level":"Subfonds","children":[{"title":"Dawg - Item","identifier":"dogitem","slug":"item-level","level":"Item"}]}]}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['275'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 29 Mar 2016 21:10:53 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=98'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Cookie: [symfony=7npobt1qt3ji3dluufj9rfcjb0] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects/tree/top-level-fonds - response: - body: {string: !!python/unicode '{"title":"Top Fonds","identifier":"toplevelfonds","slug":"top-level-fonds","children":[{"title":"Dawg - Child","identifier":"dogchild","slug":"child-of-top-level","level":"Subfonds","children":[{"title":"Dawg - Item","identifier":"dogitem","slug":"item-level","level":"Item"}]}]}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['275'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 29 Mar 2016 21:10:53 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=97'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Cookie: [symfony=7npobt1qt3ji3dluufj9rfcjb0] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects/test-fonds - response: - body: {string: !!python/unicode '{"reference_code":"testfonds","title":"Test fonds","publication_status":"Draft","level_of_description":"Fonds","notes":["Note - content"]}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['136'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 29 Mar 2016 21:10:53 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=96'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Cookie: [symfony=7npobt1qt3ji3dluufj9rfcjb0] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects/tree/test-fonds - response: - body: {string: !!python/unicode '{"title":"Test fonds","identifier":"testfonds","slug":"test-fonds","level":"Fonds","children":[{"title":"Test - subfonds","identifier":"testsubfonds","slug":"test-subfonds","level":"Subfonds","children":[{"title":"Test - item","identifier":"testitem","slug":"test-item","level":"Item"}]}]}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['285'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 29 Mar 2016 21:10:53 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=95'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Cookie: [symfony=7npobt1qt3ji3dluufj9rfcjb0] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects/tree/test-fonds - response: - body: {string: !!python/unicode '{"title":"Test fonds","identifier":"testfonds","slug":"test-fonds","level":"Fonds","children":[{"title":"Test - subfonds","identifier":"testsubfonds","slug":"test-subfonds","level":"Subfonds","children":[{"title":"Test - item","identifier":"testitem","slug":"test-item","level":"Item"}]}]}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['285'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 29 Mar 2016 21:10:53 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=94'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -version: 1 diff --git a/tests/fixtures/atom/test_listing_collections_search_spaces.yaml b/tests/fixtures/atom/test_listing_collections_search_spaces.yaml deleted file mode 100644 index c49006c..0000000 --- a/tests/fixtures/atom/test_listing_collections_search_spaces.yaml +++ /dev/null @@ -1,80 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects?skip=0&sq1=2015044%5C+Aa%5C+Ac&sq0=&sf0=_all&sf1=identifier&limit=30&topLod=1 - response: - body: {string: !!python/unicode '{"total":1,"results":[{"reference_code":"2015044 - Aa Ac","slug":"a-fonds-for-testing","title":"Resource with spaces in the identifier","level_of_description":"Fonds"}]}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['167'] - content-type: [application/json; charset=utf-8] - date: ['Wed, 20 Apr 2016 03:06:12 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=100'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - set-cookie: [symfony=erk1m3g6pp744j8vmk3r842me4; path=/; HttpOnly] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Cookie: [symfony=erk1m3g6pp744j8vmk3r842me4] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects/a-fonds-for-testing - response: - body: {string: !!python/unicode '{"reference_code":"2015044 Aa Ac","title":"Resource - with spaces in the identifier","publication_status":"Draft","level_of_description":"Fonds"}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['143'] - content-type: [application/json; charset=utf-8] - date: ['Wed, 20 Apr 2016 03:06:12 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=99'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Cookie: [symfony=erk1m3g6pp744j8vmk3r842me4] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects/tree/a-fonds-for-testing - response: - body: {string: !!python/unicode '{"title":"Resource with spaces in the identifier","identifier":"2015044 - Aa Ac","slug":"a-fonds-for-testing","level":"Fonds"}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['124'] - content-type: [application/json; charset=utf-8] - date: ['Wed, 20 Apr 2016 03:06:12 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=98'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -version: 1 diff --git a/tests/fixtures/atom/test_listing_collections_sort.yaml b/tests/fixtures/atom/test_listing_collections_sort.yaml deleted file mode 100644 index 568b595..0000000 --- a/tests/fixtures/atom/test_listing_collections_sort.yaml +++ /dev/null @@ -1,387 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects?sort=alphabetic&skip=0&sq0=&sf0=_all&limit=30&topLod=1 - response: - body: {string: !!python/unicode '{"total":2,"results":[{"reference_code":"testfonds","slug":"test-fonds","title":"Test - fonds","level_of_description":"Fonds"},{"reference_code":"toplevelfonds","slug":"top-level-fonds","title":"Top - Fonds"}]}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['206'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 19 Apr 2016 19:11:51 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=100'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - set-cookie: [symfony=lcigprh19kj8v7dvmr6ivpjr54; path=/; HttpOnly] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Cookie: [symfony=lcigprh19kj8v7dvmr6ivpjr54] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects/test-fonds - response: - body: {string: !!python/unicode '{"reference_code":"testfonds","title":"Test fonds","publication_status":"Draft","level_of_description":"Fonds","dates":[{"start_date":"2014-01-01","end_date":"2015-01-01","type":"Creation"}],"notes":["Note - content"]}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['216'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 19 Apr 2016 19:11:51 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=99'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Cookie: [symfony=lcigprh19kj8v7dvmr6ivpjr54] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects/tree/test-fonds - response: - body: {string: !!python/unicode '{"title":"Test fonds","identifier":"testfonds","slug":"test-fonds","level":"Fonds","children":[{"title":"Test - subfonds","identifier":"testsubfonds","slug":"test-subfonds","level":"Subfonds","children":[{"title":"Test - item","identifier":"testitem","slug":"test-item","level":"Item"}]},{"title":"Test - edited subseries w\/ empty note","identifier":null,"slug":"second-subfonds","level":"Subfonds","children":[{"title":"Test - child","identifier":null,"slug":"test-child","level":"Item"}]},{"title":"Yet - another subfonds","identifier":null,"slug":"yet-another-subfonds","level":"Subfonds"}]}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['585'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 19 Apr 2016 19:11:51 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=98'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Cookie: [symfony=lcigprh19kj8v7dvmr6ivpjr54] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects/tree/test-fonds - response: - body: {string: !!python/unicode '{"title":"Test fonds","identifier":"testfonds","slug":"test-fonds","level":"Fonds","children":[{"title":"Test - subfonds","identifier":"testsubfonds","slug":"test-subfonds","level":"Subfonds","children":[{"title":"Test - item","identifier":"testitem","slug":"test-item","level":"Item"}]},{"title":"Test - edited subseries w\/ empty note","identifier":null,"slug":"second-subfonds","level":"Subfonds","children":[{"title":"Test - child","identifier":null,"slug":"test-child","level":"Item"}]},{"title":"Yet - another subfonds","identifier":null,"slug":"yet-another-subfonds","level":"Subfonds"}]}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['585'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 19 Apr 2016 19:11:51 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=97'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Cookie: [symfony=lcigprh19kj8v7dvmr6ivpjr54] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects/top-level-fonds - response: - body: {string: !!python/unicode '{"reference_code":"toplevelfonds","title":"Top - Fonds","publication_status":"Published"}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['87'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 19 Apr 2016 19:11:52 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=96'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Cookie: [symfony=lcigprh19kj8v7dvmr6ivpjr54] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects/tree/top-level-fonds - response: - body: {string: !!python/unicode '{"title":"Top Fonds","identifier":"toplevelfonds","slug":"top-level-fonds","children":[{"title":"Dawg - Child","identifier":"dogchild","slug":"child-of-top-level","level":"Subfonds","children":[{"title":"Dawg - Item","identifier":"dogitem","slug":"item-level","level":"Item"}]}]}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['275'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 19 Apr 2016 19:11:52 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=95'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Cookie: [symfony=lcigprh19kj8v7dvmr6ivpjr54] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects/tree/top-level-fonds - response: - body: {string: !!python/unicode '{"title":"Top Fonds","identifier":"toplevelfonds","slug":"top-level-fonds","children":[{"title":"Dawg - Child","identifier":"dogchild","slug":"child-of-top-level","level":"Subfonds","children":[{"title":"Dawg - Item","identifier":"dogitem","slug":"item-level","level":"Item"}]}]}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['275'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 19 Apr 2016 19:11:52 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=94'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Cookie: [symfony=lcigprh19kj8v7dvmr6ivpjr54] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects?sort=alphabetic&reverse=True&skip=0&sq0=&sf0=_all&limit=30&topLod=1 - response: - body: {string: !!python/unicode '{"total":2,"results":[{"reference_code":"toplevelfonds","slug":"top-level-fonds","title":"Top - Fonds"},{"reference_code":"testfonds","slug":"test-fonds","title":"Test fonds","level_of_description":"Fonds"}]}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['206'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 19 Apr 2016 19:11:52 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=93'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Cookie: [symfony=lcigprh19kj8v7dvmr6ivpjr54] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects/top-level-fonds - response: - body: {string: !!python/unicode '{"reference_code":"toplevelfonds","title":"Top - Fonds","publication_status":"Published"}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['87'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 19 Apr 2016 19:11:52 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=92'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Cookie: [symfony=lcigprh19kj8v7dvmr6ivpjr54] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects/tree/top-level-fonds - response: - body: {string: !!python/unicode '{"title":"Top Fonds","identifier":"toplevelfonds","slug":"top-level-fonds","children":[{"title":"Dawg - Child","identifier":"dogchild","slug":"child-of-top-level","level":"Subfonds","children":[{"title":"Dawg - Item","identifier":"dogitem","slug":"item-level","level":"Item"}]}]}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['275'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 19 Apr 2016 19:11:52 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=91'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Cookie: [symfony=lcigprh19kj8v7dvmr6ivpjr54] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects/tree/top-level-fonds - response: - body: {string: !!python/unicode '{"title":"Top Fonds","identifier":"toplevelfonds","slug":"top-level-fonds","children":[{"title":"Dawg - Child","identifier":"dogchild","slug":"child-of-top-level","level":"Subfonds","children":[{"title":"Dawg - Item","identifier":"dogitem","slug":"item-level","level":"Item"}]}]}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['275'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 19 Apr 2016 19:11:52 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=90'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Cookie: [symfony=lcigprh19kj8v7dvmr6ivpjr54] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects/test-fonds - response: - body: {string: !!python/unicode '{"reference_code":"testfonds","title":"Test fonds","publication_status":"Draft","level_of_description":"Fonds","dates":[{"start_date":"2014-01-01","end_date":"2015-01-01","type":"Creation"}],"notes":["Note - content"]}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['216'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 19 Apr 2016 19:11:52 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=89'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Cookie: [symfony=lcigprh19kj8v7dvmr6ivpjr54] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects/tree/test-fonds - response: - body: {string: !!python/unicode '{"title":"Test fonds","identifier":"testfonds","slug":"test-fonds","level":"Fonds","children":[{"title":"Test - subfonds","identifier":"testsubfonds","slug":"test-subfonds","level":"Subfonds","children":[{"title":"Test - item","identifier":"testitem","slug":"test-item","level":"Item"}]},{"title":"Test - edited subseries w\/ empty note","identifier":null,"slug":"second-subfonds","level":"Subfonds","children":[{"title":"Test - child","identifier":null,"slug":"test-child","level":"Item"}]},{"title":"Yet - another subfonds","identifier":null,"slug":"yet-another-subfonds","level":"Subfonds"}]}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['585'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 19 Apr 2016 19:11:52 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=88'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Cookie: [symfony=lcigprh19kj8v7dvmr6ivpjr54] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects/tree/test-fonds - response: - body: {string: !!python/unicode '{"title":"Test fonds","identifier":"testfonds","slug":"test-fonds","level":"Fonds","children":[{"title":"Test - subfonds","identifier":"testsubfonds","slug":"test-subfonds","level":"Subfonds","children":[{"title":"Test - item","identifier":"testitem","slug":"test-item","level":"Item"}]},{"title":"Test - edited subseries w\/ empty note","identifier":null,"slug":"second-subfonds","level":"Subfonds","children":[{"title":"Test - child","identifier":null,"slug":"test-child","level":"Item"}]},{"title":"Yet - another subfonds","identifier":null,"slug":"yet-another-subfonds","level":"Subfonds"}]}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['585'] - content-type: [application/json; charset=utf-8] - date: ['Tue, 19 Apr 2016 19:11:52 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=87'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -version: 1 diff --git a/tests/fixtures/atom/test_note.yaml b/tests/fixtures/atom/test_note.yaml deleted file mode 100644 index 7339247..0000000 --- a/tests/fixtures/atom/test_note.yaml +++ /dev/null @@ -1,193 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects?skip=0&sq0=&topLod=1&limit=30&sf0=_all - response: - body: {string: !!python/unicode '{"total":2,"results":[{"reference_code":"testfonds","slug":"test-fonds","title":"Test - fonds","level_of_description":"Fonds"},{"reference_code":"toplevelfonds","slug":"top-level-fonds","title":"Top - Fonds"}]}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['206'] - content-type: [application/json; charset=utf-8] - date: ['Sun, 17 Apr 2016 21:27:56 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=100'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - set-cookie: [symfony=86j5o8pk4n699m5eiv73a8d8n3; path=/; HttpOnly] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Cookie: [symfony=86j5o8pk4n699m5eiv73a8d8n3] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects/test-fonds - response: - body: {string: !!python/unicode '{"reference_code":"testfonds","title":"Test fonds","publication_status":"Draft","level_of_description":"Fonds","dates":[{"start_date":"2014-01-01","end_date":"2015-01-01","type":"Creation"}],"notes":["Note - content"]}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['216'] - content-type: [application/json; charset=utf-8] - date: ['Sun, 17 Apr 2016 21:27:56 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=99'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Cookie: [symfony=86j5o8pk4n699m5eiv73a8d8n3] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects/tree/test-fonds - response: - body: {string: !!python/unicode '{"title":"Test fonds","identifier":"testfonds","slug":"test-fonds","level":"Fonds","children":[{"title":"Test - subfonds","identifier":"testsubfonds","slug":"test-subfonds","level":"Subfonds","children":[{"title":"Test - item","identifier":"testitem","slug":"test-item","level":"Item"}]},{"title":"Test - edited subseries w\/ empty note","identifier":null,"slug":"second-subfonds","level":"Subfonds","children":[{"title":"Test - child","identifier":null,"slug":"test-child","level":"Item"}]}]}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['485'] - content-type: [application/json; charset=utf-8] - date: ['Sun, 17 Apr 2016 21:27:56 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=98'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Cookie: [symfony=86j5o8pk4n699m5eiv73a8d8n3] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects/tree/test-fonds - response: - body: {string: !!python/unicode '{"title":"Test fonds","identifier":"testfonds","slug":"test-fonds","level":"Fonds","children":[{"title":"Test - subfonds","identifier":"testsubfonds","slug":"test-subfonds","level":"Subfonds","children":[{"title":"Test - item","identifier":"testitem","slug":"test-item","level":"Item"}]},{"title":"Test - edited subseries w\/ empty note","identifier":null,"slug":"second-subfonds","level":"Subfonds","children":[{"title":"Test - child","identifier":null,"slug":"test-child","level":"Item"}]}]}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['485'] - content-type: [application/json; charset=utf-8] - date: ['Sun, 17 Apr 2016 21:27:56 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=97'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Cookie: [symfony=86j5o8pk4n699m5eiv73a8d8n3] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects/top-level-fonds - response: - body: {string: !!python/unicode '{"reference_code":"toplevelfonds","title":"Top - Fonds","publication_status":"Published"}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['87'] - content-type: [application/json; charset=utf-8] - date: ['Sun, 17 Apr 2016 21:27:56 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=96'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Cookie: [symfony=86j5o8pk4n699m5eiv73a8d8n3] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects/tree/top-level-fonds - response: - body: {string: !!python/unicode '{"title":"Top Fonds","identifier":"toplevelfonds","slug":"top-level-fonds","children":[{"title":"Dawg - Child","identifier":"dogchild","slug":"child-of-top-level","level":"Subfonds","children":[{"title":"Dawg - Item","identifier":"dogitem","slug":"item-level","level":"Item"}]}]}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['275'] - content-type: [application/json; charset=utf-8] - date: ['Sun, 17 Apr 2016 21:27:56 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=95'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Cookie: [symfony=86j5o8pk4n699m5eiv73a8d8n3] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects/tree/top-level-fonds - response: - body: {string: !!python/unicode '{"title":"Top Fonds","identifier":"toplevelfonds","slug":"top-level-fonds","children":[{"title":"Dawg - Child","identifier":"dogchild","slug":"child-of-top-level","level":"Subfonds","children":[{"title":"Dawg - Item","identifier":"dogitem","slug":"item-level","level":"Item"}]}]}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['275'] - content-type: [application/json; charset=utf-8] - date: ['Sun, 17 Apr 2016 21:27:56 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=94'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -version: 1 diff --git a/tests/fixtures/atom/test_posting_contentless_note.yaml b/tests/fixtures/atom/test_posting_contentless_note.yaml deleted file mode 100644 index b94c7ae..0000000 --- a/tests/fixtures/atom/test_posting_contentless_note.yaml +++ /dev/null @@ -1,56 +0,0 @@ -interactions: -- request: - body: '{"level_of_description": "subfonds", "notes": [], "parent_slug": "test-fonds", - "title": "Yet another subfonds"}' - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['111'] - Content-type: [application/json] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: POST - uri: http://127.0.0.1/api/informationobjects - response: - body: {string: !!python/unicode '{"id":472,"slug":"yet-another-subfonds","parent_id":436}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['56'] - content-type: [application/json; charset=utf-8] - date: ['Sun, 17 Apr 2016 21:33:44 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=100'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - set-cookie: [symfony=hkhrv5f0l46gblk3vs7u833fo1; path=/; HttpOnly, symfony=uo1mvdhqgtfsu9ttqmcv7gr3d1; - path=/; HttpOnly] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 201, message: Created} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Cookie: [symfony=uo1mvdhqgtfsu9ttqmcv7gr3d1] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-79-generic] - X-REST-API-KEY: [68405800c6612599] - method: GET - uri: http://127.0.0.1/api/informationobjects/yet-another-subfonds - response: - body: {string: !!python/unicode '{"parent":"test-fonds","title":"Yet another subfonds","publication_status":"Published","level_of_description":"Subfonds"}'} - headers: - cache-control: ['no-store, no-cache, must-revalidate, post-check=0, pre-check=0'] - connection: [Keep-Alive] - content-length: ['121'] - content-type: [application/json; charset=utf-8] - date: ['Sun, 17 Apr 2016 21:33:44 GMT'] - expires: ['Thu, 19 Nov 1981 08:52:00 GMT'] - keep-alive: ['timeout=5, max=99'] - pragma: [no-cache] - server: [Apache/2.4.7 (Ubuntu)] - x-powered-by: [PHP/5.5.9-1ubuntu4.14] - status: {code: 200, message: OK} -version: 1 diff --git a/tests/fixtures/test_add_child_resource.yaml b/tests/fixtures/test_add_child_resource.yaml deleted file mode 100644 index 136bed9..0000000 --- a/tests/fixtures/test_add_child_resource.yaml +++ /dev/null @@ -1,71 +0,0 @@ -interactions: -- request: - body: password=admin - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['14'] - Content-Type: [application/x-www-form-urlencoded] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-43-generic] - method: POST - uri: http://localhost:8089/users/admin/login - response: - body: {string: !!python/unicode '{"session":"3b25bdce7d637c3e1aa036cb9bc2676e00e4581aa870133fd8c44b3416ad30bd","user":{"lock_version":37,"username":"admin","name":"Administrator","is_system_user":true,"create_time":"2015-06-25T17:43:26Z","system_mtime":"2015-10-08T21:45:06Z","user_mtime":"2015-10-08T21:45:06Z","jsonmodel_type":"user","groups":[],"is_admin":true,"uri":"/users/1","agent_record":{"ref":"/agents/people/1"},"permissions":{"/repositories/1":["update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record","administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed"],"_archivesspace":["administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed","update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record"]}}} - - '} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['2205'] - content-type: [application/json] - date: ['Thu, 08 Oct 2015 21:45:05 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-43-generic] - X-ArchivesSpace-Session: [!!python/unicode '3b25bdce7d637c3e1aa036cb9bc2676e00e4581aa870133fd8c44b3416ad30bd'] - method: GET - uri: http://localhost:8089/repositories/2/resources/2 - response: - body: {string: !!python/unicode '{"lock_version":1,"title":"Test fonds","publish":false,"restrictions":false,"created_by":"admin","last_modified_by":"admin","create_time":"2015-10-08T21:38:10Z","system_mtime":"2015-10-08T21:38:30Z","user_mtime":"2015-10-08T21:38:30Z","suppressed":false,"id_0":"F1","language":"eng","level":"collection","jsonmodel_type":"resource","external_ids":[],"subjects":[],"linked_events":[],"extents":[{"lock_version":0,"number":"1","created_by":"admin","last_modified_by":"admin","create_time":"2015-10-08T21:38:31Z","system_mtime":"2015-10-08T21:38:31Z","user_mtime":"2015-10-08T21:38:31Z","portion":"whole","extent_type":"files","jsonmodel_type":"extent"}],"dates":[{"lock_version":0,"expression":"2015-01-01","begin":"2015-01-01","created_by":"admin","last_modified_by":"admin","create_time":"2015-10-08T21:38:31Z","system_mtime":"2015-10-08T21:38:31Z","user_mtime":"2015-10-08T21:38:31Z","date_type":"single","label":"creation","jsonmodel_type":"date"}],"external_documents":[],"rights_statements":[],"linked_agents":[],"instances":[],"deaccessions":[],"related_accessions":[],"notes":[],"uri":"/repositories/2/resources/2","repository":{"ref":"/repositories/2"},"tree":{"ref":"/repositories/2/resources/2/tree"}} - - '} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['1211'] - content-type: [application/json] - date: ['Thu, 08 Oct 2015 21:45:06 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -- request: - body: '{"level": "item", "resource": {"ref": "/repositories/2/resources/2"}, "jsonmodel_type": - "archival_object", "title": "Test child"}' - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['129'] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-43-generic] - X-ArchivesSpace-Session: [!!python/unicode '3b25bdce7d637c3e1aa036cb9bc2676e00e4581aa870133fd8c44b3416ad30bd'] - method: POST - uri: http://localhost:8089/repositories/2/archival_objects - response: - body: {string: !!python/unicode '{"status":"Created","id":3,"lock_version":0,"stale":true,"uri":"/repositories/2/archival_objects/3","warnings":[]} - - '} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['115'] - content-type: [application/json] - date: ['Thu, 08 Oct 2015 21:45:06 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -version: 1 diff --git a/tests/fixtures/test_add_child_resource_component.yaml b/tests/fixtures/test_add_child_resource_component.yaml deleted file mode 100644 index 1a40947..0000000 --- a/tests/fixtures/test_add_child_resource_component.yaml +++ /dev/null @@ -1,73 +0,0 @@ -interactions: -- request: - body: password=admin - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['14'] - Content-Type: [application/x-www-form-urlencoded] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-43-generic] - method: POST - uri: http://localhost:8089/users/admin/login - response: - body: {string: !!python/unicode '{"session":"6b40dd8a10ba935c976eb1789790ec116a992f32b09b1bd5a3e54a720d1f9907","user":{"lock_version":42,"username":"admin","name":"Administrator","is_system_user":true,"create_time":"2015-06-25T17:43:26Z","system_mtime":"2015-10-08T21:49:00Z","user_mtime":"2015-10-08T21:49:00Z","jsonmodel_type":"user","groups":[],"is_admin":true,"uri":"/users/1","agent_record":{"ref":"/agents/people/1"},"permissions":{"/repositories/1":["update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record","administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed"],"_archivesspace":["administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed","update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record"]}}} - - '} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['2205'] - content-type: [application/json] - date: ['Thu, 08 Oct 2015 21:48:59 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-43-generic] - X-ArchivesSpace-Session: [!!python/unicode '6b40dd8a10ba935c976eb1789790ec116a992f32b09b1bd5a3e54a720d1f9907'] - method: GET - uri: http://localhost:8089/repositories/2/archival_objects/1 - response: - body: {string: !!python/unicode '{"lock_version":1,"position":0,"publish":false,"ref_id":"83762cfcdc683e815d02aa562158e962","title":"Test - series","display_string":"Test series","restrictions_apply":false,"created_by":"admin","last_modified_by":"admin","create_time":"2015-10-08T21:40:59Z","system_mtime":"2015-10-08T21:47:38Z","user_mtime":"2015-10-08T21:47:38Z","suppressed":false,"level":"series","jsonmodel_type":"archival_object","external_ids":[],"subjects":[],"linked_events":[],"extents":[],"dates":[],"external_documents":[],"rights_statements":[],"linked_agents":[],"instances":[],"notes":[],"uri":"/repositories/2/archival_objects/1","repository":{"ref":"/repositories/2"},"resource":{"ref":"/repositories/2/resources/2"},"has_unpublished_ancestor":true} - - '} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['732'] - content-type: [application/json] - date: ['Thu, 08 Oct 2015 21:49:00 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -- request: - body: '{"level": "item", "resource": {"ref": "/repositories/2/resources/2"}, "parent": - {"ref": "/repositories/2/archival_objects/1"}, "jsonmodel_type": "archival_object", - "title": "Test child"}' - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['186'] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-43-generic] - X-ArchivesSpace-Session: [!!python/unicode '6b40dd8a10ba935c976eb1789790ec116a992f32b09b1bd5a3e54a720d1f9907'] - method: POST - uri: http://localhost:8089/repositories/2/archival_objects - response: - body: {string: !!python/unicode '{"status":"Created","id":5,"lock_version":0,"stale":true,"uri":"/repositories/2/archival_objects/5","warnings":[]} - - '} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['115'] - content-type: [application/json] - date: ['Thu, 08 Oct 2015 21:49:00 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -version: 1 diff --git a/tests/fixtures/test_add_digital_object.yaml b/tests/fixtures/test_add_digital_object.yaml deleted file mode 100644 index 630b8d0..0000000 --- a/tests/fixtures/test_add_digital_object.yaml +++ /dev/null @@ -1,138 +0,0 @@ -interactions: -- request: - body: !!binary | - cGFzc3dvcmQ9YWRtaW4mZXhwaXJpbmc9RmFsc2U= - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['29'] - Content-Type: [application/x-www-form-urlencoded] - User-Agent: [python-requests/2.8.1] - method: POST - uri: http://localhost:8089/users/admin/login - response: - body: {string: '{"session":"2e06c62e8123488f45750959e77129fd7bf532fec10ffd0301568ffedee188de","user":{"lock_version":712,"username":"admin","name":"Administrator","is_system_user":true,"create_time":"2015-06-11T17:04:21Z","system_mtime":"2015-12-03T01:23:59Z","user_mtime":"2015-12-03T01:23:59Z","jsonmodel_type":"user","groups":[],"is_admin":true,"uri":"/users/1","agent_record":{"ref":"/agents/people/1"},"permissions":{"/repositories/1":["update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record","administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed"],"_archivesspace":["administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed","update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record"]}}} - -'} - headers: - Cache-Control: ['private, must-revalidate, max-age=0'] - Content-Length: ['2206'] - Content-Type: [application/json] - Date: ['Thu, 03 Dec 2015 01:23:59 GMT'] - Server: [Jetty(8.1.5.v20120716)] - X-Content-Type-Options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.8.1] - X-ArchivesSpace-Session: [2e06c62e8123488f45750959e77129fd7bf532fec10ffd0301568ffedee188de] - method: GET - uri: http://localhost:8089/repositories/2/archival_objects/3 - response: - body: {string: '{"lock_version":9,"position":0,"publish":false,"ref_id":"e61c441cd04eb5731ce64de35a4339ff","component_id":"F1-1-1","title":"Test - edited subseries","display_string":"Test edited subseries, November, 2014 - to November, 2015","restrictions_apply":false,"created_by":"admin","last_modified_by":"admin","create_time":"2015-06-11T17:20:19Z","system_mtime":"2015-12-03T01:23:47Z","user_mtime":"2015-12-03T01:23:47Z","suppressed":false,"level":"subseries","jsonmodel_type":"archival_object","external_ids":[],"subjects":[],"linked_events":[],"extents":[],"dates":[{"lock_version":0,"expression":"November, - 2014 to November, 2015","begin":"2014-11-01","end":"2015-11-01","created_by":"admin","last_modified_by":"admin","create_time":"2015-12-03T01:23:47Z","system_mtime":"2015-12-03T01:23:47Z","user_mtime":"2015-12-03T01:23:47Z","date_type":"inclusive","label":"creation","jsonmodel_type":"date"}],"external_documents":[],"rights_statements":[],"linked_agents":[],"instances":[{"lock_version":0,"created_by":"admin","last_modified_by":"admin","create_time":"2015-12-03T01:23:47Z","system_mtime":"2015-12-03T01:23:47Z","user_mtime":"2015-12-03T01:23:47Z","instance_type":"digital_object","jsonmodel_type":"instance","digital_object":{"ref":"/repositories/2/digital_objects/7"}}],"notes":[{"subnotes":[{"publish":true,"jsonmodel_type":"note_text","content":"This - is a test note"}],"persistent_id":"063373886a2f23d03fe1a51f7c96ca8b","type":"odd","jsonmodel_type":"note_multipart","publish":true}],"uri":"/repositories/2/archival_objects/3","repository":{"ref":"/repositories/2"},"resource":{"ref":"/repositories/2/resources/1"},"parent":{"ref":"/repositories/2/archival_objects/1"},"has_unpublished_ancestor":true} - -'} - headers: - Cache-Control: ['private, must-revalidate, max-age=0'] - Content-Length: ['1703'] - Content-Type: [application/json] - Date: ['Thu, 03 Dec 2015 01:23:59 GMT'] - Server: [Jetty(8.1.5.v20120716)] - X-Content-Type-Options: [nosniff] - status: {code: 200, message: OK} -- request: - body: !!binary | - eyJsYW5ndWFnZSI6ICIiLCAibGlua2VkX2FnZW50cyI6IFtdLCAibm90ZXMiOiBbeyJsYWJlbCI6 - ICIiLCAiY29udGVudCI6IFsiVGhpcyBpcyBhIHRlc3Qgbm90ZSJdLCAicHVibGlzaCI6IHRydWUs - ICJ0eXBlIjogIm5vdGUiLCAianNvbm1vZGVsX3R5cGUiOiAibm90ZV9kaWdpdGFsX29iamVjdCJ9 - XSwgInRpdGxlIjogIlRlc3QgZGlnaXRhbCBvYmplY3QiLCAic3ViamVjdHMiOiBbXSwgInJlc3Ry - aWN0aW9ucyI6IGZhbHNlLCAiZGlnaXRhbF9vYmplY3RfdHlwZSI6ICJ0ZXh0IiwgImRpZ2l0YWxf - b2JqZWN0X2lkIjogIjM4Yzk5ZTg5LTIwYTEtNDgzMS1iYTU3LTgxM2ZiNjQyMGU1OSJ9 - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['336'] - User-Agent: [python-requests/2.8.1] - X-ArchivesSpace-Session: [2e06c62e8123488f45750959e77129fd7bf532fec10ffd0301568ffedee188de] - method: POST - uri: http://localhost:8089/repositories/2/digital_objects - response: - body: {string: '{"status":"Created","id":8,"lock_version":0,"stale":null,"uri":"/repositories/2/digital_objects/8","warnings":[]} - -'} - headers: - Cache-Control: ['private, must-revalidate, max-age=0'] - Content-Length: ['114'] - Content-Type: [application/json] - Date: ['Thu, 03 Dec 2015 01:23:59 GMT'] - Server: [Jetty(8.1.5.v20120716)] - X-Content-Type-Options: [nosniff] - status: {code: 200, message: OK} -- request: - body: !!binary | - eyJ1cmkiOiAiL3JlcG9zaXRvcmllcy8yL2FyY2hpdmFsX29iamVjdHMvMyIsICJyZXNvdXJjZSI6 - IHsicmVmIjogIi9yZXBvc2l0b3JpZXMvMi9yZXNvdXJjZXMvMSJ9LCAibGV2ZWwiOiAic3Vic2Vy - aWVzIiwgInJpZ2h0c19zdGF0ZW1lbnRzIjogW10sICJ0aXRsZSI6ICJUZXN0IGVkaXRlZCBzdWJz - ZXJpZXMiLCAibGlua2VkX2V2ZW50cyI6IFtdLCAidXNlcl9tdGltZSI6ICIyMDE1LTEyLTAzVDAx - OjIzOjQ3WiIsICJyZXN0cmljdGlvbnNfYXBwbHkiOiBmYWxzZSwgInJlZl9pZCI6ICJlNjFjNDQx - Y2QwNGViNTczMWNlNjRkZTM1YTQzMzlmZiIsICJleHRlcm5hbF9pZHMiOiBbXSwgInN1YmplY3Rz - IjogW10sICJleHRlbnRzIjogW10sICJsaW5rZWRfYWdlbnRzIjogW10sICJjcmVhdGVkX2J5Ijog - ImFkbWluIiwgInN1cHByZXNzZWQiOiBmYWxzZSwgImNvbXBvbmVudF9pZCI6ICJGMS0xLTEiLCAi - ZGlzcGxheV9zdHJpbmciOiAiVGVzdCBlZGl0ZWQgc3Vic2VyaWVzLCBOb3ZlbWJlciwgMjAxNCB0 - byBOb3ZlbWJlciwgMjAxNSIsICJsYXN0X21vZGlmaWVkX2J5IjogImFkbWluIiwgInBhcmVudCI6 - IHsicmVmIjogIi9yZXBvc2l0b3JpZXMvMi9hcmNoaXZhbF9vYmplY3RzLzEifSwgInJlcG9zaXRv - cnkiOiB7InJlZiI6ICIvcmVwb3NpdG9yaWVzLzIifSwgIm5vdGVzIjogW3sianNvbm1vZGVsX3R5 - cGUiOiAibm90ZV9tdWx0aXBhcnQiLCAicHVibGlzaCI6IHRydWUsICJwZXJzaXN0ZW50X2lkIjog - IjA2MzM3Mzg4NmEyZjIzZDAzZmUxYTUxZjdjOTZjYThiIiwgInN1Ym5vdGVzIjogW3siY29udGVu - dCI6ICJUaGlzIGlzIGEgdGVzdCBub3RlIiwgInB1Ymxpc2giOiB0cnVlLCAianNvbm1vZGVsX3R5 - cGUiOiAibm90ZV90ZXh0In1dLCAidHlwZSI6ICJvZGQifV0sICJqc29ubW9kZWxfdHlwZSI6ICJh - cmNoaXZhbF9vYmplY3QiLCAicHVibGlzaCI6IGZhbHNlLCAic3lzdGVtX210aW1lIjogIjIwMTUt - MTItMDNUMDE6MjM6NDdaIiwgImNyZWF0ZV90aW1lIjogIjIwMTUtMDYtMTFUMTc6MjA6MTlaIiwg - InBvc2l0aW9uIjogMCwgImxvY2tfdmVyc2lvbiI6IDksICJpbnN0YW5jZXMiOiBbeyJjcmVhdGVf - dGltZSI6ICIyMDE1LTEyLTAzVDAxOjIzOjQ3WiIsICJqc29ubW9kZWxfdHlwZSI6ICJpbnN0YW5j - ZSIsICJsb2NrX3ZlcnNpb24iOiAwLCAiY3JlYXRlZF9ieSI6ICJhZG1pbiIsICJkaWdpdGFsX29i - amVjdCI6IHsicmVmIjogIi9yZXBvc2l0b3JpZXMvMi9kaWdpdGFsX29iamVjdHMvNyJ9LCAidXNl - cl9tdGltZSI6ICIyMDE1LTEyLTAzVDAxOjIzOjQ3WiIsICJzeXN0ZW1fbXRpbWUiOiAiMjAxNS0x - Mi0wM1QwMToyMzo0N1oiLCAiaW5zdGFuY2VfdHlwZSI6ICJkaWdpdGFsX29iamVjdCIsICJsYXN0 - X21vZGlmaWVkX2J5IjogImFkbWluIn0sIHsiZGlnaXRhbF9vYmplY3QiOiB7InJlZiI6ICIvcmVw - b3NpdG9yaWVzLzIvZGlnaXRhbF9vYmplY3RzLzgifSwgImluc3RhbmNlX3R5cGUiOiAiZGlnaXRh - bF9vYmplY3QifV0sICJkYXRlcyI6IFt7ImJlZ2luIjogIjIwMTQtMTEtMDEiLCAiZXhwcmVzc2lv - biI6ICJOb3ZlbWJlciwgMjAxNCB0byBOb3ZlbWJlciwgMjAxNSIsICJqc29ubW9kZWxfdHlwZSI6 - ICJkYXRlIiwgImxhYmVsIjogImNyZWF0aW9uIiwgInN5c3RlbV9tdGltZSI6ICIyMDE1LTEyLTAz - VDAxOjIzOjQ3WiIsICJ1c2VyX210aW1lIjogIjIwMTUtMTItMDNUMDE6MjM6NDdaIiwgImRhdGVf - dHlwZSI6ICJpbmNsdXNpdmUiLCAiY3JlYXRlX3RpbWUiOiAiMjAxNS0xMi0wM1QwMToyMzo0N1oi - LCAibG9ja192ZXJzaW9uIjogMCwgImNyZWF0ZWRfYnkiOiAiYWRtaW4iLCAiZW5kIjogIjIwMTUt - MTEtMDEiLCAibGFzdF9tb2RpZmllZF9ieSI6ICJhZG1pbiJ9XSwgImhhc191bnB1Ymxpc2hlZF9h - bmNlc3RvciI6IHRydWUsICJleHRlcm5hbF9kb2N1bWVudHMiOiBbXX0= - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['1922'] - User-Agent: [python-requests/2.8.1] - X-ArchivesSpace-Session: [2e06c62e8123488f45750959e77129fd7bf532fec10ffd0301568ffedee188de] - method: POST - uri: http://localhost:8089/repositories/2/archival_objects/3 - response: - body: {string: '{"status":"Updated","id":3,"lock_version":10,"stale":true,"uri":"/repositories/2/archival_objects/3","warnings":[]} - -'} - headers: - Cache-Control: ['private, must-revalidate, max-age=0'] - Content-Length: ['116'] - Content-Type: [application/json] - Date: ['Thu, 03 Dec 2015 01:24:00 GMT'] - Server: [Jetty(8.1.5.v20120716)] - X-Content-Type-Options: [nosniff] - status: {code: 200, message: OK} -version: 1 diff --git a/tests/fixtures/test_add_digital_object_component.yaml b/tests/fixtures/test_add_digital_object_component.yaml deleted file mode 100644 index ba76e5e..0000000 --- a/tests/fixtures/test_add_digital_object_component.yaml +++ /dev/null @@ -1,74 +0,0 @@ -interactions: -- request: - body: !!binary | - cGFzc3dvcmQ9YWRtaW4mZXhwaXJpbmc9RmFsc2U= - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['29'] - Content-Type: [application/x-www-form-urlencoded] - User-Agent: [python-requests/2.8.1] - method: POST - uri: http://localhost:8089/users/admin/login - response: - body: {string: '{"session":"8f0bce11c556e20e7ba67b6501ace4275f3d9f6bc570fd9ebe6cab5aaeaa9d88","user":{"lock_version":703,"username":"admin","name":"Administrator","is_system_user":true,"create_time":"2015-06-11T17:04:21Z","system_mtime":"2015-12-03T01:06:21Z","user_mtime":"2015-12-03T01:06:21Z","jsonmodel_type":"user","groups":[],"is_admin":true,"uri":"/users/1","agent_record":{"ref":"/agents/people/1"},"permissions":{"/repositories/1":["update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record","administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed"],"_archivesspace":["administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed","update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record"]}}} - -'} - headers: - Cache-Control: ['private, must-revalidate, max-age=0'] - Content-Length: ['2206'] - Content-Type: [application/json] - Date: ['Thu, 03 Dec 2015 01:06:21 GMT'] - Server: [Jetty(8.1.5.v20120716)] - X-Content-Type-Options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.8.1] - X-ArchivesSpace-Session: [8f0bce11c556e20e7ba67b6501ace4275f3d9f6bc570fd9ebe6cab5aaeaa9d88] - method: GET - uri: http://localhost:8089/repositories/2/digital_objects/1 - response: - body: {string: '{"lock_version":0,"digital_object_id":"1","title":"Test digi object","publish":false,"restrictions":false,"created_by":"admin","last_modified_by":"admin","create_time":"2015-11-18T21:29:33Z","system_mtime":"2015-11-18T21:29:33Z","user_mtime":"2015-11-18T21:29:33Z","suppressed":false,"jsonmodel_type":"digital_object","external_ids":[],"subjects":[],"linked_events":[],"extents":[],"dates":[],"external_documents":[],"rights_statements":[],"linked_agents":[],"file_versions":[],"notes":[],"linked_instances":[],"uri":"/repositories/2/digital_objects/1","repository":{"ref":"/repositories/2"},"tree":{"ref":"/repositories/2/digital_objects/1/tree"}} - -'} - headers: - Cache-Control: ['private, must-revalidate, max-age=0'] - Content-Length: ['649'] - Content-Type: [application/json] - Date: ['Thu, 03 Dec 2015 01:06:21 GMT'] - Server: [Jetty(8.1.5.v20120716)] - X-Content-Type-Options: [nosniff] - status: {code: 200, message: OK} -- request: - body: !!binary | - eyJqc29ubW9kZWxfdHlwZSI6ICJkaWdpdGFsX29iamVjdF9jb21wb25lbnQiLCAibGFiZWwiOiAi - VGVzdCBET0MiLCAidGl0bGUiOiAiVGhpcyBpcyBhIHRlc3QgRE9DIiwgImRpZ2l0YWxfb2JqZWN0 - IjogeyJyZWYiOiAiL3JlcG9zaXRvcmllcy8yL2RpZ2l0YWxfb2JqZWN0cy8xIn19 - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['162'] - User-Agent: [python-requests/2.8.1] - X-ArchivesSpace-Session: [8f0bce11c556e20e7ba67b6501ace4275f3d9f6bc570fd9ebe6cab5aaeaa9d88] - method: POST - uri: http://localhost:8089/repositories/2/digital_object_components - response: - body: {string: '{"status":"Created","id":3,"lock_version":0,"stale":true,"uri":"/repositories/2/digital_object_components/3","warnings":[]} - -'} - headers: - Cache-Control: ['private, must-revalidate, max-age=0'] - Content-Length: ['124'] - Content-Type: [application/json] - Date: ['Thu, 03 Dec 2015 01:06:21 GMT'] - Server: [Jetty(8.1.5.v20120716)] - X-Content-Type-Options: [nosniff] - status: {code: 200, message: OK} -version: 1 diff --git a/tests/fixtures/test_add_digital_object_note.yaml b/tests/fixtures/test_add_digital_object_note.yaml deleted file mode 100644 index 87380df..0000000 --- a/tests/fixtures/test_add_digital_object_note.yaml +++ /dev/null @@ -1,160 +0,0 @@ -interactions: -- request: - body: !!binary | - cGFzc3dvcmQ9YWRtaW4mZXhwaXJpbmc9RmFsc2U= - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['29'] - Content-Type: [application/x-www-form-urlencoded] - User-Agent: [python-requests/2.8.1] - method: POST - uri: http://localhost:8089/users/admin/login - response: - body: {string: '{"session":"d6226a61876a4e58aff36f9a4d549330abe76909660b1f3de4f50f11db6750c0","user":{"lock_version":711,"username":"admin","name":"Administrator","is_system_user":true,"create_time":"2015-06-11T17:04:21Z","system_mtime":"2015-12-03T01:23:46Z","user_mtime":"2015-12-03T01:23:46Z","jsonmodel_type":"user","groups":[],"is_admin":true,"uri":"/users/1","agent_record":{"ref":"/agents/people/1"},"permissions":{"/repositories/1":["update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record","administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed"],"_archivesspace":["administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed","update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record"]}}} - -'} - headers: - Cache-Control: ['private, must-revalidate, max-age=0'] - Content-Length: ['2206'] - Content-Type: [application/json] - Date: ['Thu, 03 Dec 2015 01:23:46 GMT'] - Server: [Jetty(8.1.5.v20120716)] - X-Content-Type-Options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.8.1] - X-ArchivesSpace-Session: [d6226a61876a4e58aff36f9a4d549330abe76909660b1f3de4f50f11db6750c0] - method: GET - uri: http://localhost:8089/repositories/2/archival_objects/3 - response: - body: {string: '{"lock_version":8,"position":0,"publish":false,"ref_id":"e61c441cd04eb5731ce64de35a4339ff","component_id":"F1-1-1","title":"Test - edited subseries","display_string":"Test edited subseries, November, 2014 - to November, 2015","restrictions_apply":false,"created_by":"admin","last_modified_by":"admin","create_time":"2015-06-11T17:20:19Z","system_mtime":"2015-12-03T00:03:42Z","user_mtime":"2015-11-02T22:53:07Z","suppressed":false,"level":"subseries","jsonmodel_type":"archival_object","external_ids":[],"subjects":[],"linked_events":[],"extents":[],"dates":[{"lock_version":0,"expression":"November, - 2014 to November, 2015","begin":"2014-11-01","end":"2015-11-01","created_by":"admin","last_modified_by":"admin","create_time":"2015-11-02T22:53:07Z","system_mtime":"2015-11-02T22:53:07Z","user_mtime":"2015-11-02T22:53:07Z","date_type":"inclusive","label":"creation","jsonmodel_type":"date"}],"external_documents":[],"rights_statements":[],"linked_agents":[],"instances":[],"notes":[{"type":"odd","jsonmodel_type":"note_multipart","subnotes":[{"content":"This - is a test note","publish":true,"jsonmodel_type":"note_text"}],"persistent_id":"063373886a2f23d03fe1a51f7c96ca8b","publish":true}],"uri":"/repositories/2/archival_objects/3","repository":{"ref":"/repositories/2"},"resource":{"ref":"/repositories/2/resources/1"},"parent":{"ref":"/repositories/2/archival_objects/1"},"has_unpublished_ancestor":true} - -'} - headers: - Cache-Control: ['private, must-revalidate, max-age=0'] - Content-Length: ['1404'] - Content-Type: [application/json] - Date: ['Thu, 03 Dec 2015 01:23:46 GMT'] - Server: [Jetty(8.1.5.v20120716)] - X-Content-Type-Options: [nosniff] - status: {code: 200, message: OK} -- request: - body: !!binary | - eyJkaWdpdGFsX29iamVjdF9pZCI6ICI5MjViZmM4YS1kNmY4LTQ0NzktOWI2YS1kODExYTRlN2Y2 - YmYiLCAibGFuZ3VhZ2UiOiAiIiwgImxpbmtlZF9hZ2VudHMiOiBbXSwgInRpdGxlIjogIlRlc3Qg - ZGlnaXRhbCBvYmplY3Qgd2l0aCBub3RlIiwgImRpZ2l0YWxfb2JqZWN0X3R5cGUiOiAidGV4dCIs - ICJub3RlcyI6IFt7InB1Ymxpc2giOiB0cnVlLCAidHlwZSI6ICJvcmlnaW5hbHNsb2MiLCAianNv - bm1vZGVsX3R5cGUiOiAibm90ZV9kaWdpdGFsX29iamVjdCIsICJjb250ZW50IjogWyJUaGUgZXRo - ZXIiXX0sIHsicHVibGlzaCI6IHRydWUsICJ0eXBlIjogIm5vdGUiLCAianNvbm1vZGVsX3R5cGUi - OiAibm90ZV9kaWdpdGFsX29iamVjdCIsICJjb250ZW50IjogWyJUaGlzIGlzIGEgdGVzdCBub3Rl - Il0sICJsYWJlbCI6ICIifV0sICJyZXN0cmljdGlvbnMiOiBmYWxzZSwgInN1YmplY3RzIjogW119 - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['456'] - User-Agent: [python-requests/2.8.1] - X-ArchivesSpace-Session: [d6226a61876a4e58aff36f9a4d549330abe76909660b1f3de4f50f11db6750c0] - method: POST - uri: http://localhost:8089/repositories/2/digital_objects - response: - body: {string: '{"status":"Created","id":7,"lock_version":0,"stale":null,"uri":"/repositories/2/digital_objects/7","warnings":[]} - -'} - headers: - Cache-Control: ['private, must-revalidate, max-age=0'] - Content-Length: ['114'] - Content-Type: [application/json] - Date: ['Thu, 03 Dec 2015 01:23:46 GMT'] - Server: [Jetty(8.1.5.v20120716)] - X-Content-Type-Options: [nosniff] - status: {code: 200, message: OK} -- request: - body: !!binary | - eyJyZXBvc2l0b3J5IjogeyJyZWYiOiAiL3JlcG9zaXRvcmllcy8yIn0sICJleHRlcm5hbF9kb2N1 - bWVudHMiOiBbXSwgImRhdGVzIjogW3sibGFiZWwiOiAiY3JlYXRpb24iLCAiZW5kIjogIjIwMTUt - MTEtMDEiLCAic3lzdGVtX210aW1lIjogIjIwMTUtMTEtMDJUMjI6NTM6MDdaIiwgImNyZWF0ZV90 - aW1lIjogIjIwMTUtMTEtMDJUMjI6NTM6MDdaIiwgImxvY2tfdmVyc2lvbiI6IDAsICJkYXRlX3R5 - cGUiOiAiaW5jbHVzaXZlIiwgImV4cHJlc3Npb24iOiAiTm92ZW1iZXIsIDIwMTQgdG8gTm92ZW1i - ZXIsIDIwMTUiLCAiYmVnaW4iOiAiMjAxNC0xMS0wMSIsICJqc29ubW9kZWxfdHlwZSI6ICJkYXRl - IiwgImNyZWF0ZWRfYnkiOiAiYWRtaW4iLCAibGFzdF9tb2RpZmllZF9ieSI6ICJhZG1pbiIsICJ1 - c2VyX210aW1lIjogIjIwMTUtMTEtMDJUMjI6NTM6MDdaIn1dLCAiY29tcG9uZW50X2lkIjogIkYx - LTEtMSIsICJwYXJlbnQiOiB7InJlZiI6ICIvcmVwb3NpdG9yaWVzLzIvYXJjaGl2YWxfb2JqZWN0 - cy8xIn0sICJ1cmkiOiAiL3JlcG9zaXRvcmllcy8yL2FyY2hpdmFsX29iamVjdHMvMyIsICJzdXBw - cmVzc2VkIjogZmFsc2UsICJleHRlbnRzIjogW10sICJub3RlcyI6IFt7InN1Ym5vdGVzIjogW3si - cHVibGlzaCI6IHRydWUsICJqc29ubW9kZWxfdHlwZSI6ICJub3RlX3RleHQiLCAiY29udGVudCI6 - ICJUaGlzIGlzIGEgdGVzdCBub3RlIn1dLCAicHVibGlzaCI6IHRydWUsICJwZXJzaXN0ZW50X2lk - IjogIjA2MzM3Mzg4NmEyZjIzZDAzZmUxYTUxZjdjOTZjYThiIiwgInR5cGUiOiAib2RkIiwgImpz - b25tb2RlbF90eXBlIjogIm5vdGVfbXVsdGlwYXJ0In1dLCAibGV2ZWwiOiAic3Vic2VyaWVzIiwg - InVzZXJfbXRpbWUiOiAiMjAxNS0xMS0wMlQyMjo1MzowN1oiLCAiaW5zdGFuY2VzIjogW3siZGln - aXRhbF9vYmplY3QiOiB7InJlZiI6ICIvcmVwb3NpdG9yaWVzLzIvZGlnaXRhbF9vYmplY3RzLzci - fSwgImluc3RhbmNlX3R5cGUiOiAiZGlnaXRhbF9vYmplY3QifV0sICJyaWdodHNfc3RhdGVtZW50 - cyI6IFtdLCAianNvbm1vZGVsX3R5cGUiOiAiYXJjaGl2YWxfb2JqZWN0IiwgImxpbmtlZF9hZ2Vu - dHMiOiBbXSwgInBvc2l0aW9uIjogMCwgInN5c3RlbV9tdGltZSI6ICIyMDE1LTEyLTAzVDAwOjAz - OjQyWiIsICJyZXNvdXJjZSI6IHsicmVmIjogIi9yZXBvc2l0b3JpZXMvMi9yZXNvdXJjZXMvMSJ9 - LCAiY3JlYXRlX3RpbWUiOiAiMjAxNS0wNi0xMVQxNzoyMDoxOVoiLCAibG9ja192ZXJzaW9uIjog - OCwgInJlc3RyaWN0aW9uc19hcHBseSI6IGZhbHNlLCAiZXh0ZXJuYWxfaWRzIjogW10sICJkaXNw - bGF5X3N0cmluZyI6ICJUZXN0IGVkaXRlZCBzdWJzZXJpZXMsIE5vdmVtYmVyLCAyMDE0IHRvIE5v - dmVtYmVyLCAyMDE1IiwgInB1Ymxpc2giOiBmYWxzZSwgInRpdGxlIjogIlRlc3QgZWRpdGVkIHN1 - YnNlcmllcyIsICJoYXNfdW5wdWJsaXNoZWRfYW5jZXN0b3IiOiB0cnVlLCAicmVmX2lkIjogImU2 - MWM0NDFjZDA0ZWI1NzMxY2U2NGRlMzVhNDMzOWZmIiwgImxpbmtlZF9ldmVudHMiOiBbXSwgInN1 - YmplY3RzIjogW10sICJjcmVhdGVkX2J5IjogImFkbWluIiwgImxhc3RfbW9kaWZpZWRfYnkiOiAi - YWRtaW4ifQ== - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['1603'] - User-Agent: [python-requests/2.8.1] - X-ArchivesSpace-Session: [d6226a61876a4e58aff36f9a4d549330abe76909660b1f3de4f50f11db6750c0] - method: POST - uri: http://localhost:8089/repositories/2/archival_objects/3 - response: - body: {string: '{"status":"Updated","id":3,"lock_version":9,"stale":true,"uri":"/repositories/2/archival_objects/3","warnings":[]} - -'} - headers: - Cache-Control: ['private, must-revalidate, max-age=0'] - Content-Length: ['115'] - Content-Type: [application/json] - Date: ['Thu, 03 Dec 2015 01:23:47 GMT'] - Server: [Jetty(8.1.5.v20120716)] - X-Content-Type-Options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.8.1] - X-ArchivesSpace-Session: [d6226a61876a4e58aff36f9a4d549330abe76909660b1f3de4f50f11db6750c0] - method: GET - uri: http://localhost:8089/repositories/2/digital_objects/7 - response: - body: {string: '{"lock_version":1,"digital_object_id":"925bfc8a-d6f8-4479-9b6a-d811a4e7f6bf","title":"Test - digital object with note","restrictions":false,"created_by":"admin","last_modified_by":"admin","create_time":"2015-12-03T01:23:47Z","system_mtime":"2015-12-03T01:23:47Z","user_mtime":"2015-12-03T01:23:47Z","suppressed":false,"digital_object_type":"text","jsonmodel_type":"digital_object","external_ids":[],"subjects":[],"linked_events":[],"extents":[],"dates":[],"external_documents":[],"rights_statements":[],"linked_agents":[],"file_versions":[],"notes":[{"type":"originalsloc","jsonmodel_type":"note_digital_object","content":["The - ether"],"persistent_id":"1b5d0feafe3c9d07fa515eb1e532c84c","publish":true},{"type":"note","jsonmodel_type":"note_digital_object","content":["This - is a test note"],"persistent_id":"27c98cdc882d66ee0177579bc89821ea","publish":true}],"linked_instances":[{"ref":"/repositories/2/archival_objects/3"}],"uri":"/repositories/2/digital_objects/7","repository":{"ref":"/repositories/2"},"tree":{"ref":"/repositories/2/digital_objects/7/tree"}} - -'} - headers: - Cache-Control: ['private, must-revalidate, max-age=0'] - Content-Length: ['1061'] - Content-Type: [application/json] - Date: ['Thu, 03 Dec 2015 01:23:47 GMT'] - Server: [Jetty(8.1.5.v20120716)] - X-Content-Type-Options: [nosniff] - status: {code: 200, message: OK} -version: 1 diff --git a/tests/fixtures/test_add_nested_digital_object_component.yaml b/tests/fixtures/test_add_nested_digital_object_component.yaml deleted file mode 100644 index 3922c97..0000000 --- a/tests/fixtures/test_add_nested_digital_object_component.yaml +++ /dev/null @@ -1,99 +0,0 @@ -interactions: -- request: - body: !!binary | - cGFzc3dvcmQ9YWRtaW4mZXhwaXJpbmc9RmFsc2U= - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['29'] - Content-Type: [application/x-www-form-urlencoded] - User-Agent: [python-requests/2.8.1] - method: POST - uri: http://localhost:8089/users/admin/login - response: - body: {string: '{"session":"d188da574cacd0d7f8f9a12a08b0441b415fed76b83e0019ebcad0af54a2c1f8","user":{"lock_version":706,"username":"admin","name":"Administrator","is_system_user":true,"create_time":"2015-06-11T17:04:21Z","system_mtime":"2015-12-03T01:07:54Z","user_mtime":"2015-12-03T01:07:54Z","jsonmodel_type":"user","groups":[],"is_admin":true,"uri":"/users/1","agent_record":{"ref":"/agents/people/1"},"permissions":{"/repositories/1":["update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record","administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed"],"_archivesspace":["administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed","update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record"]}}} - -'} - headers: - Cache-Control: ['private, must-revalidate, max-age=0'] - Content-Length: ['2206'] - Content-Type: [application/json] - Date: ['Thu, 03 Dec 2015 01:07:54 GMT'] - Server: [Jetty(8.1.5.v20120716)] - X-Content-Type-Options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.8.1] - X-ArchivesSpace-Session: [d188da574cacd0d7f8f9a12a08b0441b415fed76b83e0019ebcad0af54a2c1f8] - method: GET - uri: http://localhost:8089/repositories/2/digital_objects/1 - response: - body: {string: '{"lock_version":0,"digital_object_id":"1","title":"Test digi object","publish":false,"restrictions":false,"created_by":"admin","last_modified_by":"admin","create_time":"2015-11-18T21:29:33Z","system_mtime":"2015-11-18T21:29:33Z","user_mtime":"2015-11-18T21:29:33Z","suppressed":false,"jsonmodel_type":"digital_object","external_ids":[],"subjects":[],"linked_events":[],"extents":[],"dates":[],"external_documents":[],"rights_statements":[],"linked_agents":[],"file_versions":[],"notes":[],"linked_instances":[],"uri":"/repositories/2/digital_objects/1","repository":{"ref":"/repositories/2"},"tree":{"ref":"/repositories/2/digital_objects/1/tree"}} - -'} - headers: - Cache-Control: ['private, must-revalidate, max-age=0'] - Content-Length: ['649'] - Content-Type: [application/json] - Date: ['Thu, 03 Dec 2015 01:07:54 GMT'] - Server: [Jetty(8.1.5.v20120716)] - X-Content-Type-Options: [nosniff] - status: {code: 200, message: OK} -- request: - body: !!binary | - eyJ0aXRsZSI6ICJUaGlzIGlzIGEgY2hpbGQgRE9DIiwgInBhcmVudCI6IHsicmVmIjogIi9yZXBv - c2l0b3JpZXMvMi9kaWdpdGFsX29iamVjdF9jb21wb25lbnRzLzMifSwgImpzb25tb2RlbF90eXBl - IjogImRpZ2l0YWxfb2JqZWN0X2NvbXBvbmVudCIsICJsYWJlbCI6ICJDaGlsZCBET0MiLCAiZGln - aXRhbF9vYmplY3QiOiB7InJlZiI6ICIvcmVwb3NpdG9yaWVzLzIvZGlnaXRhbF9vYmplY3RzLzEi - fX0= - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['230'] - User-Agent: [python-requests/2.8.1] - X-ArchivesSpace-Session: [d188da574cacd0d7f8f9a12a08b0441b415fed76b83e0019ebcad0af54a2c1f8] - method: POST - uri: http://localhost:8089/repositories/2/digital_object_components - response: - body: {string: '{"status":"Created","id":5,"lock_version":0,"stale":true,"uri":"/repositories/2/digital_object_components/5","warnings":[]} - -'} - headers: - Cache-Control: ['private, must-revalidate, max-age=0'] - Content-Length: ['124'] - Content-Type: [application/json] - Date: ['Thu, 03 Dec 2015 01:07:54 GMT'] - Server: [Jetty(8.1.5.v20120716)] - X-Content-Type-Options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.8.1] - X-ArchivesSpace-Session: [d188da574cacd0d7f8f9a12a08b0441b415fed76b83e0019ebcad0af54a2c1f8] - method: GET - uri: http://localhost:8089/repositories/2/digital_object_components/5 - response: - body: {string: '{"lock_version":0,"position":1,"title":"This is a child DOC","display_string":"This - is a child DOC","label":"Child DOC","created_by":"admin","last_modified_by":"admin","create_time":"2015-12-03T01:07:54Z","system_mtime":"2015-12-03T01:07:54Z","user_mtime":"2015-12-03T01:07:54Z","suppressed":false,"jsonmodel_type":"digital_object_component","external_ids":[],"subjects":[],"linked_events":[],"extents":[],"dates":[],"external_documents":[],"rights_statements":[],"linked_agents":[],"file_versions":[],"notes":[],"uri":"/repositories/2/digital_object_components/5","repository":{"ref":"/repositories/2"},"digital_object":{"ref":"/repositories/2/digital_objects/1"},"parent":{"ref":"/repositories/2/digital_object_components/3"},"has_unpublished_ancestor":true} - -'} - headers: - Cache-Control: ['private, must-revalidate, max-age=0'] - Content-Length: ['761'] - Content-Type: [application/json] - Date: ['Thu, 03 Dec 2015 01:07:54 GMT'] - Server: [Jetty(8.1.5.v20120716)] - X-Content-Type-Options: [nosniff] - status: {code: 200, message: OK} -version: 1 diff --git a/tests/fixtures/test_adding_a_digital_object_to_a_record_with_a_singlepart_note.yaml b/tests/fixtures/test_adding_a_digital_object_to_a_record_with_a_singlepart_note.yaml deleted file mode 100644 index ee89ed4..0000000 --- a/tests/fixtures/test_adding_a_digital_object_to_a_record_with_a_singlepart_note.yaml +++ /dev/null @@ -1,147 +0,0 @@ -interactions: -- request: - body: !!binary | - ZXhwaXJpbmc9RmFsc2UmcGFzc3dvcmQ9YWRtaW4= - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['29'] - Content-Type: [application/x-www-form-urlencoded] - User-Agent: [python-requests/2.9.1] - method: POST - uri: http://localhost:8089/users/admin/login - response: - body: {string: '{"session":"1ea928f79eb921a2857d5ef2f4ffa1a0d3c9a8daf667c69e7b64fd6e333dd7a3","user":{"lock_version":803,"username":"admin","name":"Administrator","is_system_user":true,"create_time":"2015-06-11T17:04:21Z","system_mtime":"2016-01-07T18:46:35Z","user_mtime":"2016-01-07T18:46:35Z","jsonmodel_type":"user","groups":[],"is_admin":true,"uri":"/users/1","agent_record":{"ref":"/agents/people/1"},"permissions":{"/repositories/1":["update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record","administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed"],"_archivesspace":["administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed","update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record"]}}} - -'} - headers: - Cache-Control: ['private, must-revalidate, max-age=0'] - Content-Length: ['2206'] - Content-Type: [application/json] - Date: ['Thu, 07 Jan 2016 18:46:35 GMT'] - Server: [Jetty(8.1.5.v20120716)] - X-Content-Type-Options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.9.1] - X-ArchivesSpace-Session: [1ea928f79eb921a2857d5ef2f4ffa1a0d3c9a8daf667c69e7b64fd6e333dd7a3] - method: GET - uri: http://localhost:8089/repositories/2/archival_objects/21 - response: - body: {string: '{"lock_version":0,"position":1,"publish":false,"ref_id":"4e160068664159ca2107de634a3183f9","title":"Child - with singlepart note","display_string":"Child with singlepart note","restrictions_apply":false,"created_by":"admin","last_modified_by":"admin","create_time":"2016-01-07T18:40:06Z","system_mtime":"2016-01-07T18:40:06Z","user_mtime":"2016-01-07T18:40:06Z","suppressed":false,"level":"series","jsonmodel_type":"archival_object","external_ids":[],"subjects":[],"linked_events":[],"extents":[],"dates":[],"external_documents":[],"rights_statements":[],"linked_agents":[],"instances":[],"notes":[{"jsonmodel_type":"note_singlepart","type":"abstract","content":["This - is an abstract"],"persistent_id":"a8704fed6c62a8fa51dbc17affc8df5f","publish":false}],"uri":"/repositories/2/archival_objects/21","repository":{"ref":"/repositories/2"},"resource":{"ref":"/repositories/2/resources/2"},"has_unpublished_ancestor":true} - -'} - headers: - Cache-Control: ['private, must-revalidate, max-age=0'] - Content-Length: ['918'] - Content-Type: [application/json] - Date: ['Thu, 07 Jan 2016 18:46:35 GMT'] - Server: [Jetty(8.1.5.v20120716)] - X-Content-Type-Options: [nosniff] - status: {code: 200, message: OK} -- request: - body: !!binary | - eyJ0aXRsZSI6ICJUZXN0IGRpZ2l0YWwgb2JqZWN0IHdob3NlIHBhcmVudCBoYXMgYSBzaW5nbGVw - YXJ0IG5vdGUiLCAic3ViamVjdHMiOiBbXSwgImxhbmd1YWdlIjogIiIsICJub3RlcyI6IFt7Imxh - YmVsIjogIiIsICJ0eXBlIjogIm5vdGUiLCAianNvbm1vZGVsX3R5cGUiOiAibm90ZV9kaWdpdGFs - X29iamVjdCIsICJwdWJsaXNoIjogZmFsc2UsICJjb250ZW50IjogWyJUaGlzIGlzIGFuIGFic3Ry - YWN0Il19XSwgImRpZ2l0YWxfb2JqZWN0X3R5cGUiOiAidGV4dCIsICJkaWdpdGFsX29iamVjdF9p - ZCI6ICI1ZjQ2NGRiMi05MzY1LTQ5MmYtYjdjNy03OTU4YmFlYjAzODgiLCAibGlua2VkX2FnZW50 - cyI6IFtdLCAicmVzdHJpY3Rpb25zIjogZmFsc2V9 - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['372'] - User-Agent: [python-requests/2.9.1] - X-ArchivesSpace-Session: [1ea928f79eb921a2857d5ef2f4ffa1a0d3c9a8daf667c69e7b64fd6e333dd7a3] - method: POST - uri: http://localhost:8089/repositories/2/digital_objects - response: - body: {string: '{"status":"Created","id":9,"lock_version":0,"stale":null,"uri":"/repositories/2/digital_objects/9","warnings":[]} - -'} - headers: - Cache-Control: ['private, must-revalidate, max-age=0'] - Content-Length: ['114'] - Content-Type: [application/json] - Date: ['Thu, 07 Jan 2016 18:46:35 GMT'] - Server: [Jetty(8.1.5.v20120716)] - X-Content-Type-Options: [nosniff] - status: {code: 200, message: OK} -- request: - body: !!binary | - eyJ0aXRsZSI6ICJDaGlsZCB3aXRoIHNpbmdsZXBhcnQgbm90ZSIsICJleHRlcm5hbF9pZHMiOiBb - XSwgImxhc3RfbW9kaWZpZWRfYnkiOiAiYWRtaW4iLCAibGlua2VkX2FnZW50cyI6IFtdLCAiY3Jl - YXRlZF9ieSI6ICJhZG1pbiIsICJwdWJsaXNoIjogZmFsc2UsICJsaW5rZWRfZXZlbnRzIjogW10s - ICJsZXZlbCI6ICJzZXJpZXMiLCAicmVmX2lkIjogIjRlMTYwMDY4NjY0MTU5Y2EyMTA3ZGU2MzRh - MzE4M2Y5IiwgImhhc191bnB1Ymxpc2hlZF9hbmNlc3RvciI6IHRydWUsICJyaWdodHNfc3RhdGVt - ZW50cyI6IFtdLCAic3lzdGVtX210aW1lIjogIjIwMTYtMDEtMDdUMTg6NDA6MDZaIiwgImxvY2tf - dmVyc2lvbiI6IDAsICJleHRlbnRzIjogW10sICJjcmVhdGVfdGltZSI6ICIyMDE2LTAxLTA3VDE4 - OjQwOjA2WiIsICJ1c2VyX210aW1lIjogIjIwMTYtMDEtMDdUMTg6NDA6MDZaIiwgInN1YmplY3Rz - IjogW10sICJzdXBwcmVzc2VkIjogZmFsc2UsICJyZXNvdXJjZSI6IHsicmVmIjogIi9yZXBvc2l0 - b3JpZXMvMi9yZXNvdXJjZXMvMiJ9LCAicmVwb3NpdG9yeSI6IHsicmVmIjogIi9yZXBvc2l0b3Jp - ZXMvMiJ9LCAicmVzdHJpY3Rpb25zX2FwcGx5IjogZmFsc2UsICJ1cmkiOiAiL3JlcG9zaXRvcmll - cy8yL2FyY2hpdmFsX29iamVjdHMvMjEiLCAicG9zaXRpb24iOiAxLCAianNvbm1vZGVsX3R5cGUi - OiAiYXJjaGl2YWxfb2JqZWN0IiwgImV4dGVybmFsX2RvY3VtZW50cyI6IFtdLCAibm90ZXMiOiBb - eyJ0eXBlIjogImFic3RyYWN0IiwgInB1Ymxpc2giOiBmYWxzZSwgImpzb25tb2RlbF90eXBlIjog - Im5vdGVfc2luZ2xlcGFydCIsICJwZXJzaXN0ZW50X2lkIjogImE4NzA0ZmVkNmM2MmE4ZmE1MWRi - YzE3YWZmYzhkZjVmIiwgImNvbnRlbnQiOiBbIlRoaXMgaXMgYW4gYWJzdHJhY3QiXX1dLCAiZGlz - cGxheV9zdHJpbmciOiAiQ2hpbGQgd2l0aCBzaW5nbGVwYXJ0IG5vdGUiLCAiaW5zdGFuY2VzIjog - W3siaW5zdGFuY2VfdHlwZSI6ICJkaWdpdGFsX29iamVjdCIsICJkaWdpdGFsX29iamVjdCI6IHsi - cmVmIjogIi9yZXBvc2l0b3JpZXMvMi9kaWdpdGFsX29iamVjdHMvOSJ9fV0sICJkYXRlcyI6IFtd - fQ== - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['1084'] - User-Agent: [python-requests/2.9.1] - X-ArchivesSpace-Session: [1ea928f79eb921a2857d5ef2f4ffa1a0d3c9a8daf667c69e7b64fd6e333dd7a3] - method: POST - uri: http://localhost:8089/repositories/2/archival_objects/21 - response: - body: {string: '{"status":"Updated","id":21,"lock_version":1,"stale":true,"uri":"/repositories/2/archival_objects/21","warnings":[]} - -'} - headers: - Cache-Control: ['private, must-revalidate, max-age=0'] - Content-Length: ['117'] - Content-Type: [application/json] - Date: ['Thu, 07 Jan 2016 18:46:35 GMT'] - Server: [Jetty(8.1.5.v20120716)] - X-Content-Type-Options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.9.1] - X-ArchivesSpace-Session: [1ea928f79eb921a2857d5ef2f4ffa1a0d3c9a8daf667c69e7b64fd6e333dd7a3] - method: GET - uri: http://localhost:8089/repositories/2/digital_objects/9 - response: - body: {string: '{"lock_version":1,"digital_object_id":"5f464db2-9365-492f-b7c7-7958baeb0388","title":"Test - digital object whose parent has a singlepart note","restrictions":false,"created_by":"admin","last_modified_by":"admin","create_time":"2016-01-07T18:46:35Z","system_mtime":"2016-01-07T18:46:35Z","user_mtime":"2016-01-07T18:46:35Z","suppressed":false,"digital_object_type":"text","jsonmodel_type":"digital_object","external_ids":[],"subjects":[],"linked_events":[],"extents":[],"dates":[],"external_documents":[],"rights_statements":[],"linked_agents":[],"file_versions":[],"notes":[{"type":"note","jsonmodel_type":"note_digital_object","content":["This - is an abstract"],"persistent_id":"8c569b3744607ce9dbb17b1f2ca4dff0","publish":false}],"linked_instances":[{"ref":"/repositories/2/archival_objects/21"}],"uri":"/repositories/2/digital_objects/9","repository":{"ref":"/repositories/2"},"tree":{"ref":"/repositories/2/digital_objects/9/tree"}} - -'} - headers: - Cache-Control: ['private, must-revalidate, max-age=0'] - Content-Length: ['935'] - Content-Type: [application/json] - Date: ['Thu, 07 Jan 2016 18:46:36 GMT'] - Server: [Jetty(8.1.5.v20120716)] - X-Content-Type-Options: [nosniff] - status: {code: 200, message: OK} -version: 1 diff --git a/tests/fixtures/test_adding_child_with_note.yaml b/tests/fixtures/test_adding_child_with_note.yaml deleted file mode 100644 index 3a043b3..0000000 --- a/tests/fixtures/test_adding_child_with_note.yaml +++ /dev/null @@ -1,77 +0,0 @@ -interactions: -- request: - body: !!binary | - cGFzc3dvcmQ9YWRtaW4mZXhwaXJpbmc9RmFsc2U= - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['29'] - Content-Type: [application/x-www-form-urlencoded] - User-Agent: [python-requests/2.9.1] - method: POST - uri: http://localhost:8089/users/admin/login - response: - body: {string: '{"session":"60accd40600bbde50c5d8c237d6e34b0826bdd7385147bdf38a99f519ea26cc4","user":{"lock_version":814,"username":"admin","name":"Administrator","is_system_user":true,"create_time":"2015-06-11T17:04:21Z","system_mtime":"2016-01-08T19:06:46Z","user_mtime":"2016-01-08T19:06:46Z","jsonmodel_type":"user","groups":[],"is_admin":true,"uri":"/users/1","agent_record":{"ref":"/agents/people/1"},"permissions":{"/repositories/1":["update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record","administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed"],"_archivesspace":["administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed","update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record"]}}} - -'} - headers: - Cache-Control: ['private, must-revalidate, max-age=0'] - Content-Length: ['2206'] - Content-Type: [application/json] - Date: ['Fri, 08 Jan 2016 19:06:46 GMT'] - Server: [Jetty(8.1.5.v20120716)] - X-Content-Type-Options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.9.1] - X-ArchivesSpace-Session: [60accd40600bbde50c5d8c237d6e34b0826bdd7385147bdf38a99f519ea26cc4] - method: GET - uri: http://localhost:8089/repositories/2/resources/5 - response: - body: {string: '{"lock_version":0,"title":"Sarah''s New Testing Collection","publish":false,"restrictions":false,"created_by":"admin","last_modified_by":"admin","create_time":"2016-01-08T18:48:56Z","system_mtime":"2016-01-08T18:48:56Z","user_mtime":"2016-01-08T18:48:56Z","suppressed":false,"id_0":"7890","level":"collection","jsonmodel_type":"resource","external_ids":[],"subjects":[],"linked_events":[],"extents":[{"lock_version":0,"number":"1","created_by":"admin","last_modified_by":"admin","create_time":"2016-01-08T18:48:56Z","system_mtime":"2016-01-08T18:48:56Z","user_mtime":"2016-01-08T18:48:56Z","portion":"whole","extent_type":"terabytes","jsonmodel_type":"extent"}],"dates":[{"lock_version":0,"expression":"2010-2015","created_by":"admin","last_modified_by":"admin","create_time":"2016-01-08T18:48:56Z","system_mtime":"2016-01-08T18:48:56Z","user_mtime":"2016-01-08T18:48:56Z","date_type":"bulk","label":"creation","jsonmodel_type":"date"}],"external_documents":[],"rights_statements":[],"linked_agents":[],"instances":[],"deaccessions":[],"related_accessions":[],"notes":[],"uri":"/repositories/2/resources/5","repository":{"ref":"/repositories/2"},"tree":{"ref":"/repositories/2/resources/5/tree"}} - -'} - headers: - Cache-Control: ['private, must-revalidate, max-age=0'] - Content-Length: ['1196'] - Content-Type: [application/json] - Date: ['Fri, 08 Jan 2016 19:06:46 GMT'] - Server: [Jetty(8.1.5.v20120716)] - X-Content-Type-Options: [nosniff] - status: {code: 200, message: OK} -- request: - body: !!binary | - eyJub3RlcyI6IFt7InN1Ym5vdGVzIjogW3siY29udGVudCI6ICJUaGlzIGlzIGEgdGVzdCBub3Rl - IiwgInB1Ymxpc2giOiB0cnVlLCAianNvbm1vZGVsX3R5cGUiOiAibm90ZV90ZXh0In1dLCAidHlw - ZSI6ICJvZGQiLCAianNvbm1vZGVsX3R5cGUiOiAibm90ZV9tdWx0aXBhcnQiLCAicHVibGlzaCI6 - IHRydWV9XSwgInJlc291cmNlIjogeyJyZWYiOiAiL3JlcG9zaXRvcmllcy8yL3Jlc291cmNlcy81 - In0sICJ0aXRsZSI6ICJUZXN0IGNoaWxkIiwgImpzb25tb2RlbF90eXBlIjogImFyY2hpdmFsX29i - amVjdCIsICJsZXZlbCI6ICJpdGVtIn0= - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['308'] - User-Agent: [python-requests/2.9.1] - X-ArchivesSpace-Session: [60accd40600bbde50c5d8c237d6e34b0826bdd7385147bdf38a99f519ea26cc4] - method: POST - uri: http://localhost:8089/repositories/2/archival_objects - response: - body: {string: '{"status":"Created","id":24,"lock_version":0,"stale":true,"uri":"/repositories/2/archival_objects/24","warnings":[]} - -'} - headers: - Cache-Control: ['private, must-revalidate, max-age=0'] - Content-Length: ['117'] - Content-Type: [application/json] - Date: ['Fri, 08 Jan 2016 19:06:47 GMT'] - Server: [Jetty(8.1.5.v20120716)] - X-Content-Type-Options: [nosniff] - status: {code: 200, message: OK} -version: 1 diff --git a/tests/fixtures/test_augment_ids.yaml b/tests/fixtures/test_augment_ids.yaml deleted file mode 100644 index 4cc67c6..0000000 --- a/tests/fixtures/test_augment_ids.yaml +++ /dev/null @@ -1,156 +0,0 @@ -interactions: -- request: - body: password=admin - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Content-Length: ['14'] - Content-Type: [application/x-www-form-urlencoded] - User-Agent: [python-requests/2.3.0 CPython/2.7.10 Darwin/14.4.0] - method: POST - uri: http://localhost:8089/users/admin/login - response: - body: {string: !!python/unicode '{"session":"3cc051a4be61263e9e409b232be66f3af240e3940f1a53c0e83f25a0349f7c5c","user":{"lock_version":26,"username":"admin","name":"Administrator","is_system_user":true,"create_time":"2015-06-11T17:04:21Z","system_mtime":"2015-06-30T23:39:51Z","user_mtime":"2015-06-30T23:39:51Z","jsonmodel_type":"user","groups":[],"is_admin":true,"uri":"/users/1","agent_record":{"ref":"/agents/people/1"},"permissions":{"/repositories/1":["update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record","administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed"],"_archivesspace":["administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed","update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record"]}}} - -'} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['2205'] - content-type: [application/json] - date: ['Tue, 30 Jun 2015 23:39:51 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - User-Agent: [python-requests/2.3.0 CPython/2.7.10 Darwin/14.4.0] - X-ArchivesSpace-Session: [!!python/unicode 3cc051a4be61263e9e409b232be66f3af240e3940f1a53c0e83f25a0349f7c5c] - method: GET - uri: http://localhost:8089/repositories/2/resources/1/tree - response: - body: {string: !!python/unicode '{"title":"Test fonds","id":1,"node_type":"resource","publish":false,"suppressed":false,"children":[{"title":"Test - series","id":1,"record_uri":"/repositories/2/archival_objects/1","publish":false,"suppressed":false,"node_type":"archival_object","level":"series","has_children":true,"children":[{"title":"Test - subseries","id":3,"record_uri":"/repositories/2/archival_objects/3","publish":false,"suppressed":false,"node_type":"archival_object","level":"subseries","has_children":true,"children":[{"title":"Test - file","id":4,"record_uri":"/repositories/2/archival_objects/4","publish":false,"suppressed":false,"node_type":"archival_object","level":"file","has_children":false,"children":[],"instance_types":[],"containers":[]}],"instance_types":[],"containers":[]}],"instance_types":[],"containers":[]},{"title":"Test - series 2","id":2,"record_uri":"/repositories/2/archival_objects/2","publish":false,"suppressed":false,"node_type":"archival_object","level":"series","has_children":false,"children":[],"instance_types":[],"containers":[]}],"record_uri":"/repositories/2/resources/1","level":"fonds","jsonmodel_type":"resource_tree","instance_types":[],"containers":[]} - -'} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['1165'] - content-type: [application/json] - date: ['Tue, 30 Jun 2015 23:39:51 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - User-Agent: [python-requests/2.3.0 CPython/2.7.10 Darwin/14.4.0] - X-ArchivesSpace-Session: [!!python/unicode 3cc051a4be61263e9e409b232be66f3af240e3940f1a53c0e83f25a0349f7c5c] - method: GET - uri: http://localhost:8089/repositories/2/resources/1 - response: - body: {string: !!python/unicode '{"lock_version":0,"title":"Test fonds","publish":false,"restrictions":false,"created_by":"admin","last_modified_by":"admin","create_time":"2015-06-11T17:08:42Z","system_mtime":"2015-06-11T17:08:42Z","user_mtime":"2015-06-11T17:08:42Z","suppressed":false,"id_0":"F1","language":"eng","level":"fonds","jsonmodel_type":"resource","external_ids":[],"subjects":[],"linked_events":[],"extents":[{"lock_version":0,"number":"1","created_by":"admin","last_modified_by":"admin","create_time":"2015-06-11T17:08:42Z","system_mtime":"2015-06-11T17:08:42Z","user_mtime":"2015-06-11T17:08:42Z","portion":"whole","extent_type":"cassettes","jsonmodel_type":"extent"}],"dates":[{"lock_version":0,"begin":"2015-01-01","created_by":"admin","last_modified_by":"admin","create_time":"2015-06-11T17:08:42Z","system_mtime":"2015-06-11T17:08:42Z","user_mtime":"2015-06-11T17:08:42Z","date_type":"single","label":"creation","jsonmodel_type":"date"}],"external_documents":[],"rights_statements":[],"linked_agents":[],"instances":[],"deaccessions":[],"related_accessions":[],"notes":[],"uri":"/repositories/2/resources/1","repository":{"ref":"/repositories/2"},"tree":{"ref":"/repositories/2/resources/1/tree"}} - -'} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['1184'] - content-type: [application/json] - date: ['Tue, 30 Jun 2015 23:39:51 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - User-Agent: [python-requests/2.3.0 CPython/2.7.10 Darwin/14.4.0] - X-ArchivesSpace-Session: [!!python/unicode 3cc051a4be61263e9e409b232be66f3af240e3940f1a53c0e83f25a0349f7c5c] - method: GET - uri: http://localhost:8089/repositories/2/archival_objects/1 - response: - body: {string: !!python/unicode '{"lock_version":1,"position":0,"publish":false,"ref_id":"72aa597a3d4078c3f61f6000ac068f38","component_id":"F1-1","title":"Test - series","display_string":"Test series","restrictions_apply":false,"created_by":"admin","last_modified_by":"admin","create_time":"2015-06-11T17:14:48Z","system_mtime":"2015-06-11T17:45:18Z","user_mtime":"2015-06-11T17:45:18Z","suppressed":false,"level":"series","jsonmodel_type":"archival_object","external_ids":[],"subjects":[],"linked_events":[],"extents":[],"dates":[],"external_documents":[],"rights_statements":[],"linked_agents":[],"instances":[],"notes":[],"uri":"/repositories/2/archival_objects/1","repository":{"ref":"/repositories/2"},"resource":{"ref":"/repositories/2/resources/1"},"has_unpublished_ancestor":true} - -'} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['754'] - content-type: [application/json] - date: ['Tue, 30 Jun 2015 23:39:51 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - User-Agent: [python-requests/2.3.0 CPython/2.7.10 Darwin/14.4.0] - X-ArchivesSpace-Session: [!!python/unicode 3cc051a4be61263e9e409b232be66f3af240e3940f1a53c0e83f25a0349f7c5c] - method: GET - uri: http://localhost:8089/repositories/2/archival_objects/2 - response: - body: {string: !!python/unicode '{"lock_version":1,"position":1,"publish":false,"ref_id":"2d6194e7945563b58be69b5a70887239","component_id":"F1-2","title":"Test - series 2","display_string":"Test series 2","restrictions_apply":false,"created_by":"admin","last_modified_by":"admin","create_time":"2015-06-11T17:15:03Z","system_mtime":"2015-06-11T17:46:12Z","user_mtime":"2015-06-11T17:46:12Z","suppressed":false,"level":"series","jsonmodel_type":"archival_object","external_ids":[],"subjects":[],"linked_events":[],"extents":[],"dates":[],"external_documents":[],"rights_statements":[],"linked_agents":[],"instances":[],"notes":[],"uri":"/repositories/2/archival_objects/2","repository":{"ref":"/repositories/2"},"resource":{"ref":"/repositories/2/resources/1"},"has_unpublished_ancestor":true} - -'} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['758'] - content-type: [application/json] - date: ['Tue, 30 Jun 2015 23:39:51 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - User-Agent: [python-requests/2.3.0 CPython/2.7.10 Darwin/14.4.0] - X-ArchivesSpace-Session: [!!python/unicode 3cc051a4be61263e9e409b232be66f3af240e3940f1a53c0e83f25a0349f7c5c] - method: GET - uri: http://localhost:8089/repositories/2/resources/2/tree - response: - body: {string: !!python/unicode '{"title":"Some other fonds","id":2,"node_type":"resource","publish":false,"suppressed":false,"children":[],"record_uri":"/repositories/2/resources/2","level":"fonds","jsonmodel_type":"resource_tree","instance_types":[],"containers":[]} - -'} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['236'] - content-type: [application/json] - date: ['Tue, 30 Jun 2015 23:39:51 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - User-Agent: [python-requests/2.3.0 CPython/2.7.10 Darwin/14.4.0] - X-ArchivesSpace-Session: [!!python/unicode 3cc051a4be61263e9e409b232be66f3af240e3940f1a53c0e83f25a0349f7c5c] - method: GET - uri: http://localhost:8089/repositories/2/resources/2 - response: - body: {string: !!python/unicode '{"lock_version":0,"title":"Some other fonds","publish":false,"restrictions":false,"created_by":"admin","last_modified_by":"admin","create_time":"2015-06-30T23:17:57Z","system_mtime":"2015-06-30T23:17:57Z","user_mtime":"2015-06-30T23:17:57Z","suppressed":false,"id_0":"F2","level":"fonds","jsonmodel_type":"resource","external_ids":[],"subjects":[],"linked_events":[],"extents":[{"lock_version":0,"number":"1","created_by":"admin","last_modified_by":"admin","create_time":"2015-06-30T23:17:57Z","system_mtime":"2015-06-30T23:17:57Z","user_mtime":"2015-06-30T23:17:57Z","portion":"whole","extent_type":"cassettes","jsonmodel_type":"extent"}],"dates":[{"lock_version":0,"begin":"2015-06-29","created_by":"admin","last_modified_by":"admin","create_time":"2015-06-30T23:17:57Z","system_mtime":"2015-06-30T23:17:57Z","user_mtime":"2015-06-30T23:17:57Z","date_type":"bulk","label":"creation","jsonmodel_type":"date"}],"external_documents":[],"rights_statements":[],"linked_agents":[],"instances":[],"deaccessions":[],"related_accessions":[],"notes":[],"uri":"/repositories/2/resources/2","repository":{"ref":"/repositories/2"},"tree":{"ref":"/repositories/2/resources/2/tree"}} - -'} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['1171'] - content-type: [application/json] - date: ['Tue, 30 Jun 2015 23:39:51 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -version: 1 diff --git a/tests/fixtures/test_client_logout.yaml b/tests/fixtures/test_client_logout.yaml deleted file mode 100644 index fe7697c..0000000 --- a/tests/fixtures/test_client_logout.yaml +++ /dev/null @@ -1,47 +0,0 @@ -interactions: -- request: - body: expiring=False&password=admin - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['29'] - Content-Type: [application/x-www-form-urlencoded] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-63-generic] - method: POST - uri: http://localhost:8089/users/admin/login - response: - body: {string: !!python/unicode '{"session":"beb7f2a62252458338b751e91b1a7b2ba663b87029b499fe53f035f3764bb0d0","user":{"lock_version":287,"username":"admin","name":"Administrator","is_system_user":true,"create_time":"2015-06-11T17:04:21Z","system_mtime":"2015-10-27T23:47:37Z","user_mtime":"2015-10-27T23:47:37Z","jsonmodel_type":"user","groups":[],"is_admin":true,"uri":"/users/1","agent_record":{"ref":"/agents/people/1"},"permissions":{"/repositories/1":["update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record","administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed"],"_archivesspace":["administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed","update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record"]}}} - -'} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['2206'] - content-type: [application/json] - date: ['Tue, 27 Oct 2015 23:47:37 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-63-generic] - X-ArchivesSpace-Session: [!!python/unicode beb7f2a62252458338b751e91b1a7b2ba663b87029b499fe53f035f3764bb0d0] - method: POST - uri: http://localhost:8089/logout - response: - body: {string: !!python/unicode '{"status":"session_logged_out"} - -'} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['31'] - content-type: [application/json] - date: ['Tue, 27 Oct 2015 23:47:37 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -version: 1 \ No newline at end of file diff --git a/tests/fixtures/test_contentless_notes.yaml b/tests/fixtures/test_contentless_notes.yaml deleted file mode 100644 index f645f9c..0000000 --- a/tests/fixtures/test_contentless_notes.yaml +++ /dev/null @@ -1,139 +0,0 @@ -interactions: -- request: - body: !!binary | - cGFzc3dvcmQ9YWRtaW4mZXhwaXJpbmc9RmFsc2U= - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['29'] - Content-Type: [application/x-www-form-urlencoded] - User-Agent: [python-requests/2.9.1] - method: POST - uri: http://localhost:8089/users/admin/login - response: - body: {string: '{"session":"3436096c34006577491aae6c6dc485ce5a987afd90f79366c18ec63389ddb456","user":{"lock_version":808,"username":"admin","name":"Administrator","is_system_user":true,"create_time":"2015-06-11T17:04:21Z","system_mtime":"2016-01-07T20:55:29Z","user_mtime":"2016-01-07T20:55:29Z","jsonmodel_type":"user","groups":[],"is_admin":true,"uri":"/users/1","agent_record":{"ref":"/agents/people/1"},"permissions":{"/repositories/1":["update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record","administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed"],"_archivesspace":["administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed","update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record"]}}} - -'} - headers: - Cache-Control: ['private, must-revalidate, max-age=0'] - Content-Length: ['2206'] - Content-Type: [application/json] - Date: ['Thu, 07 Jan 2016 20:55:29 GMT'] - Server: [Jetty(8.1.5.v20120716)] - X-Content-Type-Options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.9.1] - X-ArchivesSpace-Session: [3436096c34006577491aae6c6dc485ce5a987afd90f79366c18ec63389ddb456] - method: GET - uri: http://localhost:8089/repositories/2/search?page=1&page_size=30&q=primary_type%3Aresource - response: - body: {string: '{"first_page":1,"last_page":1,"this_page":1,"offset_first":1,"offset_last":3,"total_hits":3,"results":[{"id":"/repositories/2/resources/1","title":"Test - fonds","primary_type":"resource","types":["resource"],"json":"{\"lock_version\":11,\"title\":\"Test - fonds\",\"publish\":false,\"restrictions\":false,\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-06-11T17:08:42Z\",\"system_mtime\":\"2015-12-03T00:03:41Z\",\"user_mtime\":\"2015-12-03T00:03:41Z\",\"suppressed\":false,\"id_0\":\"F1\",\"language\":\"eng\",\"level\":\"fonds\",\"jsonmodel_type\":\"resource\",\"external_ids\":[],\"subjects\":[],\"linked_events\":[],\"extents\":[{\"lock_version\":0,\"number\":\"1\",\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-12-03T00:03:42Z\",\"system_mtime\":\"2015-12-03T00:03:42Z\",\"user_mtime\":\"2015-12-03T00:03:42Z\",\"portion\":\"whole\",\"extent_type\":\"cassettes\",\"jsonmodel_type\":\"extent\"}],\"dates\":[{\"lock_version\":0,\"begin\":\"2015-01-01\",\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-12-03T00:03:42Z\",\"system_mtime\":\"2015-12-03T00:03:42Z\",\"user_mtime\":\"2015-12-03T00:03:42Z\",\"date_type\":\"single\",\"label\":\"creation\",\"jsonmodel_type\":\"date\"}],\"external_documents\":[],\"rights_statements\":[],\"linked_agents\":[],\"instances\":[],\"deaccessions\":[],\"related_accessions\":[{\"ref\":\"/repositories/2/accessions/1\"}],\"notes\":[{\"content\":[\"Singlepart - note\"],\"type\":\"physdesc\",\"jsonmodel_type\":\"note_singlepart\",\"persistent_id\":\"cdc013c483de98b8a1762302faf8fd32\",\"publish\":true}],\"uri\":\"/repositories/2/resources/1\",\"repository\":{\"ref\":\"/repositories/2\"},\"tree\":{\"ref\":\"/repositories/2/resources/1/tree\"}}","suppressed":false,"publish":false,"system_generated":false,"repository":"/repositories/2","created_by":"admin","last_modified_by":"admin","user_mtime":"2015-12-03T00:03:41Z","system_mtime":"2015-12-03T00:03:41Z","create_time":"2015-06-11T17:08:42Z","level":"fonds","identifier":"F1","language":"eng","restrictions":"false","four_part_id":"F1","uri":"/repositories/2/resources/1","jsonmodel_type":"resource"},{"id":"/repositories/2/resources/2","title":"Some - other fonds","primary_type":"resource","types":["resource"],"json":"{\"lock_version\":4,\"title\":\"Some - other fonds\",\"publish\":false,\"restrictions\":false,\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-06-30T23:17:57Z\",\"system_mtime\":\"2015-12-02T01:05:21Z\",\"user_mtime\":\"2015-12-02T01:05:21Z\",\"suppressed\":false,\"id_0\":\"F2\",\"level\":\"fonds\",\"jsonmodel_type\":\"resource\",\"external_ids\":[],\"subjects\":[],\"linked_events\":[],\"extents\":[{\"lock_version\":0,\"number\":\"1\",\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-12-02T01:05:21Z\",\"system_mtime\":\"2015-12-02T01:05:21Z\",\"user_mtime\":\"2015-12-02T01:05:21Z\",\"portion\":\"whole\",\"extent_type\":\"cassettes\",\"jsonmodel_type\":\"extent\"}],\"dates\":[{\"lock_version\":0,\"begin\":\"2015-06-29\",\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-12-02T01:05:21Z\",\"system_mtime\":\"2015-12-02T01:05:21Z\",\"user_mtime\":\"2015-12-02T01:05:21Z\",\"date_type\":\"bulk\",\"label\":\"creation\",\"jsonmodel_type\":\"date\"}],\"external_documents\":[],\"rights_statements\":[],\"linked_agents\":[],\"instances\":[{\"lock_version\":0,\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-12-02T01:05:21Z\",\"system_mtime\":\"2015-12-02T01:05:21Z\",\"user_mtime\":\"2015-12-02T01:05:21Z\",\"instance_type\":\"digital_object\",\"jsonmodel_type\":\"instance\",\"digital_object\":{\"ref\":\"/repositories/2/digital_objects/3\",\"_resolved\":{\"lock_version\":4,\"digital_object_id\":\"f808032e-c6ec-4242-b7aa-5395988b9f7e\",\"title\":\"test\",\"restrictions\":false,\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-12-02T00:55:38Z\",\"system_mtime\":\"2015-12-02T01:05:22Z\",\"user_mtime\":\"2015-12-02T00:55:38Z\",\"suppressed\":false,\"digital_object_type\":\"text\",\"jsonmodel_type\":\"digital_object\",\"external_ids\":[],\"subjects\":[],\"linked_events\":[],\"extents\":[],\"dates\":[],\"external_documents\":[],\"rights_statements\":[],\"linked_agents\":[],\"file_versions\":[],\"notes\":[{\"content\":[\"test\"],\"type\":\"originalsloc\",\"jsonmodel_type\":\"note_digital_object\",\"persistent_id\":\"4e5eec95fcb62440f20a4f5b89c6d16b\",\"publish\":true}],\"linked_instances\":[{\"ref\":\"/repositories/2/resources/2\"}],\"uri\":\"/repositories/2/digital_objects/3\",\"repository\":{\"ref\":\"/repositories/2\"},\"tree\":{\"ref\":\"/repositories/2/digital_objects/3/tree\"}}}},{\"lock_version\":0,\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-12-02T01:05:22Z\",\"system_mtime\":\"2015-12-02T01:05:22Z\",\"user_mtime\":\"2015-12-02T01:05:22Z\",\"instance_type\":\"digital_object\",\"jsonmodel_type\":\"instance\",\"digital_object\":{\"ref\":\"/repositories/2/digital_objects/4\",\"_resolved\":{\"lock_version\":3,\"digital_object_id\":\"5517ddb1-36dd-4a02-a363-f1571982670f\",\"title\":\"test\",\"restrictions\":false,\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-12-02T00:55:53Z\",\"system_mtime\":\"2015-12-02T01:05:22Z\",\"user_mtime\":\"2015-12-02T00:55:53Z\",\"suppressed\":false,\"digital_object_type\":\"text\",\"jsonmodel_type\":\"digital_object\",\"external_ids\":[],\"subjects\":[],\"linked_events\":[],\"extents\":[],\"dates\":[],\"external_documents\":[],\"rights_statements\":[],\"linked_agents\":[],\"file_versions\":[],\"notes\":[{\"content\":[\"test\"],\"type\":\"originalsloc\",\"jsonmodel_type\":\"note_digital_object\",\"persistent_id\":\"bdfe911944a3d26a9fd43455aa968c52\",\"publish\":true}],\"linked_instances\":[{\"ref\":\"/repositories/2/resources/2\"}],\"uri\":\"/repositories/2/digital_objects/4\",\"repository\":{\"ref\":\"/repositories/2\"},\"tree\":{\"ref\":\"/repositories/2/digital_objects/4/tree\"}}}},{\"lock_version\":0,\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-12-02T01:05:22Z\",\"system_mtime\":\"2015-12-02T01:05:22Z\",\"user_mtime\":\"2015-12-02T01:05:22Z\",\"instance_type\":\"digital_object\",\"jsonmodel_type\":\"instance\",\"digital_object\":{\"ref\":\"/repositories/2/digital_objects/5\",\"_resolved\":{\"lock_version\":2,\"digital_object_id\":\"8ea81c4d-6df3-4775-a314-4bef4f44dd3c\",\"title\":\"Some - other fonds\",\"restrictions\":false,\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-12-02T01:04:57Z\",\"system_mtime\":\"2015-12-02T01:05:22Z\",\"user_mtime\":\"2015-12-02T01:04:57Z\",\"suppressed\":false,\"digital_object_type\":\"text\",\"jsonmodel_type\":\"digital_object\",\"external_ids\":[],\"subjects\":[],\"linked_events\":[],\"extents\":[],\"dates\":[],\"external_documents\":[],\"rights_statements\":[],\"linked_agents\":[],\"file_versions\":[],\"notes\":[{\"content\":[\"test\"],\"type\":\"originalsloc\",\"jsonmodel_type\":\"note_digital_object\",\"persistent_id\":\"68242ba5c0cbff4b674c6a2fa2335ad0\",\"publish\":true}],\"linked_instances\":[{\"ref\":\"/repositories/2/resources/2\"}],\"uri\":\"/repositories/2/digital_objects/5\",\"repository\":{\"ref\":\"/repositories/2\"},\"tree\":{\"ref\":\"/repositories/2/digital_objects/5/tree\"}}}},{\"lock_version\":0,\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-12-02T01:05:22Z\",\"system_mtime\":\"2015-12-02T01:05:22Z\",\"user_mtime\":\"2015-12-02T01:05:22Z\",\"instance_type\":\"digital_object\",\"jsonmodel_type\":\"instance\",\"digital_object\":{\"ref\":\"/repositories/2/digital_objects/6\",\"_resolved\":{\"lock_version\":1,\"digital_object_id\":\"a1672927-9a56-41c4-b423-5d76e4a1c660\",\"title\":\"Some - other fonds\",\"restrictions\":false,\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-12-02T01:05:21Z\",\"system_mtime\":\"2015-12-02T01:05:22Z\",\"user_mtime\":\"2015-12-02T01:05:21Z\",\"suppressed\":false,\"digital_object_type\":\"text\",\"jsonmodel_type\":\"digital_object\",\"external_ids\":[],\"subjects\":[],\"linked_events\":[],\"extents\":[],\"dates\":[],\"external_documents\":[],\"rights_statements\":[],\"linked_agents\":[],\"file_versions\":[],\"notes\":[{\"content\":[\"test\"],\"type\":\"originalsloc\",\"jsonmodel_type\":\"note_digital_object\",\"persistent_id\":\"3453d8096aabc607723b4359ab8fdd3c\",\"publish\":true}],\"linked_instances\":[{\"ref\":\"/repositories/2/resources/2\"}],\"uri\":\"/repositories/2/digital_objects/6\",\"repository\":{\"ref\":\"/repositories/2\"},\"tree\":{\"ref\":\"/repositories/2/digital_objects/6/tree\"}}}}],\"deaccessions\":[],\"related_accessions\":[],\"notes\":[],\"uri\":\"/repositories/2/resources/2\",\"repository\":{\"ref\":\"/repositories/2\"},\"tree\":{\"ref\":\"/repositories/2/resources/2/tree\"}}","suppressed":false,"publish":false,"system_generated":false,"repository":"/repositories/2","created_by":"admin","last_modified_by":"admin","user_mtime":"2015-12-02T01:05:21Z","system_mtime":"2015-12-02T01:05:21Z","create_time":"2015-06-30T23:17:57Z","level":"fonds","identifier":"F2","restrictions":"false","four_part_id":"F2","uri":"/repositories/2/resources/2","jsonmodel_type":"resource"},{"id":"/repositories/2/resources/4","title":"Resource - with a multipart contentless note","primary_type":"resource","types":["resource"],"json":"{\"lock_version\":1,\"title\":\"Resource - with a multipart contentless note\",\"publish\":false,\"restrictions\":false,\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2016-01-07T20:51:13Z\",\"system_mtime\":\"2016-01-07T20:53:13Z\",\"user_mtime\":\"2016-01-07T20:53:13Z\",\"suppressed\":false,\"id_0\":\"A\",\"id_1\":\"6\",\"language\":\"ain\",\"level\":\"collection\",\"jsonmodel_type\":\"resource\",\"external_ids\":[],\"subjects\":[],\"linked_events\":[],\"extents\":[{\"lock_version\":0,\"number\":\"5\",\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2016-01-07T20:53:14Z\",\"system_mtime\":\"2016-01-07T20:53:14Z\",\"user_mtime\":\"2016-01-07T20:53:14Z\",\"portion\":\"whole\",\"extent_type\":\"cassettes\",\"jsonmodel_type\":\"extent\"}],\"dates\":[{\"lock_version\":0,\"begin\":\"2016-01-06\",\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2016-01-07T20:53:14Z\",\"system_mtime\":\"2016-01-07T20:53:14Z\",\"user_mtime\":\"2016-01-07T20:53:14Z\",\"date_type\":\"single\",\"label\":\"creation\",\"jsonmodel_type\":\"date\"}],\"external_documents\":[],\"rights_statements\":[],\"linked_agents\":[],\"instances\":[],\"deaccessions\":[],\"related_accessions\":[],\"notes\":[{\"jsonmodel_type\":\"note_multipart\",\"persistent_id\":\"042fd712c1eae93e51fde8b4da1c455d\",\"type\":\"bioghist\",\"subnotes\":[{\"jsonmodel_type\":\"note_orderedlist\",\"title\":\"First\",\"items\":[\"Second\"],\"publish\":false}],\"publish\":false}],\"uri\":\"/repositories/2/resources/4\",\"repository\":{\"ref\":\"/repositories/2\"},\"tree\":{\"ref\":\"/repositories/2/resources/4/tree\"}}","suppressed":false,"publish":false,"system_generated":false,"repository":"/repositories/2","created_by":"admin","last_modified_by":"admin","user_mtime":"2016-01-07T20:53:13Z","system_mtime":"2016-01-07T20:53:13Z","create_time":"2016-01-07T20:51:13Z","level":"collection","identifier":"A-6","language":"ain","restrictions":"false","four_part_id":"A - 6","uri":"/repositories/2/resources/4","jsonmodel_type":"resource"}],"facets":{"facet_queries":{},"facet_fields":{},"facet_dates":{},"facet_ranges":{}}} - -'} - headers: - Cache-Control: ['private, must-revalidate, max-age=0'] - Content-Length: ['11630'] - Content-Type: [application/json] - Date: ['Thu, 07 Jan 2016 20:55:29 GMT'] - Server: [Jetty(8.1.5.v20120716)] - X-Content-Type-Options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.9.1] - X-ArchivesSpace-Session: [3436096c34006577491aae6c6dc485ce5a987afd90f79366c18ec63389ddb456] - method: GET - uri: http://localhost:8089/repositories/2/resources/1/tree?page=1 - response: - body: {string: '{"title":"Test fonds","id":1,"node_type":"resource","publish":false,"suppressed":false,"children":[{"title":"Test - series, 1950 - 1972","id":1,"record_uri":"/repositories/2/archival_objects/1","publish":false,"suppressed":false,"node_type":"archival_object","level":"series","has_children":true,"children":[{"title":"Test - edited subseries, November, 2014 to November, 2015","id":3,"record_uri":"/repositories/2/archival_objects/3","publish":false,"suppressed":false,"node_type":"archival_object","level":"subseries","has_children":true,"children":[{"title":"Test - file","id":4,"record_uri":"/repositories/2/archival_objects/4","publish":false,"suppressed":false,"node_type":"archival_object","level":"file","has_children":false,"children":[],"instance_types":[],"containers":[]}],"instance_types":[],"containers":[]},{"title":"New - new new child","id":10,"record_uri":"/repositories/2/archival_objects/10","publish":false,"suppressed":false,"node_type":"archival_object","level":"series","has_children":false,"children":[],"instance_types":[],"containers":[]}],"instance_types":[],"containers":[]},{"title":"Test - series 2","id":2,"record_uri":"/repositories/2/archival_objects/2","publish":false,"suppressed":false,"node_type":"archival_object","level":"series","has_children":false,"children":[],"instance_types":[],"containers":[]},{"title":"Test - new child","id":13,"record_uri":"/repositories/2/archival_objects/13","publish":false,"suppressed":false,"node_type":"archival_object","level":"series","has_children":false,"children":[],"instance_types":[],"containers":[]},{"title":"Test - new child 2","id":14,"record_uri":"/repositories/2/archival_objects/14","publish":false,"suppressed":false,"node_type":"archival_object","level":"item","has_children":false,"children":[],"instance_types":[],"containers":[]},{"title":"Test - new child 3","id":16,"record_uri":"/repositories/2/archival_objects/16","publish":false,"suppressed":false,"node_type":"archival_object","level":"class","has_children":false,"children":[],"instance_types":[],"containers":[]},{"title":"New - child with note","id":17,"record_uri":"/repositories/2/archival_objects/17","publish":false,"suppressed":false,"node_type":"archival_object","level":"class","has_children":false,"children":[],"instance_types":[],"containers":[]},{"title":"New - child final","id":18,"record_uri":"/repositories/2/archival_objects/18","publish":false,"suppressed":false,"node_type":"archival_object","level":null,"has_children":false,"children":[],"instance_types":[],"containers":[]},{"title":"Child - with no note","id":19,"record_uri":"/repositories/2/archival_objects/19","publish":false,"suppressed":false,"node_type":"archival_object","level":"fonds","has_children":false,"children":[],"instance_types":[],"containers":[]},{"title":"Child - with no note","id":20,"record_uri":"/repositories/2/archival_objects/20","publish":false,"suppressed":false,"node_type":"archival_object","level":"fonds","has_children":false,"children":[],"instance_types":[],"containers":[]}],"record_uri":"/repositories/2/resources/1","level":"fonds","jsonmodel_type":"resource_tree","instance_types":[],"containers":[]} - -'} - headers: - Cache-Control: ['private, must-revalidate, max-age=0'] - Content-Length: ['3142'] - Content-Type: [application/json] - Date: ['Thu, 07 Jan 2016 20:55:29 GMT'] - Server: [Jetty(8.1.5.v20120716)] - X-Content-Type-Options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.9.1] - X-ArchivesSpace-Session: [3436096c34006577491aae6c6dc485ce5a987afd90f79366c18ec63389ddb456] - method: GET - uri: http://localhost:8089/repositories/2/resources/2/tree?page=1 - response: - body: {string: '{"title":"Some other fonds","id":2,"node_type":"resource","publish":false,"suppressed":false,"children":[{"title":"New - resource child","id":12,"record_uri":"/repositories/2/archival_objects/12","publish":false,"suppressed":false,"node_type":"archival_object","level":"series","has_children":false,"children":[],"instance_types":[],"containers":[]},{"title":"Child - with singlepart note","id":21,"record_uri":"/repositories/2/archival_objects/21","publish":false,"suppressed":false,"node_type":"archival_object","level":"series","has_children":false,"children":[],"instance_types":[],"containers":[]},{"title":"Child - with contentless note","id":22,"record_uri":"/repositories/2/archival_objects/22","publish":false,"suppressed":false,"node_type":"archival_object","level":"Other","has_children":false,"children":[],"instance_types":[],"containers":[]}],"record_uri":"/repositories/2/resources/2","level":"fonds","jsonmodel_type":"resource_tree","instance_types":[],"containers":[]} - -'} - headers: - Cache-Control: ['private, must-revalidate, max-age=0'] - Content-Length: ['980'] - Content-Type: [application/json] - Date: ['Thu, 07 Jan 2016 20:55:30 GMT'] - Server: [Jetty(8.1.5.v20120716)] - X-Content-Type-Options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.9.1] - X-ArchivesSpace-Session: [3436096c34006577491aae6c6dc485ce5a987afd90f79366c18ec63389ddb456] - method: GET - uri: http://localhost:8089/repositories/2/resources/4/tree?page=1 - response: - body: {string: '{"title":"Resource with a multipart contentless note","id":4,"node_type":"resource","publish":false,"suppressed":false,"children":[],"record_uri":"/repositories/2/resources/4","level":"collection","jsonmodel_type":"resource_tree","instance_types":[],"containers":[]} - -'} - headers: - Cache-Control: ['private, must-revalidate, max-age=0'] - Content-Length: ['267'] - Content-Type: [application/json] - Date: ['Thu, 07 Jan 2016 20:55:30 GMT'] - Server: [Jetty(8.1.5.v20120716)] - X-Content-Type-Options: [nosniff] - status: {code: 200, message: OK} -version: 1 diff --git a/tests/fixtures/test_count_collection_ids.yaml b/tests/fixtures/test_count_collection_ids.yaml deleted file mode 100644 index d0fedc1..0000000 --- a/tests/fixtures/test_count_collection_ids.yaml +++ /dev/null @@ -1,49 +0,0 @@ -interactions: -- request: - body: password=admin - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Content-Length: ['14'] - Content-Type: [application/x-www-form-urlencoded] - User-Agent: [python-requests/2.3.0 CPython/2.7.10 Darwin/14.4.0] - method: POST - uri: http://localhost:8089/users/admin/login - response: - body: {string: !!python/unicode '{"session":"28e0056b648ecddd66b7635758b6229fe2ccdf5143aaf56dacc621b0fd69fc56","user":{"lock_version":25,"username":"admin","name":"Administrator","is_system_user":true,"create_time":"2015-06-11T17:04:21Z","system_mtime":"2015-06-30T23:38:28Z","user_mtime":"2015-06-30T23:38:28Z","jsonmodel_type":"user","groups":[],"is_admin":true,"uri":"/users/1","agent_record":{"ref":"/agents/people/1"},"permissions":{"/repositories/1":["update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record","administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed"],"_archivesspace":["administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed","update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record"]}}} - -'} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['2205'] - content-type: [application/json] - date: ['Tue, 30 Jun 2015 23:38:28 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - User-Agent: [python-requests/2.3.0 CPython/2.7.10 Darwin/14.4.0] - X-ArchivesSpace-Session: [!!python/unicode 28e0056b648ecddd66b7635758b6229fe2ccdf5143aaf56dacc621b0fd69fc56] - method: GET - uri: http://localhost:8089/repositories/2/search?q=primary_type%3Aresource&page=1 - response: - body: {string: !!python/unicode '{"first_page":1,"last_page":1,"this_page":1,"offset_first":1,"offset_last":2,"total_hits":2,"results":[{"id":"/repositories/2/resources/1","title":"Test - fonds","primary_type":"resource","types":["resource"],"json":"{\"lock_version\":0,\"title\":\"Test - fonds\",\"publish\":false,\"restrictions\":false,\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-06-11T17:08:42Z\",\"system_mtime\":\"2015-06-11T17:08:42Z\",\"user_mtime\":\"2015-06-11T17:08:42Z\",\"suppressed\":false,\"id_0\":\"F1\",\"language\":\"eng\",\"level\":\"fonds\",\"jsonmodel_type\":\"resource\",\"external_ids\":[],\"subjects\":[],\"linked_events\":[],\"extents\":[{\"lock_version\":0,\"number\":\"1\",\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-06-11T17:08:42Z\",\"system_mtime\":\"2015-06-11T17:08:42Z\",\"user_mtime\":\"2015-06-11T17:08:42Z\",\"portion\":\"whole\",\"extent_type\":\"cassettes\",\"jsonmodel_type\":\"extent\"}],\"dates\":[{\"lock_version\":0,\"begin\":\"2015-01-01\",\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-06-11T17:08:42Z\",\"system_mtime\":\"2015-06-11T17:08:42Z\",\"user_mtime\":\"2015-06-11T17:08:42Z\",\"date_type\":\"single\",\"label\":\"creation\",\"jsonmodel_type\":\"date\"}],\"external_documents\":[],\"rights_statements\":[],\"linked_agents\":[],\"instances\":[],\"deaccessions\":[],\"related_accessions\":[],\"notes\":[],\"uri\":\"/repositories/2/resources/1\",\"repository\":{\"ref\":\"/repositories/2\"},\"tree\":{\"ref\":\"/repositories/2/resources/1/tree\"}}","suppressed":false,"publish":false,"system_generated":false,"repository":"/repositories/2","created_by":"admin","last_modified_by":"admin","user_mtime":"2015-06-11T17:08:42Z","system_mtime":"2015-06-11T17:08:42Z","create_time":"2015-06-11T17:08:42Z","level":"fonds","identifier":"F1","language":"eng","restrictions":"false","four_part_id":"F1","uri":"/repositories/2/resources/1","jsonmodel_type":"resource"},{"id":"/repositories/2/resources/2","title":"Some - other fonds","primary_type":"resource","types":["resource"],"json":"{\"lock_version\":0,\"title\":\"Some - other fonds\",\"publish\":false,\"restrictions\":false,\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-06-30T23:17:57Z\",\"system_mtime\":\"2015-06-30T23:17:57Z\",\"user_mtime\":\"2015-06-30T23:17:57Z\",\"suppressed\":false,\"id_0\":\"F2\",\"level\":\"fonds\",\"jsonmodel_type\":\"resource\",\"external_ids\":[],\"subjects\":[],\"linked_events\":[],\"extents\":[{\"lock_version\":0,\"number\":\"1\",\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-06-30T23:17:57Z\",\"system_mtime\":\"2015-06-30T23:17:57Z\",\"user_mtime\":\"2015-06-30T23:17:57Z\",\"portion\":\"whole\",\"extent_type\":\"cassettes\",\"jsonmodel_type\":\"extent\"}],\"dates\":[{\"lock_version\":0,\"begin\":\"2015-06-29\",\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-06-30T23:17:57Z\",\"system_mtime\":\"2015-06-30T23:17:57Z\",\"user_mtime\":\"2015-06-30T23:17:57Z\",\"date_type\":\"bulk\",\"label\":\"creation\",\"jsonmodel_type\":\"date\"}],\"external_documents\":[],\"rights_statements\":[],\"linked_agents\":[],\"instances\":[],\"deaccessions\":[],\"related_accessions\":[],\"notes\":[],\"uri\":\"/repositories/2/resources/2\",\"repository\":{\"ref\":\"/repositories/2\"},\"tree\":{\"ref\":\"/repositories/2/resources/2/tree\"}}","suppressed":false,"publish":false,"system_generated":false,"repository":"/repositories/2","created_by":"admin","last_modified_by":"admin","user_mtime":"2015-06-30T23:17:57Z","system_mtime":"2015-06-30T23:17:57Z","create_time":"2015-06-30T23:17:57Z","level":"fonds","identifier":"F2","restrictions":"false","four_part_id":"F2","uri":"/repositories/2/resources/2","jsonmodel_type":"resource"}],"facets":{"facet_queries":{},"facet_fields":{},"facet_dates":{},"facet_ranges":{}}} - -'} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['3900'] - content-type: [application/json] - date: ['Tue, 30 Jun 2015 23:38:28 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -version: 1 diff --git a/tests/fixtures/test_count_collection_ids_search.yaml b/tests/fixtures/test_count_collection_ids_search.yaml deleted file mode 100644 index 5000568..0000000 --- a/tests/fixtures/test_count_collection_ids_search.yaml +++ /dev/null @@ -1,47 +0,0 @@ -interactions: -- request: - body: password=admin - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Content-Length: ['14'] - Content-Type: [application/x-www-form-urlencoded] - User-Agent: [python-requests/2.3.0 CPython/2.7.10 Darwin/14.4.0] - method: POST - uri: http://localhost:8089/users/admin/login - response: - body: {string: !!python/unicode '{"session":"4873d40652ca79f0ead3f7c35a4441825b585a870850bdb50d55c17557076680","user":{"lock_version":24,"username":"admin","name":"Administrator","is_system_user":true,"create_time":"2015-06-11T17:04:21Z","system_mtime":"2015-06-30T23:38:21Z","user_mtime":"2015-06-30T23:38:21Z","jsonmodel_type":"user","groups":[],"is_admin":true,"uri":"/users/1","agent_record":{"ref":"/agents/people/1"},"permissions":{"/repositories/1":["update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record","administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed"],"_archivesspace":["administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed","update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record"]}}} - -'} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['2205'] - content-type: [application/json] - date: ['Tue, 30 Jun 2015 23:38:20 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - User-Agent: [python-requests/2.3.0 CPython/2.7.10 Darwin/14.4.0] - X-ArchivesSpace-Session: [!!python/unicode 4873d40652ca79f0ead3f7c35a4441825b585a870850bdb50d55c17557076680] - method: GET - uri: http://localhost:8089/repositories/2/search?q=primary_type%3Aresource+AND+title%3ASome&page=1 - response: - body: {string: !!python/unicode '{"first_page":1,"last_page":1,"this_page":1,"offset_first":1,"offset_last":1,"total_hits":1,"results":[{"id":"/repositories/2/resources/2","title":"Some - other fonds","primary_type":"resource","types":["resource"],"json":"{\"lock_version\":0,\"title\":\"Some - other fonds\",\"publish\":false,\"restrictions\":false,\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-06-30T23:17:57Z\",\"system_mtime\":\"2015-06-30T23:17:57Z\",\"user_mtime\":\"2015-06-30T23:17:57Z\",\"suppressed\":false,\"id_0\":\"F2\",\"level\":\"fonds\",\"jsonmodel_type\":\"resource\",\"external_ids\":[],\"subjects\":[],\"linked_events\":[],\"extents\":[{\"lock_version\":0,\"number\":\"1\",\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-06-30T23:17:57Z\",\"system_mtime\":\"2015-06-30T23:17:57Z\",\"user_mtime\":\"2015-06-30T23:17:57Z\",\"portion\":\"whole\",\"extent_type\":\"cassettes\",\"jsonmodel_type\":\"extent\"}],\"dates\":[{\"lock_version\":0,\"begin\":\"2015-06-29\",\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-06-30T23:17:57Z\",\"system_mtime\":\"2015-06-30T23:17:57Z\",\"user_mtime\":\"2015-06-30T23:17:57Z\",\"date_type\":\"bulk\",\"label\":\"creation\",\"jsonmodel_type\":\"date\"}],\"external_documents\":[],\"rights_statements\":[],\"linked_agents\":[],\"instances\":[],\"deaccessions\":[],\"related_accessions\":[],\"notes\":[],\"uri\":\"/repositories/2/resources/2\",\"repository\":{\"ref\":\"/repositories/2\"},\"tree\":{\"ref\":\"/repositories/2/resources/2/tree\"}}","suppressed":false,"publish":false,"system_generated":false,"repository":"/repositories/2","created_by":"admin","last_modified_by":"admin","user_mtime":"2015-06-30T23:17:57Z","system_mtime":"2015-06-30T23:17:57Z","create_time":"2015-06-30T23:17:57Z","level":"fonds","identifier":"F2","restrictions":"false","four_part_id":"F2","uri":"/repositories/2/resources/2","jsonmodel_type":"resource"}],"facets":{"facet_queries":{},"facet_fields":{},"facet_dates":{},"facet_ranges":{}}} - -'} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['2030'] - content-type: [application/json] - date: ['Tue, 30 Jun 2015 23:38:21 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -version: 1 diff --git a/tests/fixtures/test_date_expression.yaml b/tests/fixtures/test_date_expression.yaml deleted file mode 100644 index abdf7ba..0000000 --- a/tests/fixtures/test_date_expression.yaml +++ /dev/null @@ -1,75 +0,0 @@ -interactions: -- request: - body: !!binary | - ZXhwaXJpbmc9RmFsc2UmcGFzc3dvcmQ9YWRtaW4= - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['29'] - Content-Type: [application/x-www-form-urlencoded] - User-Agent: [python-requests/2.8.1] - method: POST - uri: http://localhost:8089/users/admin/login - response: - body: {string: '{"session":"d81a358cd432e897d69df8d17afe43dc0b70f1bc6db988f1dc291becbc510663","user":{"lock_version":780,"username":"admin","name":"Administrator","is_system_user":true,"create_time":"2015-06-11T17:04:21Z","system_mtime":"2015-12-04T22:56:50Z","user_mtime":"2015-12-04T22:56:50Z","jsonmodel_type":"user","groups":[],"is_admin":true,"uri":"/users/1","agent_record":{"ref":"/agents/people/1"},"permissions":{"/repositories/1":["update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record","administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed"],"_archivesspace":["administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed","update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record"]}}} - -'} - headers: - Cache-Control: ['private, must-revalidate, max-age=0'] - Content-Length: ['2206'] - Content-Type: [application/json] - Date: ['Fri, 04 Dec 2015 22:56:50 GMT'] - Server: [Jetty(8.1.5.v20120716)] - X-Content-Type-Options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.8.1] - X-ArchivesSpace-Session: [d81a358cd432e897d69df8d17afe43dc0b70f1bc6db988f1dc291becbc510663] - method: GET - uri: http://localhost:8089/repositories/2/archival_objects/3 - response: - body: {string: '{"lock_version":10,"position":0,"publish":false,"ref_id":"e61c441cd04eb5731ce64de35a4339ff","component_id":"F1-1-1","title":"Test - edited subseries","display_string":"Test edited subseries, November, 2014 - to November, 2015","restrictions_apply":false,"created_by":"admin","last_modified_by":"admin","create_time":"2015-06-11T17:20:19Z","system_mtime":"2015-12-04T00:59:36Z","user_mtime":"2015-12-03T01:24:00Z","suppressed":false,"level":"subseries","jsonmodel_type":"archival_object","external_ids":[],"subjects":[],"linked_events":[],"extents":[],"dates":[{"lock_version":0,"expression":"November, - 2014 to November, 2015","begin":"2014-11-01","end":"2015-11-01","created_by":"admin","last_modified_by":"admin","create_time":"2015-12-03T01:24:00Z","system_mtime":"2015-12-03T01:24:00Z","user_mtime":"2015-12-03T01:24:00Z","date_type":"inclusive","label":"creation","jsonmodel_type":"date"}],"external_documents":[],"rights_statements":[],"linked_agents":[],"instances":[{"lock_version":0,"created_by":"admin","last_modified_by":"admin","create_time":"2015-12-03T01:24:00Z","system_mtime":"2015-12-03T01:24:00Z","user_mtime":"2015-12-03T01:24:00Z","instance_type":"digital_object","jsonmodel_type":"instance","digital_object":{"ref":"/repositories/2/digital_objects/7"}},{"lock_version":0,"created_by":"admin","last_modified_by":"admin","create_time":"2015-12-03T01:24:00Z","system_mtime":"2015-12-03T01:24:00Z","user_mtime":"2015-12-03T01:24:00Z","instance_type":"digital_object","jsonmodel_type":"instance","digital_object":{"ref":"/repositories/2/digital_objects/8"}}],"notes":[{"jsonmodel_type":"note_multipart","persistent_id":"063373886a2f23d03fe1a51f7c96ca8b","subnotes":[{"content":"This - is a test note","publish":true,"jsonmodel_type":"note_text"}],"type":"odd","publish":true}],"uri":"/repositories/2/archival_objects/3","repository":{"ref":"/repositories/2"},"resource":{"ref":"/repositories/2/resources/1"},"parent":{"ref":"/repositories/2/archival_objects/1"},"has_unpublished_ancestor":true} - -'} - headers: - Cache-Control: ['private, must-revalidate, max-age=0'] - Content-Length: ['2004'] - Content-Type: [application/json] - Date: ['Fri, 04 Dec 2015 22:56:50 GMT'] - Server: [Jetty(8.1.5.v20120716)] - X-Content-Type-Options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.8.1] - X-ArchivesSpace-Session: [d81a358cd432e897d69df8d17afe43dc0b70f1bc6db988f1dc291becbc510663] - method: GET - uri: http://localhost:8089/repositories/2/archival_objects/3/children - response: - body: {string: '[{"lock_version":1,"position":0,"publish":false,"ref_id":"8429037b0f599a1efcca06b9b813700a","component_id":"F1-1-1-1","title":"Test - file","display_string":"Test file","restrictions_apply":false,"created_by":"admin","last_modified_by":"admin","create_time":"2015-06-11T17:20:30Z","system_mtime":"2015-12-04T00:59:36Z","user_mtime":"2015-06-11T17:45:40Z","suppressed":false,"level":"file","jsonmodel_type":"archival_object","external_ids":[],"subjects":[],"linked_events":[],"extents":[],"dates":[],"external_documents":[],"rights_statements":[],"linked_agents":[],"instances":[],"notes":[],"uri":"/repositories/2/archival_objects/4","repository":{"ref":"/repositories/2"},"resource":{"ref":"/repositories/2/resources/1"},"parent":{"ref":"/repositories/2/archival_objects/3"},"has_unpublished_ancestor":true}] - -'} - headers: - Cache-Control: ['private, must-revalidate, max-age=0'] - Content-Length: ['808'] - Content-Type: [application/json] - Date: ['Fri, 04 Dec 2015 22:56:50 GMT'] - Server: [Jetty(8.1.5.v20120716)] - X-Content-Type-Options: [nosniff] - status: {code: 200, message: OK} -version: 1 diff --git a/tests/fixtures/test_delete_record_archival_object.yaml b/tests/fixtures/test_delete_record_archival_object.yaml deleted file mode 100644 index 97131f2..0000000 --- a/tests/fixtures/test_delete_record_archival_object.yaml +++ /dev/null @@ -1,93 +0,0 @@ -interactions: -- request: - body: password=admin - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['14'] - Content-Type: [application/x-www-form-urlencoded] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-43-generic] - method: POST - uri: http://localhost:8089/users/admin/login - response: - body: {string: !!python/unicode '{"session":"b6aa6f982c4fbdd9b470bf4d2f35e1be2bc1c482706eff62ce6e675ece381e1d","user":{"lock_version":45,"username":"admin","name":"Administrator","is_system_user":true,"create_time":"2015-06-25T17:43:26Z","system_mtime":"2015-10-09T00:06:22Z","user_mtime":"2015-10-09T00:06:22Z","jsonmodel_type":"user","groups":[],"is_admin":true,"uri":"/users/1","agent_record":{"ref":"/agents/people/1"},"permissions":{"/repositories/1":["update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record","administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed"],"_archivesspace":["administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed","update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record"]}}} - - '} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['2205'] - content-type: [application/json] - date: ['Fri, 09 Oct 2015 00:06:22 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-43-generic] - X-ArchivesSpace-Session: [!!python/unicode 'b6aa6f982c4fbdd9b470bf4d2f35e1be2bc1c482706eff62ce6e675ece381e1d'] - method: GET - uri: http://localhost:8089/repositories/2/archival_objects/4 - response: - body: {string: !!python/unicode '{"lock_version":0,"position":0,"ref_id":"245e87ee574547df6c55891ce41187d3","title":"Test - child","display_string":"Test child","restrictions_apply":false,"created_by":"admin","last_modified_by":"admin","create_time":"2015-10-08T21:48:28Z","system_mtime":"2015-10-08T21:48:28Z","user_mtime":"2015-10-08T21:48:28Z","suppressed":false,"level":"item","jsonmodel_type":"archival_object","external_ids":[],"subjects":[],"linked_events":[],"extents":[],"dates":[],"external_documents":[],"rights_statements":[],"linked_agents":[],"instances":[],"notes":[],"uri":"/repositories/2/archival_objects/4","repository":{"ref":"/repositories/2"},"resource":{"ref":"/repositories/2/resources/2"},"parent":{"ref":"/repositories/2/archival_objects/1"},"has_unpublished_ancestor":true} - - '} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['766'] - content-type: [application/json] - date: ['Fri, 09 Oct 2015 00:06:22 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['0'] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-43-generic] - X-ArchivesSpace-Session: [!!python/unicode 'b6aa6f982c4fbdd9b470bf4d2f35e1be2bc1c482706eff62ce6e675ece381e1d'] - method: DELETE - uri: http://localhost:8089/repositories/2/archival_objects/4 - response: - body: {string: !!python/unicode '{"status":"Deleted","id":4} - - '} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['28'] - content-type: [application/json] - date: ['Fri, 09 Oct 2015 00:06:22 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-43-generic] - X-ArchivesSpace-Session: [!!python/unicode 'b6aa6f982c4fbdd9b470bf4d2f35e1be2bc1c482706eff62ce6e675ece381e1d'] - method: GET - uri: http://localhost:8089/repositories/2/archival_objects/4 - response: - body: {string: !!python/unicode '{"error":"ArchivalObject not found"} - - '} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['37'] - content-type: [application/json] - date: ['Fri, 09 Oct 2015 00:06:22 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 404, message: Not Found} -version: 1 diff --git a/tests/fixtures/test_delete_record_resource.yaml b/tests/fixtures/test_delete_record_resource.yaml deleted file mode 100644 index bb8b995..0000000 --- a/tests/fixtures/test_delete_record_resource.yaml +++ /dev/null @@ -1,92 +0,0 @@ -interactions: -- request: - body: password=admin - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['14'] - Content-Type: [application/x-www-form-urlencoded] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-43-generic] - method: POST - uri: http://localhost:8089/users/admin/login - response: - body: {string: !!python/unicode '{"session":"2a263c91da801af6dc7548014d02af8b81b2f0916cc7000e05bd5b87a8e96ac7","user":{"lock_version":47,"username":"admin","name":"Administrator","is_system_user":true,"create_time":"2015-06-25T17:43:26Z","system_mtime":"2015-10-09T00:08:09Z","user_mtime":"2015-10-09T00:08:09Z","jsonmodel_type":"user","groups":[],"is_admin":true,"uri":"/users/1","agent_record":{"ref":"/agents/people/1"},"permissions":{"/repositories/1":["update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record","administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed"],"_archivesspace":["administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed","update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record"]}}} - - '} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['2205'] - content-type: [application/json] - date: ['Fri, 09 Oct 2015 00:08:08 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-43-generic] - X-ArchivesSpace-Session: [!!python/unicode '2a263c91da801af6dc7548014d02af8b81b2f0916cc7000e05bd5b87a8e96ac7'] - method: GET - uri: http://localhost:8089/repositories/2/resources/3 - response: - body: {string: !!python/unicode '{"lock_version":0,"title":"Some other fonds","publish":false,"restrictions":false,"created_by":"admin","last_modified_by":"admin","create_time":"2015-10-08T21:39:44Z","system_mtime":"2015-10-08T21:39:44Z","user_mtime":"2015-10-08T21:39:44Z","suppressed":false,"id_0":"F2","language":"eng","level":"collection","jsonmodel_type":"resource","external_ids":[],"subjects":[],"linked_events":[],"extents":[{"lock_version":0,"number":"1","created_by":"admin","last_modified_by":"admin","create_time":"2015-10-08T21:39:44Z","system_mtime":"2015-10-08T21:39:44Z","user_mtime":"2015-10-08T21:39:44Z","portion":"whole","extent_type":"files","jsonmodel_type":"extent"}],"dates":[{"lock_version":0,"begin":"2015-01-01","created_by":"admin","last_modified_by":"admin","create_time":"2015-10-08T21:39:44Z","system_mtime":"2015-10-08T21:39:44Z","user_mtime":"2015-10-08T21:39:44Z","date_type":"single","label":"creation","jsonmodel_type":"date"}],"external_documents":[],"rights_statements":[],"linked_agents":[],"instances":[],"deaccessions":[],"related_accessions":[],"notes":[],"uri":"/repositories/2/resources/3","repository":{"ref":"/repositories/2"},"tree":{"ref":"/repositories/2/resources/3/tree"}} - - '} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['1191'] - content-type: [application/json] - date: ['Fri, 09 Oct 2015 00:08:09 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['0'] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-43-generic] - X-ArchivesSpace-Session: [!!python/unicode '2a263c91da801af6dc7548014d02af8b81b2f0916cc7000e05bd5b87a8e96ac7'] - method: DELETE - uri: http://localhost:8089/repositories/2/resources/3 - response: - body: {string: !!python/unicode '{"status":"Deleted","id":3} - - '} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['28'] - content-type: [application/json] - date: ['Fri, 09 Oct 2015 00:08:09 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-43-generic] - X-ArchivesSpace-Session: [!!python/unicode '2a263c91da801af6dc7548014d02af8b81b2f0916cc7000e05bd5b87a8e96ac7'] - method: GET - uri: http://localhost:8089/repositories/2/resources/3 - response: - body: {string: !!python/unicode '{"error":"Resource not found"} - - '} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['31'] - content-type: [application/json] - date: ['Fri, 09 Oct 2015 00:08:09 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 404, message: Not Found} -version: 1 diff --git a/tests/fixtures/test_edit_archival_object.yaml b/tests/fixtures/test_edit_archival_object.yaml deleted file mode 100644 index c735f74..0000000 --- a/tests/fixtures/test_edit_archival_object.yaml +++ /dev/null @@ -1,134 +0,0 @@ -interactions: -- request: - body: password=admin - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['14'] - Content-Type: [application/x-www-form-urlencoded] - User-Agent: [python-requests/2.7.0 CPython/2.7.10 Darwin/15.0.0] - method: POST - uri: http://localhost:8089/users/admin/login - response: - body: {string: !!python/unicode '{"session":"fd47f17b9643680d69818993e40ed986f771b70a41360b1df3b7dc26d5fd7983","user":{"lock_version":361,"username":"admin","name":"Administrator","is_system_user":true,"create_time":"2015-06-11T17:04:21Z","system_mtime":"2015-11-02T22:53:06Z","user_mtime":"2015-11-02T22:53:06Z","jsonmodel_type":"user","groups":[],"is_admin":true,"uri":"/users/1","agent_record":{"ref":"/agents/people/1"},"permissions":{"/repositories/1":["update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record","administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed"],"_archivesspace":["administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed","update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record"]}}} - -'} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['2206'] - content-type: [application/json] - date: ['Mon, 02 Nov 2015 22:53:06 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.7.0 CPython/2.7.10 Darwin/15.0.0] - X-ArchivesSpace-Session: [!!python/unicode fd47f17b9643680d69818993e40ed986f771b70a41360b1df3b7dc26d5fd7983] - method: GET - uri: http://localhost:8089/repositories/2/archival_objects/3 - response: - body: {string: !!python/unicode '{"lock_version":7,"position":0,"publish":false,"ref_id":"e61c441cd04eb5731ce64de35a4339ff","component_id":"F1-1-1","title":"Test - subseries","display_string":"Test subseries, 2014-01-01 - 2015-01-01","restrictions_apply":false,"created_by":"admin","last_modified_by":"admin","create_time":"2015-06-11T17:20:19Z","system_mtime":"2015-10-29T23:50:50Z","user_mtime":"2015-10-29T23:50:50Z","suppressed":false,"level":"subseries","jsonmodel_type":"archival_object","external_ids":[],"subjects":[],"linked_events":[],"extents":[],"dates":[{"lock_version":0,"begin":"2014-01-01","end":"2015-01-01","created_by":"admin","last_modified_by":"admin","create_time":"2015-10-29T23:50:50Z","system_mtime":"2015-10-29T23:50:50Z","user_mtime":"2015-10-29T23:50:50Z","date_type":"inclusive","label":"creation","jsonmodel_type":"date"}],"external_documents":[],"rights_statements":[],"linked_agents":[],"instances":[],"notes":[],"uri":"/repositories/2/archival_objects/3","repository":{"ref":"/repositories/2"},"resource":{"ref":"/repositories/2/resources/1"},"parent":{"ref":"/repositories/2/archival_objects/1"},"has_unpublished_ancestor":true} - -'} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['1128'] - content-type: [application/json] - date: ['Mon, 02 Nov 2015 22:53:06 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.7.0 CPython/2.7.10 Darwin/15.0.0] - X-ArchivesSpace-Session: [!!python/unicode fd47f17b9643680d69818993e40ed986f771b70a41360b1df3b7dc26d5fd7983] - method: GET - uri: http://localhost:8089/repositories/2/archival_objects/3 - response: - body: {string: !!python/unicode '{"lock_version":7,"position":0,"publish":false,"ref_id":"e61c441cd04eb5731ce64de35a4339ff","component_id":"F1-1-1","title":"Test - subseries","display_string":"Test subseries, 2014-01-01 - 2015-01-01","restrictions_apply":false,"created_by":"admin","last_modified_by":"admin","create_time":"2015-06-11T17:20:19Z","system_mtime":"2015-10-29T23:50:50Z","user_mtime":"2015-10-29T23:50:50Z","suppressed":false,"level":"subseries","jsonmodel_type":"archival_object","external_ids":[],"subjects":[],"linked_events":[],"extents":[],"dates":[{"lock_version":0,"begin":"2014-01-01","end":"2015-01-01","created_by":"admin","last_modified_by":"admin","create_time":"2015-10-29T23:50:50Z","system_mtime":"2015-10-29T23:50:50Z","user_mtime":"2015-10-29T23:50:50Z","date_type":"inclusive","label":"creation","jsonmodel_type":"date"}],"external_documents":[],"rights_statements":[],"linked_agents":[],"instances":[],"notes":[],"uri":"/repositories/2/archival_objects/3","repository":{"ref":"/repositories/2"},"resource":{"ref":"/repositories/2/resources/1"},"parent":{"ref":"/repositories/2/archival_objects/1"},"has_unpublished_ancestor":true} - -'} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['1128'] - content-type: [application/json] - date: ['Mon, 02 Nov 2015 22:53:06 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -- request: - body: '{"lock_version": 7, "system_mtime": "2015-10-29T23:50:50Z", "extents": - [], "jsonmodel_type": "archival_object", "ref_id": "e61c441cd04eb5731ce64de35a4339ff", - "instances": [], "create_time": "2015-06-11T17:20:19Z", "created_by": "admin", - "parent": {"ref": "/repositories/2/archival_objects/1"}, "title": "Test edited - subseries", "display_string": "Test subseries, 2014-01-01 - 2015-01-01", "publish": - false, "subjects": [], "external_documents": [], "linked_agents": [], "repository": - {"ref": "/repositories/2"}, "has_unpublished_ancestor": true, "user_mtime": - "2015-10-29T23:50:50Z", "rights_statements": [], "linked_events": [], "external_ids": - [], "suppressed": false, "dates": [{"expression": "November, 2014 to November, - 2015", "begin": "2014-11-01", "end": "2015-11-01", "date_type": "inclusive", - "label": "creation"}], "component_id": "F1-1-1", "resource": {"ref": "/repositories/2/resources/1"}, - "level": "subseries", "notes": [{"type": "odd", "publish": true, "jsonmodel_type": - "note_multipart", "subnotes": [{"content": "This is a test note", "publish": - true, "jsonmodel_type": "note_text"}]}], "uri": "/repositories/2/archival_objects/3", - "last_modified_by": "admin", "restrictions_apply": false, "position": 0}' - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['1221'] - User-Agent: [python-requests/2.7.0 CPython/2.7.10 Darwin/15.0.0] - X-ArchivesSpace-Session: [!!python/unicode fd47f17b9643680d69818993e40ed986f771b70a41360b1df3b7dc26d5fd7983] - method: POST - uri: http://localhost:8089/repositories/2/archival_objects/3 - response: - body: {string: !!python/unicode '{"status":"Updated","id":3,"lock_version":8,"stale":true,"uri":"/repositories/2/archival_objects/3","warnings":[]} - -'} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['115'] - content-type: [application/json] - date: ['Mon, 02 Nov 2015 22:53:06 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.7.0 CPython/2.7.10 Darwin/15.0.0] - X-ArchivesSpace-Session: [!!python/unicode fd47f17b9643680d69818993e40ed986f771b70a41360b1df3b7dc26d5fd7983] - method: GET - uri: http://localhost:8089/repositories/2/archival_objects/3 - response: - body: {string: !!python/unicode '{"lock_version":8,"position":0,"publish":false,"ref_id":"e61c441cd04eb5731ce64de35a4339ff","component_id":"F1-1-1","title":"Test - edited subseries","display_string":"Test edited subseries, November, 2014 - to November, 2015","restrictions_apply":false,"created_by":"admin","last_modified_by":"admin","create_time":"2015-06-11T17:20:19Z","system_mtime":"2015-11-02T22:53:07Z","user_mtime":"2015-11-02T22:53:07Z","suppressed":false,"level":"subseries","jsonmodel_type":"archival_object","external_ids":[],"subjects":[],"linked_events":[],"extents":[],"dates":[{"lock_version":0,"expression":"November, - 2014 to November, 2015","begin":"2014-11-01","end":"2015-11-01","created_by":"admin","last_modified_by":"admin","create_time":"2015-11-02T22:53:07Z","system_mtime":"2015-11-02T22:53:07Z","user_mtime":"2015-11-02T22:53:07Z","date_type":"inclusive","label":"creation","jsonmodel_type":"date"}],"external_documents":[],"rights_statements":[],"linked_agents":[],"instances":[],"notes":[{"type":"odd","jsonmodel_type":"note_multipart","subnotes":[{"content":"This - is a test note","publish":true,"jsonmodel_type":"note_text"}],"persistent_id":"063373886a2f23d03fe1a51f7c96ca8b","publish":true}],"uri":"/repositories/2/archival_objects/3","repository":{"ref":"/repositories/2"},"resource":{"ref":"/repositories/2/resources/1"},"parent":{"ref":"/repositories/2/archival_objects/1"},"has_unpublished_ancestor":true} - -'} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['1404'] - content-type: [application/json] - date: ['Mon, 02 Nov 2015 22:53:07 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -version: 1 diff --git a/tests/fixtures/test_edit_record_empty_note.yaml b/tests/fixtures/test_edit_record_empty_note.yaml deleted file mode 100644 index 3b0f692..0000000 --- a/tests/fixtures/test_edit_record_empty_note.yaml +++ /dev/null @@ -1,157 +0,0 @@ -interactions: -- request: - body: !!binary | - cGFzc3dvcmQ9YWRtaW4mZXhwaXJpbmc9RmFsc2U= - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['29'] - Content-Type: [application/x-www-form-urlencoded] - User-Agent: [python-requests/2.9.1] - method: POST - uri: http://localhost:8089/users/admin/login - response: - body: {string: '{"session":"d84ec1437008dcfd2fce24b3d63a3d396a2e04d9c958b275b265605362f27c9c","user":{"lock_version":919,"username":"admin","name":"Administrator","is_system_user":true,"create_time":"2015-06-11T17:04:21Z","system_mtime":"2016-02-02T01:23:32Z","user_mtime":"2016-02-02T01:23:32Z","jsonmodel_type":"user","groups":[],"is_admin":true,"uri":"/users/1","agent_record":{"ref":"/agents/people/1"},"permissions":{"/repositories/1":["update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record","administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed"],"_archivesspace":["administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed","update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record"]}}} - -'} - headers: - Cache-Control: ['private, must-revalidate, max-age=0'] - Content-Length: ['2206'] - Content-Type: [application/json] - Date: ['Tue, 02 Feb 2016 01:23:32 GMT'] - Server: [Jetty(8.1.5.v20120716)] - X-Content-Type-Options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.9.1] - X-ArchivesSpace-Session: [d84ec1437008dcfd2fce24b3d63a3d396a2e04d9c958b275b265605362f27c9c] - method: GET - uri: http://localhost:8089/repositories/2/archival_objects/3 - response: - body: {string: '{"lock_version":10,"position":0,"publish":false,"ref_id":"e61c441cd04eb5731ce64de35a4339ff","component_id":"F1-1-1","title":"Test - edited subseries","display_string":"Test edited subseries, November, 2014 - to November, 2015","restrictions_apply":false,"created_by":"admin","last_modified_by":"admin","create_time":"2015-06-11T17:20:19Z","system_mtime":"2015-12-04T00:59:36Z","user_mtime":"2015-12-03T01:24:00Z","suppressed":false,"level":"subseries","jsonmodel_type":"archival_object","external_ids":[],"subjects":[],"linked_events":[],"extents":[],"dates":[{"lock_version":0,"expression":"November, - 2014 to November, 2015","begin":"2014-11-01","end":"2015-11-01","created_by":"admin","last_modified_by":"admin","create_time":"2015-12-03T01:24:00Z","system_mtime":"2015-12-03T01:24:00Z","user_mtime":"2015-12-03T01:24:00Z","date_type":"inclusive","label":"creation","jsonmodel_type":"date"}],"external_documents":[],"rights_statements":[],"linked_agents":[],"instances":[{"lock_version":0,"created_by":"admin","last_modified_by":"admin","create_time":"2015-12-03T01:24:00Z","system_mtime":"2015-12-03T01:24:00Z","user_mtime":"2015-12-03T01:24:00Z","instance_type":"digital_object","jsonmodel_type":"instance","digital_object":{"ref":"/repositories/2/digital_objects/7"}},{"lock_version":0,"created_by":"admin","last_modified_by":"admin","create_time":"2015-12-03T01:24:00Z","system_mtime":"2015-12-03T01:24:00Z","user_mtime":"2015-12-03T01:24:00Z","instance_type":"digital_object","jsonmodel_type":"instance","digital_object":{"ref":"/repositories/2/digital_objects/8"}}],"notes":[{"jsonmodel_type":"note_multipart","persistent_id":"063373886a2f23d03fe1a51f7c96ca8b","subnotes":[{"content":"This - is a test note","publish":true,"jsonmodel_type":"note_text"}],"type":"odd","publish":true}],"uri":"/repositories/2/archival_objects/3","repository":{"ref":"/repositories/2"},"resource":{"ref":"/repositories/2/resources/1"},"parent":{"ref":"/repositories/2/archival_objects/1"},"has_unpublished_ancestor":true} - -'} - headers: - Cache-Control: ['private, must-revalidate, max-age=0'] - Content-Length: ['2004'] - Content-Type: [application/json] - Date: ['Tue, 02 Feb 2016 01:23:32 GMT'] - Server: [Jetty(8.1.5.v20120716)] - X-Content-Type-Options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.9.1] - X-ArchivesSpace-Session: [d84ec1437008dcfd2fce24b3d63a3d396a2e04d9c958b275b265605362f27c9c] - method: GET - uri: http://localhost:8089/repositories/2/archival_objects/3 - response: - body: {string: '{"lock_version":10,"position":0,"publish":false,"ref_id":"e61c441cd04eb5731ce64de35a4339ff","component_id":"F1-1-1","title":"Test - edited subseries","display_string":"Test edited subseries, November, 2014 - to November, 2015","restrictions_apply":false,"created_by":"admin","last_modified_by":"admin","create_time":"2015-06-11T17:20:19Z","system_mtime":"2015-12-04T00:59:36Z","user_mtime":"2015-12-03T01:24:00Z","suppressed":false,"level":"subseries","jsonmodel_type":"archival_object","external_ids":[],"subjects":[],"linked_events":[],"extents":[],"dates":[{"lock_version":0,"expression":"November, - 2014 to November, 2015","begin":"2014-11-01","end":"2015-11-01","created_by":"admin","last_modified_by":"admin","create_time":"2015-12-03T01:24:00Z","system_mtime":"2015-12-03T01:24:00Z","user_mtime":"2015-12-03T01:24:00Z","date_type":"inclusive","label":"creation","jsonmodel_type":"date"}],"external_documents":[],"rights_statements":[],"linked_agents":[],"instances":[{"lock_version":0,"created_by":"admin","last_modified_by":"admin","create_time":"2015-12-03T01:24:00Z","system_mtime":"2015-12-03T01:24:00Z","user_mtime":"2015-12-03T01:24:00Z","instance_type":"digital_object","jsonmodel_type":"instance","digital_object":{"ref":"/repositories/2/digital_objects/7"}},{"lock_version":0,"created_by":"admin","last_modified_by":"admin","create_time":"2015-12-03T01:24:00Z","system_mtime":"2015-12-03T01:24:00Z","user_mtime":"2015-12-03T01:24:00Z","instance_type":"digital_object","jsonmodel_type":"instance","digital_object":{"ref":"/repositories/2/digital_objects/8"}}],"notes":[{"jsonmodel_type":"note_multipart","persistent_id":"063373886a2f23d03fe1a51f7c96ca8b","subnotes":[{"content":"This - is a test note","publish":true,"jsonmodel_type":"note_text"}],"type":"odd","publish":true}],"uri":"/repositories/2/archival_objects/3","repository":{"ref":"/repositories/2"},"resource":{"ref":"/repositories/2/resources/1"},"parent":{"ref":"/repositories/2/archival_objects/1"},"has_unpublished_ancestor":true} - -'} - headers: - Cache-Control: ['private, must-revalidate, max-age=0'] - Content-Length: ['2004'] - Content-Type: [application/json] - Date: ['Tue, 02 Feb 2016 01:23:32 GMT'] - Server: [Jetty(8.1.5.v20120716)] - X-Content-Type-Options: [nosniff] - status: {code: 200, message: OK} -- request: - body: !!binary | - eyJwb3NpdGlvbiI6IDAsICJkYXRlcyI6IFt7ImRhdGVfdHlwZSI6ICJpbmNsdXNpdmUiLCAiZXhw - cmVzc2lvbiI6ICJOb3ZlbWJlciwgMjAxNCB0byBOb3ZlbWJlciwgMjAxNSIsICJiZWdpbiI6ICIy - MDE0LTExLTAxIiwgImxhYmVsIjogImNyZWF0aW9uIiwgImVuZCI6ICIyMDE1LTExLTAxIn1dLCAi - ZGlzcGxheV9zdHJpbmciOiAiVGVzdCBlZGl0ZWQgc3Vic2VyaWVzLCBOb3ZlbWJlciwgMjAxNCB0 - byBOb3ZlbWJlciwgMjAxNSIsICJyaWdodHNfc3RhdGVtZW50cyI6IFtdLCAic3lzdGVtX210aW1l - IjogIjIwMTUtMTItMDRUMDA6NTk6MzZaIiwgInVyaSI6ICIvcmVwb3NpdG9yaWVzLzIvYXJjaGl2 - YWxfb2JqZWN0cy8zIiwgInJlc291cmNlIjogeyJyZWYiOiAiL3JlcG9zaXRvcmllcy8yL3Jlc291 - cmNlcy8xIn0sICJjcmVhdGVfdGltZSI6ICIyMDE1LTA2LTExVDE3OjIwOjE5WiIsICJwYXJlbnQi - OiB7InJlZiI6ICIvcmVwb3NpdG9yaWVzLzIvYXJjaGl2YWxfb2JqZWN0cy8xIn0sICJub3RlcyI6 - IFtdLCAidXNlcl9tdGltZSI6ICIyMDE1LTEyLTAzVDAxOjI0OjAwWiIsICJqc29ubW9kZWxfdHlw - ZSI6ICJhcmNoaXZhbF9vYmplY3QiLCAibGlua2VkX2V2ZW50cyI6IFtdLCAiZXh0ZW50cyI6IFtd - LCAiZXh0ZXJuYWxfaWRzIjogW10sICJsaW5rZWRfYWdlbnRzIjogW10sICJyZXBvc2l0b3J5Ijog - eyJyZWYiOiAiL3JlcG9zaXRvcmllcy8yIn0sICJpbnN0YW5jZXMiOiBbeyJqc29ubW9kZWxfdHlw - ZSI6ICJpbnN0YW5jZSIsICJsYXN0X21vZGlmaWVkX2J5IjogImFkbWluIiwgImNyZWF0ZV90aW1l - IjogIjIwMTUtMTItMDNUMDE6MjQ6MDBaIiwgImxvY2tfdmVyc2lvbiI6IDAsICJkaWdpdGFsX29i - amVjdCI6IHsicmVmIjogIi9yZXBvc2l0b3JpZXMvMi9kaWdpdGFsX29iamVjdHMvNyJ9LCAiY3Jl - YXRlZF9ieSI6ICJhZG1pbiIsICJ1c2VyX210aW1lIjogIjIwMTUtMTItMDNUMDE6MjQ6MDBaIiwg - Imluc3RhbmNlX3R5cGUiOiAiZGlnaXRhbF9vYmplY3QiLCAic3lzdGVtX210aW1lIjogIjIwMTUt - MTItMDNUMDE6MjQ6MDBaIn0sIHsianNvbm1vZGVsX3R5cGUiOiAiaW5zdGFuY2UiLCAibGFzdF9t - b2RpZmllZF9ieSI6ICJhZG1pbiIsICJjcmVhdGVfdGltZSI6ICIyMDE1LTEyLTAzVDAxOjI0OjAw - WiIsICJsb2NrX3ZlcnNpb24iOiAwLCAiZGlnaXRhbF9vYmplY3QiOiB7InJlZiI6ICIvcmVwb3Np - dG9yaWVzLzIvZGlnaXRhbF9vYmplY3RzLzgifSwgImNyZWF0ZWRfYnkiOiAiYWRtaW4iLCAidXNl - cl9tdGltZSI6ICIyMDE1LTEyLTAzVDAxOjI0OjAwWiIsICJpbnN0YW5jZV90eXBlIjogImRpZ2l0 - YWxfb2JqZWN0IiwgInN5c3RlbV9tdGltZSI6ICIyMDE1LTEyLTAzVDAxOjI0OjAwWiJ9XSwgImxh - c3RfbW9kaWZpZWRfYnkiOiAiYWRtaW4iLCAibGV2ZWwiOiAic3Vic2VyaWVzIiwgImxvY2tfdmVy - c2lvbiI6IDEwLCAiZXh0ZXJuYWxfZG9jdW1lbnRzIjogW10sICJwdWJsaXNoIjogZmFsc2UsICJ0 - aXRsZSI6ICJUZXN0IGVkaXRlZCBzdWJzZXJpZXMgdy8gZW1wdHkgbm90ZSIsICJyZWZfaWQiOiAi - ZTYxYzQ0MWNkMDRlYjU3MzFjZTY0ZGUzNWE0MzM5ZmYiLCAiY29tcG9uZW50X2lkIjogIkYxLTEt - MSIsICJzdWJqZWN0cyI6IFtdLCAiaGFzX3VucHVibGlzaGVkX2FuY2VzdG9yIjogdHJ1ZSwgImNy - ZWF0ZWRfYnkiOiAiYWRtaW4iLCAicmVzdHJpY3Rpb25zX2FwcGx5IjogZmFsc2UsICJzdXBwcmVz - c2VkIjogZmFsc2V9 - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['1722'] - User-Agent: [python-requests/2.9.1] - X-ArchivesSpace-Session: [d84ec1437008dcfd2fce24b3d63a3d396a2e04d9c958b275b265605362f27c9c] - method: POST - uri: http://localhost:8089/repositories/2/archival_objects/3 - response: - body: {string: '{"status":"Updated","id":3,"lock_version":11,"stale":true,"uri":"/repositories/2/archival_objects/3","warnings":[]} - -'} - headers: - Cache-Control: ['private, must-revalidate, max-age=0'] - Content-Length: ['116'] - Content-Type: [application/json] - Date: ['Tue, 02 Feb 2016 01:23:32 GMT'] - Server: [Jetty(8.1.5.v20120716)] - X-Content-Type-Options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.9.1] - X-ArchivesSpace-Session: [d84ec1437008dcfd2fce24b3d63a3d396a2e04d9c958b275b265605362f27c9c] - method: GET - uri: http://localhost:8089/repositories/2/archival_objects/3 - response: - body: {string: '{"lock_version":11,"position":0,"publish":false,"ref_id":"e61c441cd04eb5731ce64de35a4339ff","component_id":"F1-1-1","title":"Test - edited subseries w/ empty note","display_string":"Test edited subseries w/ - empty note, November, 2014 to November, 2015","restrictions_apply":false,"created_by":"admin","last_modified_by":"admin","create_time":"2015-06-11T17:20:19Z","system_mtime":"2016-02-02T01:23:32Z","user_mtime":"2016-02-02T01:23:32Z","suppressed":false,"level":"subseries","jsonmodel_type":"archival_object","external_ids":[],"subjects":[],"linked_events":[],"extents":[],"dates":[{"lock_version":0,"expression":"November, - 2014 to November, 2015","begin":"2014-11-01","end":"2015-11-01","created_by":"admin","last_modified_by":"admin","create_time":"2016-02-02T01:23:33Z","system_mtime":"2016-02-02T01:23:33Z","user_mtime":"2016-02-02T01:23:33Z","date_type":"inclusive","label":"creation","jsonmodel_type":"date"}],"external_documents":[],"rights_statements":[],"linked_agents":[],"instances":[{"lock_version":0,"created_by":"admin","last_modified_by":"admin","create_time":"2016-02-02T01:23:33Z","system_mtime":"2016-02-02T01:23:33Z","user_mtime":"2016-02-02T01:23:33Z","instance_type":"digital_object","jsonmodel_type":"instance","digital_object":{"ref":"/repositories/2/digital_objects/7"}},{"lock_version":0,"created_by":"admin","last_modified_by":"admin","create_time":"2016-02-02T01:23:33Z","system_mtime":"2016-02-02T01:23:33Z","user_mtime":"2016-02-02T01:23:33Z","instance_type":"digital_object","jsonmodel_type":"instance","digital_object":{"ref":"/repositories/2/digital_objects/8"}}],"notes":[],"uri":"/repositories/2/archival_objects/3","repository":{"ref":"/repositories/2"},"resource":{"ref":"/repositories/2/resources/1"},"parent":{"ref":"/repositories/2/archival_objects/1"},"has_unpublished_ancestor":true} - -'} - headers: - Cache-Control: ['private, must-revalidate, max-age=0'] - Content-Length: ['1827'] - Content-Type: [application/json] - Date: ['Tue, 02 Feb 2016 01:23:33 GMT'] - Server: [Jetty(8.1.5.v20120716)] - X-Content-Type-Options: [nosniff] - status: {code: 200, message: OK} -version: 1 diff --git a/tests/fixtures/test_edit_record_multiple_notes.yaml b/tests/fixtures/test_edit_record_multiple_notes.yaml deleted file mode 100644 index 0961238..0000000 --- a/tests/fixtures/test_edit_record_multiple_notes.yaml +++ /dev/null @@ -1,107 +0,0 @@ -interactions: -- request: - body: expiring=False&password=admin - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['36'] - Content-Type: [application/x-www-form-urlencoded] - User-Agent: [python-requests/2.11.1] - method: POST - uri: http://localhost:8089/users/admin/login - response: - body: {string: '{"session":"ad772ecb08b2d161a484c540690f5e93a61814cef5f0b362ac9ab1d833a139ec","user":{"lock_version":7815,"username":"admin","name":"Administrator","is_system_user":true,"create_time":"2015-09-22T18:46:11Z","system_mtime":"2017-02-09T22:14:36Z","user_mtime":"2017-02-09T22:14:36Z","jsonmodel_type":"user","groups":[],"is_admin":true,"uri":"/users/1","agent_record":{"ref":"/agents/people/1"},"permissions":{"/repositories/1":["update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record","system_config","administer_system","manage_users","become_user","view_all_records","create_repository","delete_repository","transfer_repository","index_system","manage_repository","update_accession_record","update_resource_record","update_digital_object_record","update_event_record","delete_event_record","suppress_archival_record","transfer_archival_record","delete_archival_record","view_suppressed","view_repository","update_classification_record","delete_classification_record","mediate_edits","import_records","cancel_importer_job","manage_subject_record","manage_agent_record","manage_vocabulary_record","merge_agents_and_subjects","merge_archival_record","manage_rde_templates"],"_archivesspace":["system_config","administer_system","manage_users","become_user","view_all_records","create_repository","delete_repository","transfer_repository","index_system","manage_repository","update_accession_record","update_resource_record","update_digital_object_record","update_event_record","delete_event_record","suppress_archival_record","transfer_archival_record","delete_archival_record","view_suppressed","view_repository","update_classification_record","delete_classification_record","mediate_edits","import_records","cancel_importer_job","manage_subject_record","manage_agent_record","manage_vocabulary_record","merge_agents_and_subjects","merge_archival_record","manage_rde_templates","update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record"]}}} - - '} - headers: - Cache-Control: ['private, must-revalidate, max-age=0'] - Content-Length: ['2253'] - Content-Type: [application/json] - Date: ['Thu, 09 Feb 2017 22:14:35 GMT'] - Server: [Jetty(8.1.5.v20120716)] - X-Content-Type-Options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.11.1] - X-ArchivesSpace-Session: [ad772ecb08b2d161a484c540690f5e93a61814cef5f0b362ac9ab1d833a139ec] - method: GET - uri: http://localhost:8089/repositories/2/archival_objects/9253 - response: - body: {string: '{"lock_version":0,"position":0,"ref_id":"deba72c5e3a1926de775574d7d2ca269","title":"holly-test","display_string":"holly-test","restrictions_apply":false,"created_by":"admin","last_modified_by":"admin","create_time":"2017-02-03T23:15:10Z","system_mtime":"2017-02-09T22:13:51Z","user_mtime":"2017-02-03T23:15:10Z","suppressed":false,"level":"file","jsonmodel_type":"archival_object","external_ids":[],"subjects":[],"linked_events":[],"extents":[],"dates":[],"external_documents":[],"rights_statements":[],"linked_agents":[],"instances":[],"notes":[],"uri":"/repositories/2/archival_objects/9253","repository":{"ref":"/repositories/2"},"resource":{"ref":"/repositories/2/resources/4"},"parent":{"ref":"/repositories/2/archival_objects/8887"},"has_unpublished_ancestor":true} - - '} - headers: - Cache-Control: ['private, must-revalidate, max-age=0'] - Content-Length: ['772'] - Content-Type: [application/json] - Date: ['Thu, 09 Feb 2017 22:14:36 GMT'] - Server: [Jetty(8.1.5.v20120716)] - X-Content-Type-Options: [nosniff] - status: {code: 200, message: OK} -- request: - body: '{"has_unpublished_ancestor": true, "parent": {"ref": "/repositories/2/archival_objects/8887"}, - "jsonmodel_type": "archival_object", "linked_events": [], "external_ids": [], - "created_by": "admin", "rights_statements": [], "level": "file", "user_mtime": - "2017-02-03T23:15:10Z", "last_modified_by": "admin", "suppressed": false, "repository": - {"ref": "/repositories/2"}, "display_string": "holly-test", "external_documents": - [], "dates": [], "extents": [], "system_mtime": "2017-02-09T22:13:51Z", "linked_agents": - [], "position": 0, "restrictions_apply": false, "resource": {"ref": "/repositories/2/resources/4"}, - "uri": "/repositories/2/archival_objects/9253", "create_time": "2017-02-03T23:15:10Z", - "lock_version": 0, "notes": [{"subnotes": [{"content": "General note content", - "jsonmodel_type": "note_text", "publish": true}], "jsonmodel_type": "note_multipart", - "publish": true, "type": "odd"}, {"subnotes": [{"content": "Access restriction - note", "jsonmodel_type": "note_text", "publish": true}], "jsonmodel_type": "note_multipart", - "publish": true, "type": "accessrestrict"}], "title": "holly-test", "subjects": - [], "instances": [], "ref_id": "deba72c5e3a1926de775574d7d2ca269"}' - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['1181'] - User-Agent: [python-requests/2.11.1] - X-ArchivesSpace-Session: [ad772ecb08b2d161a484c540690f5e93a61814cef5f0b362ac9ab1d833a139ec] - method: POST - uri: http://localhost:8089/repositories/2/archival_objects/9253 - response: - body: {string: '{"status":"Updated","id":9253,"lock_version":1,"stale":true,"uri":"/repositories/2/archival_objects/9253","warnings":[]} - - '} - headers: - Cache-Control: ['private, must-revalidate, max-age=0'] - Content-Length: ['121'] - Content-Type: [application/json] - Date: ['Thu, 09 Feb 2017 22:14:36 GMT'] - Server: [Jetty(8.1.5.v20120716)] - X-Content-Type-Options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.11.1] - X-ArchivesSpace-Session: [ad772ecb08b2d161a484c540690f5e93a61814cef5f0b362ac9ab1d833a139ec] - method: GET - uri: http://localhost:8089/repositories/2/archival_objects/9253 - response: - body: {string: '{"lock_version":1,"position":0,"publish":false,"ref_id":"deba72c5e3a1926de775574d7d2ca269","title":"holly-test","display_string":"holly-test","restrictions_apply":false,"created_by":"admin","last_modified_by":"admin","create_time":"2017-02-03T23:15:10Z","system_mtime":"2017-02-09T22:14:36Z","user_mtime":"2017-02-09T22:14:36Z","suppressed":false,"level":"file","jsonmodel_type":"archival_object","external_ids":[],"subjects":[],"linked_events":[],"extents":[],"dates":[],"external_documents":[],"rights_statements":[],"linked_agents":[],"instances":[],"notes":[{"subnotes":[{"content":"General - note content","jsonmodel_type":"note_text","publish":true}],"jsonmodel_type":"note_multipart","type":"odd","persistent_id":"5c593d5dc0281cbdeeebe07126375487","publish":true},{"subnotes":[{"content":"Access - restriction note","jsonmodel_type":"note_text","publish":true}],"jsonmodel_type":"note_multipart","type":"accessrestrict","persistent_id":"f2c649e8a7c1cba86647f26cad464804","publish":true}],"uri":"/repositories/2/archival_objects/9253","repository":{"ref":"/repositories/2"},"resource":{"ref":"/repositories/2/resources/4"},"parent":{"ref":"/repositories/2/archival_objects/8887"},"has_unpublished_ancestor":true} - - '} - headers: - Cache-Control: ['private, must-revalidate, max-age=0'] - Content-Length: ['1215'] - Content-Type: [application/json] - Date: ['Thu, 09 Feb 2017 22:14:36 GMT'] - Server: [Jetty(8.1.5.v20120716)] - X-Content-Type-Options: [nosniff] - status: {code: 200, message: OK} -version: 1 diff --git a/tests/fixtures/test_empty_dates.yaml b/tests/fixtures/test_empty_dates.yaml deleted file mode 100644 index a90b64d..0000000 --- a/tests/fixtures/test_empty_dates.yaml +++ /dev/null @@ -1,225 +0,0 @@ -interactions: -- request: - body: !!binary | - cGFzc3dvcmQ9YWRtaW4mZXhwaXJpbmc9RmFsc2U= - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['29'] - Content-Type: [application/x-www-form-urlencoded] - User-Agent: [python-requests/2.8.1] - method: POST - uri: http://localhost:8089/users/admin/login - response: - body: {string: '{"session":"2661a9a15d0a2667572979a5d5d88678fc79554aa9cca99b48111c2da65508a5","user":{"lock_version":784,"username":"admin","name":"Administrator","is_system_user":true,"create_time":"2015-06-11T17:04:21Z","system_mtime":"2015-12-04T23:26:24Z","user_mtime":"2015-12-04T23:26:24Z","jsonmodel_type":"user","groups":[],"is_admin":true,"uri":"/users/1","agent_record":{"ref":"/agents/people/1"},"permissions":{"/repositories/1":["update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record","administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed"],"_archivesspace":["administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed","update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record"]}}} - -'} - headers: - Cache-Control: ['private, must-revalidate, max-age=0'] - Content-Length: ['2206'] - Content-Type: [application/json] - Date: ['Fri, 04 Dec 2015 23:26:24 GMT'] - Server: [Jetty(8.1.5.v20120716)] - X-Content-Type-Options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.8.1] - X-ArchivesSpace-Session: [2661a9a15d0a2667572979a5d5d88678fc79554aa9cca99b48111c2da65508a5] - method: GET - uri: http://localhost:8089/repositories/2/archival_objects/2 - response: - body: {string: '{"lock_version":1,"position":1,"publish":false,"ref_id":"2d6194e7945563b58be69b5a70887239","component_id":"F1-2","title":"Test - series 2","display_string":"Test series 2","restrictions_apply":false,"created_by":"admin","last_modified_by":"admin","create_time":"2015-06-11T17:15:03Z","system_mtime":"2015-12-03T00:03:42Z","user_mtime":"2015-06-11T17:46:12Z","suppressed":false,"level":"series","jsonmodel_type":"archival_object","external_ids":[],"subjects":[],"linked_events":[],"extents":[],"dates":[],"external_documents":[],"rights_statements":[],"linked_agents":[],"instances":[],"notes":[],"uri":"/repositories/2/archival_objects/2","repository":{"ref":"/repositories/2"},"resource":{"ref":"/repositories/2/resources/1"},"has_unpublished_ancestor":true} - -'} - headers: - Cache-Control: ['private, must-revalidate, max-age=0'] - Content-Length: ['758'] - Content-Type: [application/json] - Date: ['Fri, 04 Dec 2015 23:26:24 GMT'] - Server: [Jetty(8.1.5.v20120716)] - X-Content-Type-Options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.8.1] - X-ArchivesSpace-Session: [2661a9a15d0a2667572979a5d5d88678fc79554aa9cca99b48111c2da65508a5] - method: GET - uri: http://localhost:8089/repositories/2/archival_objects/2/children - response: - body: {string: '[{"lock_version":0,"position":0,"ref_id":"f9db798809e30de21950f0414f09fb76","title":"Test - bad resource","display_string":"Test bad resource","restrictions_apply":false,"created_by":"admin","last_modified_by":"admin","create_time":"2015-09-10T18:21:17Z","system_mtime":"2015-12-02T01:05:22Z","user_mtime":"2015-09-10T18:21:17Z","suppressed":false,"level":"series","jsonmodel_type":"archival_object","external_ids":[],"subjects":[],"linked_events":[],"extents":[],"dates":[],"external_documents":[],"rights_statements":[],"linked_agents":[],"instances":[],"notes":[],"uri":"/repositories/2/archival_objects/7","repository":{"ref":"/repositories/2"},"resource":{"ref":"/repositories/2/resources/2"},"parent":{"ref":"/repositories/2/archival_objects/2"},"has_unpublished_ancestor":true}] - -'} - headers: - Cache-Control: ['private, must-revalidate, max-age=0'] - Content-Length: ['784'] - Content-Type: [application/json] - Date: ['Fri, 04 Dec 2015 23:26:24 GMT'] - Server: [Jetty(8.1.5.v20120716)] - X-Content-Type-Options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.8.1] - X-ArchivesSpace-Session: [2661a9a15d0a2667572979a5d5d88678fc79554aa9cca99b48111c2da65508a5] - method: GET - uri: http://localhost:8089/repositories/2/archival_objects/7/children - response: - body: {string: '[] - -'} - headers: - Cache-Control: ['private, must-revalidate, max-age=0'] - Content-Length: ['3'] - Content-Type: [application/json] - Date: ['Fri, 04 Dec 2015 23:26:24 GMT'] - Server: [Jetty(8.1.5.v20120716)] - X-Content-Type-Options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.8.1] - X-ArchivesSpace-Session: [2661a9a15d0a2667572979a5d5d88678fc79554aa9cca99b48111c2da65508a5] - method: GET - uri: http://localhost:8089/repositories/2/resources/2/tree - response: - body: {string: '{"title":"Some other fonds","id":2,"node_type":"resource","publish":false,"suppressed":false,"children":[{"title":"New - resource child","id":12,"record_uri":"/repositories/2/archival_objects/12","publish":false,"suppressed":false,"node_type":"archival_object","level":"series","has_children":false,"children":[],"instance_types":[],"containers":[]}],"record_uri":"/repositories/2/resources/2","level":"fonds","jsonmodel_type":"resource_tree","instance_types":[],"containers":[]} - -'} - headers: - Cache-Control: ['private, must-revalidate, max-age=0'] - Content-Length: ['478'] - Content-Type: [application/json] - Date: ['Fri, 04 Dec 2015 23:26:24 GMT'] - Server: [Jetty(8.1.5.v20120716)] - X-Content-Type-Options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.8.1] - X-ArchivesSpace-Session: [2661a9a15d0a2667572979a5d5d88678fc79554aa9cca99b48111c2da65508a5] - method: GET - uri: http://localhost:8089/repositories/2/resources/2 - response: - body: {string: '{"lock_version":4,"title":"Some other fonds","publish":false,"restrictions":false,"created_by":"admin","last_modified_by":"admin","create_time":"2015-06-30T23:17:57Z","system_mtime":"2015-12-02T01:05:21Z","user_mtime":"2015-12-02T01:05:21Z","suppressed":false,"id_0":"F2","level":"fonds","jsonmodel_type":"resource","external_ids":[],"subjects":[],"linked_events":[],"extents":[{"lock_version":0,"number":"1","created_by":"admin","last_modified_by":"admin","create_time":"2015-12-02T01:05:21Z","system_mtime":"2015-12-02T01:05:21Z","user_mtime":"2015-12-02T01:05:21Z","portion":"whole","extent_type":"cassettes","jsonmodel_type":"extent"}],"dates":[{"lock_version":0,"begin":"2015-06-29","created_by":"admin","last_modified_by":"admin","create_time":"2015-12-02T01:05:21Z","system_mtime":"2015-12-02T01:05:21Z","user_mtime":"2015-12-02T01:05:21Z","date_type":"bulk","label":"creation","jsonmodel_type":"date"}],"external_documents":[],"rights_statements":[],"linked_agents":[],"instances":[{"lock_version":0,"created_by":"admin","last_modified_by":"admin","create_time":"2015-12-02T01:05:21Z","system_mtime":"2015-12-02T01:05:21Z","user_mtime":"2015-12-02T01:05:21Z","instance_type":"digital_object","jsonmodel_type":"instance","digital_object":{"ref":"/repositories/2/digital_objects/3"}},{"lock_version":0,"created_by":"admin","last_modified_by":"admin","create_time":"2015-12-02T01:05:22Z","system_mtime":"2015-12-02T01:05:22Z","user_mtime":"2015-12-02T01:05:22Z","instance_type":"digital_object","jsonmodel_type":"instance","digital_object":{"ref":"/repositories/2/digital_objects/4"}},{"lock_version":0,"created_by":"admin","last_modified_by":"admin","create_time":"2015-12-02T01:05:22Z","system_mtime":"2015-12-02T01:05:22Z","user_mtime":"2015-12-02T01:05:22Z","instance_type":"digital_object","jsonmodel_type":"instance","digital_object":{"ref":"/repositories/2/digital_objects/5"}},{"lock_version":0,"created_by":"admin","last_modified_by":"admin","create_time":"2015-12-02T01:05:22Z","system_mtime":"2015-12-02T01:05:22Z","user_mtime":"2015-12-02T01:05:22Z","instance_type":"digital_object","jsonmodel_type":"instance","digital_object":{"ref":"/repositories/2/digital_objects/6"}}],"deaccessions":[],"related_accessions":[],"notes":[],"uri":"/repositories/2/resources/2","repository":{"ref":"/repositories/2"},"tree":{"ref":"/repositories/2/resources/2/tree"}} - -'} - headers: - Cache-Control: ['private, must-revalidate, max-age=0'] - Content-Length: ['2370'] - Content-Type: [application/json] - Date: ['Fri, 04 Dec 2015 23:26:24 GMT'] - Server: [Jetty(8.1.5.v20120716)] - X-Content-Type-Options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.8.1] - X-ArchivesSpace-Session: [2661a9a15d0a2667572979a5d5d88678fc79554aa9cca99b48111c2da65508a5] - method: GET - uri: http://localhost:8089/repositories/2/search?page_size=30&page=1&q=primary_type%3Aresource - response: - body: {string: '{"first_page":1,"last_page":1,"this_page":1,"offset_first":1,"offset_last":2,"total_hits":2,"results":[{"id":"/repositories/2/resources/1","title":"Test - fonds","primary_type":"resource","types":["resource"],"json":"{\"lock_version\":11,\"title\":\"Test - fonds\",\"publish\":false,\"restrictions\":false,\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-06-11T17:08:42Z\",\"system_mtime\":\"2015-12-03T00:03:41Z\",\"user_mtime\":\"2015-12-03T00:03:41Z\",\"suppressed\":false,\"id_0\":\"F1\",\"language\":\"eng\",\"level\":\"fonds\",\"jsonmodel_type\":\"resource\",\"external_ids\":[],\"subjects\":[],\"linked_events\":[],\"extents\":[{\"lock_version\":0,\"number\":\"1\",\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-12-03T00:03:42Z\",\"system_mtime\":\"2015-12-03T00:03:42Z\",\"user_mtime\":\"2015-12-03T00:03:42Z\",\"portion\":\"whole\",\"extent_type\":\"cassettes\",\"jsonmodel_type\":\"extent\"}],\"dates\":[{\"lock_version\":0,\"begin\":\"2015-01-01\",\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-12-03T00:03:42Z\",\"system_mtime\":\"2015-12-03T00:03:42Z\",\"user_mtime\":\"2015-12-03T00:03:42Z\",\"date_type\":\"single\",\"label\":\"creation\",\"jsonmodel_type\":\"date\"}],\"external_documents\":[],\"rights_statements\":[],\"linked_agents\":[],\"instances\":[],\"deaccessions\":[],\"related_accessions\":[{\"ref\":\"/repositories/2/accessions/1\"}],\"notes\":[{\"content\":[\"Singlepart - note\"],\"type\":\"physdesc\",\"jsonmodel_type\":\"note_singlepart\",\"persistent_id\":\"cdc013c483de98b8a1762302faf8fd32\",\"publish\":true}],\"uri\":\"/repositories/2/resources/1\",\"repository\":{\"ref\":\"/repositories/2\"},\"tree\":{\"ref\":\"/repositories/2/resources/1/tree\"}}","suppressed":false,"publish":false,"system_generated":false,"repository":"/repositories/2","created_by":"admin","last_modified_by":"admin","user_mtime":"2015-12-03T00:03:41Z","system_mtime":"2015-12-03T00:03:41Z","create_time":"2015-06-11T17:08:42Z","level":"fonds","identifier":"F1","language":"eng","restrictions":"false","four_part_id":"F1","uri":"/repositories/2/resources/1","jsonmodel_type":"resource"},{"id":"/repositories/2/resources/2","title":"Some - other fonds","primary_type":"resource","types":["resource"],"json":"{\"lock_version\":4,\"title\":\"Some - other fonds\",\"publish\":false,\"restrictions\":false,\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-06-30T23:17:57Z\",\"system_mtime\":\"2015-12-02T01:05:21Z\",\"user_mtime\":\"2015-12-02T01:05:21Z\",\"suppressed\":false,\"id_0\":\"F2\",\"level\":\"fonds\",\"jsonmodel_type\":\"resource\",\"external_ids\":[],\"subjects\":[],\"linked_events\":[],\"extents\":[{\"lock_version\":0,\"number\":\"1\",\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-12-02T01:05:21Z\",\"system_mtime\":\"2015-12-02T01:05:21Z\",\"user_mtime\":\"2015-12-02T01:05:21Z\",\"portion\":\"whole\",\"extent_type\":\"cassettes\",\"jsonmodel_type\":\"extent\"}],\"dates\":[{\"lock_version\":0,\"begin\":\"2015-06-29\",\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-12-02T01:05:21Z\",\"system_mtime\":\"2015-12-02T01:05:21Z\",\"user_mtime\":\"2015-12-02T01:05:21Z\",\"date_type\":\"bulk\",\"label\":\"creation\",\"jsonmodel_type\":\"date\"}],\"external_documents\":[],\"rights_statements\":[],\"linked_agents\":[],\"instances\":[{\"lock_version\":0,\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-12-02T01:05:21Z\",\"system_mtime\":\"2015-12-02T01:05:21Z\",\"user_mtime\":\"2015-12-02T01:05:21Z\",\"instance_type\":\"digital_object\",\"jsonmodel_type\":\"instance\",\"digital_object\":{\"ref\":\"/repositories/2/digital_objects/3\",\"_resolved\":{\"lock_version\":4,\"digital_object_id\":\"f808032e-c6ec-4242-b7aa-5395988b9f7e\",\"title\":\"test\",\"restrictions\":false,\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-12-02T00:55:38Z\",\"system_mtime\":\"2015-12-02T01:05:22Z\",\"user_mtime\":\"2015-12-02T00:55:38Z\",\"suppressed\":false,\"digital_object_type\":\"text\",\"jsonmodel_type\":\"digital_object\",\"external_ids\":[],\"subjects\":[],\"linked_events\":[],\"extents\":[],\"dates\":[],\"external_documents\":[],\"rights_statements\":[],\"linked_agents\":[],\"file_versions\":[],\"notes\":[{\"content\":[\"test\"],\"type\":\"originalsloc\",\"jsonmodel_type\":\"note_digital_object\",\"persistent_id\":\"4e5eec95fcb62440f20a4f5b89c6d16b\",\"publish\":true}],\"linked_instances\":[{\"ref\":\"/repositories/2/resources/2\"}],\"uri\":\"/repositories/2/digital_objects/3\",\"repository\":{\"ref\":\"/repositories/2\"},\"tree\":{\"ref\":\"/repositories/2/digital_objects/3/tree\"}}}},{\"lock_version\":0,\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-12-02T01:05:22Z\",\"system_mtime\":\"2015-12-02T01:05:22Z\",\"user_mtime\":\"2015-12-02T01:05:22Z\",\"instance_type\":\"digital_object\",\"jsonmodel_type\":\"instance\",\"digital_object\":{\"ref\":\"/repositories/2/digital_objects/4\",\"_resolved\":{\"lock_version\":3,\"digital_object_id\":\"5517ddb1-36dd-4a02-a363-f1571982670f\",\"title\":\"test\",\"restrictions\":false,\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-12-02T00:55:53Z\",\"system_mtime\":\"2015-12-02T01:05:22Z\",\"user_mtime\":\"2015-12-02T00:55:53Z\",\"suppressed\":false,\"digital_object_type\":\"text\",\"jsonmodel_type\":\"digital_object\",\"external_ids\":[],\"subjects\":[],\"linked_events\":[],\"extents\":[],\"dates\":[],\"external_documents\":[],\"rights_statements\":[],\"linked_agents\":[],\"file_versions\":[],\"notes\":[{\"content\":[\"test\"],\"type\":\"originalsloc\",\"jsonmodel_type\":\"note_digital_object\",\"persistent_id\":\"bdfe911944a3d26a9fd43455aa968c52\",\"publish\":true}],\"linked_instances\":[{\"ref\":\"/repositories/2/resources/2\"}],\"uri\":\"/repositories/2/digital_objects/4\",\"repository\":{\"ref\":\"/repositories/2\"},\"tree\":{\"ref\":\"/repositories/2/digital_objects/4/tree\"}}}},{\"lock_version\":0,\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-12-02T01:05:22Z\",\"system_mtime\":\"2015-12-02T01:05:22Z\",\"user_mtime\":\"2015-12-02T01:05:22Z\",\"instance_type\":\"digital_object\",\"jsonmodel_type\":\"instance\",\"digital_object\":{\"ref\":\"/repositories/2/digital_objects/5\",\"_resolved\":{\"lock_version\":2,\"digital_object_id\":\"8ea81c4d-6df3-4775-a314-4bef4f44dd3c\",\"title\":\"Some - other fonds\",\"restrictions\":false,\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-12-02T01:04:57Z\",\"system_mtime\":\"2015-12-02T01:05:22Z\",\"user_mtime\":\"2015-12-02T01:04:57Z\",\"suppressed\":false,\"digital_object_type\":\"text\",\"jsonmodel_type\":\"digital_object\",\"external_ids\":[],\"subjects\":[],\"linked_events\":[],\"extents\":[],\"dates\":[],\"external_documents\":[],\"rights_statements\":[],\"linked_agents\":[],\"file_versions\":[],\"notes\":[{\"content\":[\"test\"],\"type\":\"originalsloc\",\"jsonmodel_type\":\"note_digital_object\",\"persistent_id\":\"68242ba5c0cbff4b674c6a2fa2335ad0\",\"publish\":true}],\"linked_instances\":[{\"ref\":\"/repositories/2/resources/2\"}],\"uri\":\"/repositories/2/digital_objects/5\",\"repository\":{\"ref\":\"/repositories/2\"},\"tree\":{\"ref\":\"/repositories/2/digital_objects/5/tree\"}}}},{\"lock_version\":0,\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-12-02T01:05:22Z\",\"system_mtime\":\"2015-12-02T01:05:22Z\",\"user_mtime\":\"2015-12-02T01:05:22Z\",\"instance_type\":\"digital_object\",\"jsonmodel_type\":\"instance\",\"digital_object\":{\"ref\":\"/repositories/2/digital_objects/6\",\"_resolved\":{\"lock_version\":1,\"digital_object_id\":\"a1672927-9a56-41c4-b423-5d76e4a1c660\",\"title\":\"Some - other fonds\",\"restrictions\":false,\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-12-02T01:05:21Z\",\"system_mtime\":\"2015-12-02T01:05:22Z\",\"user_mtime\":\"2015-12-02T01:05:21Z\",\"suppressed\":false,\"digital_object_type\":\"text\",\"jsonmodel_type\":\"digital_object\",\"external_ids\":[],\"subjects\":[],\"linked_events\":[],\"extents\":[],\"dates\":[],\"external_documents\":[],\"rights_statements\":[],\"linked_agents\":[],\"file_versions\":[],\"notes\":[{\"content\":[\"test\"],\"type\":\"originalsloc\",\"jsonmodel_type\":\"note_digital_object\",\"persistent_id\":\"3453d8096aabc607723b4359ab8fdd3c\",\"publish\":true}],\"linked_instances\":[{\"ref\":\"/repositories/2/resources/2\"}],\"uri\":\"/repositories/2/digital_objects/6\",\"repository\":{\"ref\":\"/repositories/2\"},\"tree\":{\"ref\":\"/repositories/2/digital_objects/6/tree\"}}}}],\"deaccessions\":[],\"related_accessions\":[],\"notes\":[],\"uri\":\"/repositories/2/resources/2\",\"repository\":{\"ref\":\"/repositories/2\"},\"tree\":{\"ref\":\"/repositories/2/resources/2/tree\"}}","suppressed":false,"publish":false,"system_generated":false,"repository":"/repositories/2","created_by":"admin","last_modified_by":"admin","user_mtime":"2015-12-02T01:05:21Z","system_mtime":"2015-12-02T01:05:21Z","create_time":"2015-06-30T23:17:57Z","level":"fonds","identifier":"F2","restrictions":"false","four_part_id":"F2","uri":"/repositories/2/resources/2","jsonmodel_type":"resource"}],"facets":{"facet_queries":{},"facet_fields":{},"facet_dates":{},"facet_ranges":{}}} - -'} - headers: - Cache-Control: ['private, must-revalidate, max-age=0'] - Content-Length: ['9418'] - Content-Type: [application/json] - Date: ['Fri, 04 Dec 2015 23:26:24 GMT'] - Server: [Jetty(8.1.5.v20120716)] - X-Content-Type-Options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.8.1] - X-ArchivesSpace-Session: [2661a9a15d0a2667572979a5d5d88678fc79554aa9cca99b48111c2da65508a5] - method: GET - uri: http://localhost:8089/repositories/2/resources/1/tree?page=1 - response: - body: {string: '{"title":"Test fonds","id":1,"node_type":"resource","publish":false,"suppressed":false,"children":[{"title":"Test - series, 1950 - 1972","id":1,"record_uri":"/repositories/2/archival_objects/1","publish":false,"suppressed":false,"node_type":"archival_object","level":"series","has_children":true,"children":[{"title":"Test - edited subseries, November, 2014 to November, 2015","id":3,"record_uri":"/repositories/2/archival_objects/3","publish":false,"suppressed":false,"node_type":"archival_object","level":"subseries","has_children":true,"children":[{"title":"Test - file","id":4,"record_uri":"/repositories/2/archival_objects/4","publish":false,"suppressed":false,"node_type":"archival_object","level":"file","has_children":false,"children":[],"instance_types":[],"containers":[]}],"instance_types":[],"containers":[]},{"title":"New - new new child","id":10,"record_uri":"/repositories/2/archival_objects/10","publish":false,"suppressed":false,"node_type":"archival_object","level":"series","has_children":false,"children":[],"instance_types":[],"containers":[]}],"instance_types":[],"containers":[]},{"title":"Test - series 2","id":2,"record_uri":"/repositories/2/archival_objects/2","publish":false,"suppressed":false,"node_type":"archival_object","level":"series","has_children":false,"children":[],"instance_types":[],"containers":[]},{"title":"Test - new child","id":13,"record_uri":"/repositories/2/archival_objects/13","publish":false,"suppressed":false,"node_type":"archival_object","level":"series","has_children":false,"children":[],"instance_types":[],"containers":[]},{"title":"Test - new child 2","id":14,"record_uri":"/repositories/2/archival_objects/14","publish":false,"suppressed":false,"node_type":"archival_object","level":"item","has_children":false,"children":[],"instance_types":[],"containers":[]},{"title":"Test - new child 3","id":16,"record_uri":"/repositories/2/archival_objects/16","publish":false,"suppressed":false,"node_type":"archival_object","level":"class","has_children":false,"children":[],"instance_types":[],"containers":[]},{"title":"New - child with note","id":17,"record_uri":"/repositories/2/archival_objects/17","publish":false,"suppressed":false,"node_type":"archival_object","level":"class","has_children":false,"children":[],"instance_types":[],"containers":[]},{"title":"New - child final","id":18,"record_uri":"/repositories/2/archival_objects/18","publish":false,"suppressed":false,"node_type":"archival_object","level":null,"has_children":false,"children":[],"instance_types":[],"containers":[]},{"title":"Child - with no note","id":19,"record_uri":"/repositories/2/archival_objects/19","publish":false,"suppressed":false,"node_type":"archival_object","level":"fonds","has_children":false,"children":[],"instance_types":[],"containers":[]},{"title":"Child - with no note","id":20,"record_uri":"/repositories/2/archival_objects/20","publish":false,"suppressed":false,"node_type":"archival_object","level":"fonds","has_children":false,"children":[],"instance_types":[],"containers":[]}],"record_uri":"/repositories/2/resources/1","level":"fonds","jsonmodel_type":"resource_tree","instance_types":[],"containers":[]} - -'} - headers: - Cache-Control: ['private, must-revalidate, max-age=0'] - Content-Length: ['3142'] - Content-Type: [application/json] - Date: ['Fri, 04 Dec 2015 23:26:25 GMT'] - Server: [Jetty(8.1.5.v20120716)] - X-Content-Type-Options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.8.1] - X-ArchivesSpace-Session: [2661a9a15d0a2667572979a5d5d88678fc79554aa9cca99b48111c2da65508a5] - method: GET - uri: http://localhost:8089/repositories/2/resources/2/tree?page=1 - response: - body: {string: '{"title":"Some other fonds","id":2,"node_type":"resource","publish":false,"suppressed":false,"children":[{"title":"New - resource child","id":12,"record_uri":"/repositories/2/archival_objects/12","publish":false,"suppressed":false,"node_type":"archival_object","level":"series","has_children":false,"children":[],"instance_types":[],"containers":[]}],"record_uri":"/repositories/2/resources/2","level":"fonds","jsonmodel_type":"resource_tree","instance_types":[],"containers":[]} - -'} - headers: - Cache-Control: ['private, must-revalidate, max-age=0'] - Content-Length: ['478'] - Content-Type: [application/json] - Date: ['Fri, 04 Dec 2015 23:26:25 GMT'] - Server: [Jetty(8.1.5.v20120716)] - X-Content-Type-Options: [nosniff] - status: {code: 200, message: OK} -version: 1 diff --git a/tests/fixtures/test_find_by_id_refid.yaml b/tests/fixtures/test_find_by_id_refid.yaml deleted file mode 100644 index 3f0fd21..0000000 --- a/tests/fixtures/test_find_by_id_refid.yaml +++ /dev/null @@ -1,48 +0,0 @@ -interactions: -- request: - body: password=admin - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['14'] - Content-Type: [application/x-www-form-urlencoded] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-43-generic] - method: POST - uri: http://localhost:8089/users/admin/login - response: - body: {string: !!python/unicode '{"session":"a7044300d27191551e5940423d1c0e9fb7a49354cab8d986eddcb1e940b9e6b4","user":{"lock_version":1508,"username":"admin","name":"Administrator","is_system_user":true,"create_time":"2014-12-05T20:32:17Z","system_mtime":"2015-09-23T00:07:23Z","user_mtime":"2015-09-23T00:07:23Z","jsonmodel_type":"user","groups":[],"is_admin":false,"uri":"/users/1","agent_record":{"ref":"/agents/people/1"},"permissions":{"/repositories/2":["view_repository","update_accession_record","update_resource_record","update_digital_object_record"],"_archivesspace":[]}}} - - '} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['551'] - content-type: [application/json] - date: ['Wed, 23 Sep 2015 00:07:23 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-43-generic] - X-ArchivesSpace-Session: [!!python/unicode 'a7044300d27191551e5940423d1c0e9fb7a49354cab8d986eddcb1e940b9e6b4'] - method: GET - uri: http://localhost:8089/repositories/2/find_by_id/archival_objects?resolve%5B%5D=archival_objects&ref_id%5B%5D=a118514fab1b2ee6a7e9ad259e1de355 - response: - body: {string: !!python/unicode '{"archival_objects":[{"ref":"/repositories/2/archival_objects/752250","_resolved":{"lock_version":0,"position":0,"publish":true,"ref_id":"a118514fab1b2ee6a7e9ad259e1de355","component_id":"test111","title":"Test - AO","display_string":"Test AO","restrictions_apply":false,"created_by":"admin","last_modified_by":"admin","create_time":"2015-09-22T18:35:41Z","system_mtime":"2015-09-22T18:35:41Z","user_mtime":"2015-09-22T18:35:41Z","suppressed":false,"level":"file","jsonmodel_type":"archival_object","external_ids":[],"subjects":[],"linked_events":[],"extents":[],"dates":[],"external_documents":[],"rights_statements":[],"linked_agents":[],"instances":[],"notes":[],"uri":"/repositories/2/archival_objects/752250","repository":{"ref":"/repositories/2"},"resource":{"ref":"/repositories/2/resources/11319"},"has_unpublished_ancestor":false}}]} - - '} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['841'] - content-type: [application/json] - date: ['Wed, 23 Sep 2015 00:07:23 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -version: 1 diff --git a/tests/fixtures/test_find_collection_ids.yaml b/tests/fixtures/test_find_collection_ids.yaml deleted file mode 100644 index 92b8e0a..0000000 --- a/tests/fixtures/test_find_collection_ids.yaml +++ /dev/null @@ -1,70 +0,0 @@ -interactions: -- request: - body: password=admin - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Content-Length: ['14'] - Content-Type: [application/x-www-form-urlencoded] - User-Agent: [python-requests/2.3.0 CPython/2.7.10 Darwin/14.4.0] - method: POST - uri: http://localhost:8089/users/admin/login - response: - body: {string: !!python/unicode '{"session":"5934dcb043611dda104542b5c8194a3d4ca35cf86d0c288d5cd1acf301633c14","user":{"lock_version":20,"username":"admin","name":"Administrator","is_system_user":true,"create_time":"2015-06-11T17:04:21Z","system_mtime":"2015-06-30T23:36:37Z","user_mtime":"2015-06-30T23:36:37Z","jsonmodel_type":"user","groups":[],"is_admin":true,"uri":"/users/1","agent_record":{"ref":"/agents/people/1"},"permissions":{"/repositories/1":["update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record","administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed"],"_archivesspace":["administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed","update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record"]}}} - -'} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['2205'] - content-type: [application/json] - date: ['Tue, 30 Jun 2015 23:36:37 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - User-Agent: [python-requests/2.3.0 CPython/2.7.10 Darwin/14.4.0] - X-ArchivesSpace-Session: [!!python/unicode 5934dcb043611dda104542b5c8194a3d4ca35cf86d0c288d5cd1acf301633c14] - method: GET - uri: http://localhost:8089/repositories/2/search?q=primary_type%3Aresource&page=1 - response: - body: {string: !!python/unicode '{"first_page":1,"last_page":1,"this_page":1,"offset_first":1,"offset_last":2,"total_hits":2,"results":[{"id":"/repositories/2/resources/1","title":"Test - fonds","primary_type":"resource","types":["resource"],"json":"{\"lock_version\":0,\"title\":\"Test - fonds\",\"publish\":false,\"restrictions\":false,\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-06-11T17:08:42Z\",\"system_mtime\":\"2015-06-11T17:08:42Z\",\"user_mtime\":\"2015-06-11T17:08:42Z\",\"suppressed\":false,\"id_0\":\"F1\",\"language\":\"eng\",\"level\":\"fonds\",\"jsonmodel_type\":\"resource\",\"external_ids\":[],\"subjects\":[],\"linked_events\":[],\"extents\":[{\"lock_version\":0,\"number\":\"1\",\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-06-11T17:08:42Z\",\"system_mtime\":\"2015-06-11T17:08:42Z\",\"user_mtime\":\"2015-06-11T17:08:42Z\",\"portion\":\"whole\",\"extent_type\":\"cassettes\",\"jsonmodel_type\":\"extent\"}],\"dates\":[{\"lock_version\":0,\"begin\":\"2015-01-01\",\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-06-11T17:08:42Z\",\"system_mtime\":\"2015-06-11T17:08:42Z\",\"user_mtime\":\"2015-06-11T17:08:42Z\",\"date_type\":\"single\",\"label\":\"creation\",\"jsonmodel_type\":\"date\"}],\"external_documents\":[],\"rights_statements\":[],\"linked_agents\":[],\"instances\":[],\"deaccessions\":[],\"related_accessions\":[],\"notes\":[],\"uri\":\"/repositories/2/resources/1\",\"repository\":{\"ref\":\"/repositories/2\"},\"tree\":{\"ref\":\"/repositories/2/resources/1/tree\"}}","suppressed":false,"publish":false,"system_generated":false,"repository":"/repositories/2","created_by":"admin","last_modified_by":"admin","user_mtime":"2015-06-11T17:08:42Z","system_mtime":"2015-06-11T17:08:42Z","create_time":"2015-06-11T17:08:42Z","level":"fonds","identifier":"F1","language":"eng","restrictions":"false","four_part_id":"F1","uri":"/repositories/2/resources/1","jsonmodel_type":"resource"},{"id":"/repositories/2/resources/2","title":"Some - other fonds","primary_type":"resource","types":["resource"],"json":"{\"lock_version\":0,\"title\":\"Some - other fonds\",\"publish\":false,\"restrictions\":false,\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-06-30T23:17:57Z\",\"system_mtime\":\"2015-06-30T23:17:57Z\",\"user_mtime\":\"2015-06-30T23:17:57Z\",\"suppressed\":false,\"id_0\":\"F2\",\"level\":\"fonds\",\"jsonmodel_type\":\"resource\",\"external_ids\":[],\"subjects\":[],\"linked_events\":[],\"extents\":[{\"lock_version\":0,\"number\":\"1\",\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-06-30T23:17:57Z\",\"system_mtime\":\"2015-06-30T23:17:57Z\",\"user_mtime\":\"2015-06-30T23:17:57Z\",\"portion\":\"whole\",\"extent_type\":\"cassettes\",\"jsonmodel_type\":\"extent\"}],\"dates\":[{\"lock_version\":0,\"begin\":\"2015-06-29\",\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-06-30T23:17:57Z\",\"system_mtime\":\"2015-06-30T23:17:57Z\",\"user_mtime\":\"2015-06-30T23:17:57Z\",\"date_type\":\"bulk\",\"label\":\"creation\",\"jsonmodel_type\":\"date\"}],\"external_documents\":[],\"rights_statements\":[],\"linked_agents\":[],\"instances\":[],\"deaccessions\":[],\"related_accessions\":[],\"notes\":[],\"uri\":\"/repositories/2/resources/2\",\"repository\":{\"ref\":\"/repositories/2\"},\"tree\":{\"ref\":\"/repositories/2/resources/2/tree\"}}","suppressed":false,"publish":false,"system_generated":false,"repository":"/repositories/2","created_by":"admin","last_modified_by":"admin","user_mtime":"2015-06-30T23:17:57Z","system_mtime":"2015-06-30T23:17:57Z","create_time":"2015-06-30T23:17:57Z","level":"fonds","identifier":"F2","restrictions":"false","four_part_id":"F2","uri":"/repositories/2/resources/2","jsonmodel_type":"resource"}],"facets":{"facet_queries":{},"facet_fields":{},"facet_dates":{},"facet_ranges":{}}} - -'} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['3900'] - content-type: [application/json] - date: ['Tue, 30 Jun 2015 23:36:37 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - User-Agent: [python-requests/2.3.0 CPython/2.7.10 Darwin/14.4.0] - X-ArchivesSpace-Session: [!!python/unicode 5934dcb043611dda104542b5c8194a3d4ca35cf86d0c288d5cd1acf301633c14] - method: GET - uri: http://localhost:8089/repositories/2/search?q=primary_type%3Aresource&page=2 - response: - body: {string: !!python/unicode '{"first_page":1,"last_page":1,"this_page":2,"offset_first":11,"offset_last":2,"total_hits":2,"results":[],"facets":{"facet_queries":{},"facet_fields":{},"facet_dates":{},"facet_ranges":{}}} - -'} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['190'] - content-type: [application/json] - date: ['Tue, 30 Jun 2015 23:36:37 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -version: 1 diff --git a/tests/fixtures/test_find_collection_ids_search.yaml b/tests/fixtures/test_find_collection_ids_search.yaml deleted file mode 100644 index 5354af0..0000000 --- a/tests/fixtures/test_find_collection_ids_search.yaml +++ /dev/null @@ -1,47 +0,0 @@ -interactions: -- request: - body: password=admin - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Content-Length: ['14'] - Content-Type: [application/x-www-form-urlencoded] - User-Agent: [python-requests/2.3.0 CPython/2.7.10 Darwin/14.4.0] - method: POST - uri: http://localhost:8089/users/admin/login - response: - body: {string: !!python/unicode '{"session":"7c5cd6a2c5b79c789f5125e09e58c287fddb81106f3bfbb5e33cda8b92d2d86e","user":{"lock_version":21,"username":"admin","name":"Administrator","is_system_user":true,"create_time":"2015-06-11T17:04:21Z","system_mtime":"2015-06-30T23:37:21Z","user_mtime":"2015-06-30T23:37:21Z","jsonmodel_type":"user","groups":[],"is_admin":true,"uri":"/users/1","agent_record":{"ref":"/agents/people/1"},"permissions":{"/repositories/1":["update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record","administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed"],"_archivesspace":["administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed","update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record"]}}} - -'} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['2205'] - content-type: [application/json] - date: ['Tue, 30 Jun 2015 23:37:21 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - User-Agent: [python-requests/2.3.0 CPython/2.7.10 Darwin/14.4.0] - X-ArchivesSpace-Session: [!!python/unicode 7c5cd6a2c5b79c789f5125e09e58c287fddb81106f3bfbb5e33cda8b92d2d86e] - method: GET - uri: http://localhost:8089/repositories/2/search?q=primary_type%3Aresource+AND+title%3ASome&page=1 - response: - body: {string: !!python/unicode '{"first_page":1,"last_page":1,"this_page":1,"offset_first":1,"offset_last":1,"total_hits":1,"results":[{"id":"/repositories/2/resources/2","title":"Some - other fonds","primary_type":"resource","types":["resource"],"json":"{\"lock_version\":0,\"title\":\"Some - other fonds\",\"publish\":false,\"restrictions\":false,\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-06-30T23:17:57Z\",\"system_mtime\":\"2015-06-30T23:17:57Z\",\"user_mtime\":\"2015-06-30T23:17:57Z\",\"suppressed\":false,\"id_0\":\"F2\",\"level\":\"fonds\",\"jsonmodel_type\":\"resource\",\"external_ids\":[],\"subjects\":[],\"linked_events\":[],\"extents\":[{\"lock_version\":0,\"number\":\"1\",\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-06-30T23:17:57Z\",\"system_mtime\":\"2015-06-30T23:17:57Z\",\"user_mtime\":\"2015-06-30T23:17:57Z\",\"portion\":\"whole\",\"extent_type\":\"cassettes\",\"jsonmodel_type\":\"extent\"}],\"dates\":[{\"lock_version\":0,\"begin\":\"2015-06-29\",\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-06-30T23:17:57Z\",\"system_mtime\":\"2015-06-30T23:17:57Z\",\"user_mtime\":\"2015-06-30T23:17:57Z\",\"date_type\":\"bulk\",\"label\":\"creation\",\"jsonmodel_type\":\"date\"}],\"external_documents\":[],\"rights_statements\":[],\"linked_agents\":[],\"instances\":[],\"deaccessions\":[],\"related_accessions\":[],\"notes\":[],\"uri\":\"/repositories/2/resources/2\",\"repository\":{\"ref\":\"/repositories/2\"},\"tree\":{\"ref\":\"/repositories/2/resources/2/tree\"}}","suppressed":false,"publish":false,"system_generated":false,"repository":"/repositories/2","created_by":"admin","last_modified_by":"admin","user_mtime":"2015-06-30T23:17:57Z","system_mtime":"2015-06-30T23:17:57Z","create_time":"2015-06-30T23:17:57Z","level":"fonds","identifier":"F2","restrictions":"false","four_part_id":"F2","uri":"/repositories/2/resources/2","jsonmodel_type":"resource"}],"facets":{"facet_queries":{},"facet_fields":{},"facet_dates":{},"facet_ranges":{}}} - -'} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['2030'] - content-type: [application/json] - date: ['Tue, 30 Jun 2015 23:37:21 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -version: 1 diff --git a/tests/fixtures/test_find_component_parent.yaml b/tests/fixtures/test_find_component_parent.yaml deleted file mode 100644 index eb12b65..0000000 --- a/tests/fixtures/test_find_component_parent.yaml +++ /dev/null @@ -1,68 +0,0 @@ -interactions: -- request: - body: password=admin - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Content-Length: ['14'] - Content-Type: [application/x-www-form-urlencoded] - User-Agent: [python-requests/2.3.0 CPython/2.7.10 Darwin/14.4.0] - method: POST - uri: http://localhost:8089/users/admin/login - response: - body: {string: !!python/unicode '{"session":"c3c62cbd26ffe5bd1fa3457fac5f22cf1edfe7028f08aba9dec53d3ba277b14f","user":{"lock_version":15,"username":"admin","name":"Administrator","is_system_user":true,"create_time":"2015-06-11T17:04:21Z","system_mtime":"2015-06-30T23:26:43Z","user_mtime":"2015-06-30T23:26:43Z","jsonmodel_type":"user","groups":[],"is_admin":true,"uri":"/users/1","agent_record":{"ref":"/agents/people/1"},"permissions":{"/repositories/1":["update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record","administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed"],"_archivesspace":["administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed","update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record"]}}} - -'} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['2205'] - content-type: [application/json] - date: ['Tue, 30 Jun 2015 23:26:43 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - User-Agent: [python-requests/2.3.0 CPython/2.7.10 Darwin/14.4.0] - X-ArchivesSpace-Session: [!!python/unicode c3c62cbd26ffe5bd1fa3457fac5f22cf1edfe7028f08aba9dec53d3ba277b14f] - method: GET - uri: http://localhost:8089/repositories/2/archival_objects/3 - response: - body: {string: !!python/unicode '{"lock_version":1,"position":0,"publish":false,"ref_id":"e61c441cd04eb5731ce64de35a4339ff","component_id":"F1-1-1","title":"Test - subseries","display_string":"Test subseries","restrictions_apply":false,"created_by":"admin","last_modified_by":"admin","create_time":"2015-06-11T17:20:19Z","system_mtime":"2015-06-11T17:45:27Z","user_mtime":"2015-06-11T17:45:27Z","suppressed":false,"level":"subseries","jsonmodel_type":"archival_object","external_ids":[],"subjects":[],"linked_events":[],"extents":[],"dates":[],"external_documents":[],"rights_statements":[],"linked_agents":[],"instances":[],"notes":[],"uri":"/repositories/2/archival_objects/3","repository":{"ref":"/repositories/2"},"resource":{"ref":"/repositories/2/resources/1"},"parent":{"ref":"/repositories/2/archival_objects/1"},"has_unpublished_ancestor":true} - -'} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['819'] - content-type: [application/json] - date: ['Tue, 30 Jun 2015 23:26:43 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - User-Agent: [python-requests/2.3.0 CPython/2.7.10 Darwin/14.4.0] - X-ArchivesSpace-Session: [!!python/unicode c3c62cbd26ffe5bd1fa3457fac5f22cf1edfe7028f08aba9dec53d3ba277b14f] - method: GET - uri: http://localhost:8089/repositories/2/archival_objects/1 - response: - body: {string: !!python/unicode '{"lock_version":1,"position":0,"publish":false,"ref_id":"72aa597a3d4078c3f61f6000ac068f38","component_id":"F1-1","title":"Test - series","display_string":"Test series","restrictions_apply":false,"created_by":"admin","last_modified_by":"admin","create_time":"2015-06-11T17:14:48Z","system_mtime":"2015-06-11T17:45:18Z","user_mtime":"2015-06-11T17:45:18Z","suppressed":false,"level":"series","jsonmodel_type":"archival_object","external_ids":[],"subjects":[],"linked_events":[],"extents":[],"dates":[],"external_documents":[],"rights_statements":[],"linked_agents":[],"instances":[],"notes":[],"uri":"/repositories/2/archival_objects/1","repository":{"ref":"/repositories/2"},"resource":{"ref":"/repositories/2/resources/1"},"has_unpublished_ancestor":true} - -'} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['754'] - content-type: [application/json] - date: ['Tue, 30 Jun 2015 23:26:43 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -version: 1 diff --git a/tests/fixtures/test_find_resource_children.yaml b/tests/fixtures/test_find_resource_children.yaml deleted file mode 100644 index e16f6ed..0000000 --- a/tests/fixtures/test_find_resource_children.yaml +++ /dev/null @@ -1,158 +0,0 @@ -interactions: -- request: - body: password=admin - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Content-Length: ['14'] - Content-Type: [application/x-www-form-urlencoded] - User-Agent: [python-requests/2.3.0 CPython/2.7.10 Darwin/14.4.0] - method: POST - uri: http://localhost:8089/users/admin/login - response: - body: {string: !!python/unicode '{"session":"d48859aa93b3c881d4d688d6feb0841f852831e7140079fb55bf6726718cfa57","user":{"lock_version":17,"username":"admin","name":"Administrator","is_system_user":true,"create_time":"2015-06-11T17:04:21Z","system_mtime":"2015-06-30T23:35:06Z","user_mtime":"2015-06-30T23:35:06Z","jsonmodel_type":"user","groups":[],"is_admin":true,"uri":"/users/1","agent_record":{"ref":"/agents/people/1"},"permissions":{"/repositories/1":["update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record","administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed"],"_archivesspace":["administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed","update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record"]}}} - -'} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['2205'] - content-type: [application/json] - date: ['Tue, 30 Jun 2015 23:35:06 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - User-Agent: [python-requests/2.3.0 CPython/2.7.10 Darwin/14.4.0] - X-ArchivesSpace-Session: [!!python/unicode d48859aa93b3c881d4d688d6feb0841f852831e7140079fb55bf6726718cfa57] - method: GET - uri: http://localhost:8089/repositories/2/resources/1/tree - response: - body: {string: !!python/unicode '{"title":"Test fonds","id":1,"node_type":"resource","publish":false,"suppressed":false,"children":[{"title":"Test - series","id":1,"record_uri":"/repositories/2/archival_objects/1","publish":false,"suppressed":false,"node_type":"archival_object","level":"series","has_children":true,"children":[{"title":"Test - subseries","id":3,"record_uri":"/repositories/2/archival_objects/3","publish":false,"suppressed":false,"node_type":"archival_object","level":"subseries","has_children":true,"children":[{"title":"Test - file","id":4,"record_uri":"/repositories/2/archival_objects/4","publish":false,"suppressed":false,"node_type":"archival_object","level":"file","has_children":false,"children":[],"instance_types":[],"containers":[]}],"instance_types":[],"containers":[]}],"instance_types":[],"containers":[]},{"title":"Test - series 2","id":2,"record_uri":"/repositories/2/archival_objects/2","publish":false,"suppressed":false,"node_type":"archival_object","level":"series","has_children":false,"children":[],"instance_types":[],"containers":[]}],"record_uri":"/repositories/2/resources/1","level":"fonds","jsonmodel_type":"resource_tree","instance_types":[],"containers":[]} - -'} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['1165'] - content-type: [application/json] - date: ['Tue, 30 Jun 2015 23:35:06 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - User-Agent: [python-requests/2.3.0 CPython/2.7.10 Darwin/14.4.0] - X-ArchivesSpace-Session: [!!python/unicode d48859aa93b3c881d4d688d6feb0841f852831e7140079fb55bf6726718cfa57] - method: GET - uri: http://localhost:8089/repositories/2/resources/1 - response: - body: {string: !!python/unicode '{"lock_version":0,"title":"Test fonds","publish":false,"restrictions":false,"created_by":"admin","last_modified_by":"admin","create_time":"2015-06-11T17:08:42Z","system_mtime":"2015-06-11T17:08:42Z","user_mtime":"2015-06-11T17:08:42Z","suppressed":false,"id_0":"F1","language":"eng","level":"fonds","jsonmodel_type":"resource","external_ids":[],"subjects":[],"linked_events":[],"extents":[{"lock_version":0,"number":"1","created_by":"admin","last_modified_by":"admin","create_time":"2015-06-11T17:08:42Z","system_mtime":"2015-06-11T17:08:42Z","user_mtime":"2015-06-11T17:08:42Z","portion":"whole","extent_type":"cassettes","jsonmodel_type":"extent"}],"dates":[{"lock_version":0,"begin":"2015-01-01","created_by":"admin","last_modified_by":"admin","create_time":"2015-06-11T17:08:42Z","system_mtime":"2015-06-11T17:08:42Z","user_mtime":"2015-06-11T17:08:42Z","date_type":"single","label":"creation","jsonmodel_type":"date"}],"external_documents":[],"rights_statements":[],"linked_agents":[],"instances":[],"deaccessions":[],"related_accessions":[],"notes":[],"uri":"/repositories/2/resources/1","repository":{"ref":"/repositories/2"},"tree":{"ref":"/repositories/2/resources/1/tree"}} - -'} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['1184'] - content-type: [application/json] - date: ['Tue, 30 Jun 2015 23:35:06 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - User-Agent: [python-requests/2.3.0 CPython/2.7.10 Darwin/14.4.0] - X-ArchivesSpace-Session: [!!python/unicode d48859aa93b3c881d4d688d6feb0841f852831e7140079fb55bf6726718cfa57] - method: GET - uri: http://localhost:8089/repositories/2/archival_objects/1 - response: - body: {string: !!python/unicode '{"lock_version":1,"position":0,"publish":false,"ref_id":"72aa597a3d4078c3f61f6000ac068f38","component_id":"F1-1","title":"Test - series","display_string":"Test series","restrictions_apply":false,"created_by":"admin","last_modified_by":"admin","create_time":"2015-06-11T17:14:48Z","system_mtime":"2015-06-11T17:45:18Z","user_mtime":"2015-06-11T17:45:18Z","suppressed":false,"level":"series","jsonmodel_type":"archival_object","external_ids":[],"subjects":[],"linked_events":[],"extents":[],"dates":[],"external_documents":[],"rights_statements":[],"linked_agents":[],"instances":[],"notes":[],"uri":"/repositories/2/archival_objects/1","repository":{"ref":"/repositories/2"},"resource":{"ref":"/repositories/2/resources/1"},"has_unpublished_ancestor":true} - -'} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['754'] - content-type: [application/json] - date: ['Tue, 30 Jun 2015 23:35:06 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - User-Agent: [python-requests/2.3.0 CPython/2.7.10 Darwin/14.4.0] - X-ArchivesSpace-Session: [!!python/unicode d48859aa93b3c881d4d688d6feb0841f852831e7140079fb55bf6726718cfa57] - method: GET - uri: http://localhost:8089/repositories/2/archival_objects/3 - response: - body: {string: !!python/unicode '{"lock_version":1,"position":0,"publish":false,"ref_id":"e61c441cd04eb5731ce64de35a4339ff","component_id":"F1-1-1","title":"Test - subseries","display_string":"Test subseries","restrictions_apply":false,"created_by":"admin","last_modified_by":"admin","create_time":"2015-06-11T17:20:19Z","system_mtime":"2015-06-11T17:45:27Z","user_mtime":"2015-06-11T17:45:27Z","suppressed":false,"level":"subseries","jsonmodel_type":"archival_object","external_ids":[],"subjects":[],"linked_events":[],"extents":[],"dates":[],"external_documents":[],"rights_statements":[],"linked_agents":[],"instances":[],"notes":[],"uri":"/repositories/2/archival_objects/3","repository":{"ref":"/repositories/2"},"resource":{"ref":"/repositories/2/resources/1"},"parent":{"ref":"/repositories/2/archival_objects/1"},"has_unpublished_ancestor":true} - -'} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['819'] - content-type: [application/json] - date: ['Tue, 30 Jun 2015 23:35:06 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - User-Agent: [python-requests/2.3.0 CPython/2.7.10 Darwin/14.4.0] - X-ArchivesSpace-Session: [!!python/unicode d48859aa93b3c881d4d688d6feb0841f852831e7140079fb55bf6726718cfa57] - method: GET - uri: http://localhost:8089/repositories/2/archival_objects/4 - response: - body: {string: !!python/unicode '{"lock_version":1,"position":0,"publish":false,"ref_id":"8429037b0f599a1efcca06b9b813700a","component_id":"F1-1-1-1","title":"Test - file","display_string":"Test file","restrictions_apply":false,"created_by":"admin","last_modified_by":"admin","create_time":"2015-06-11T17:20:30Z","system_mtime":"2015-06-11T17:45:40Z","user_mtime":"2015-06-11T17:45:40Z","suppressed":false,"level":"file","jsonmodel_type":"archival_object","external_ids":[],"subjects":[],"linked_events":[],"extents":[],"dates":[],"external_documents":[],"rights_statements":[],"linked_agents":[],"instances":[],"notes":[],"uri":"/repositories/2/archival_objects/4","repository":{"ref":"/repositories/2"},"resource":{"ref":"/repositories/2/resources/1"},"parent":{"ref":"/repositories/2/archival_objects/3"},"has_unpublished_ancestor":true} - -'} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['806'] - content-type: [application/json] - date: ['Tue, 30 Jun 2015 23:35:06 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - User-Agent: [python-requests/2.3.0 CPython/2.7.10 Darwin/14.4.0] - X-ArchivesSpace-Session: [!!python/unicode d48859aa93b3c881d4d688d6feb0841f852831e7140079fb55bf6726718cfa57] - method: GET - uri: http://localhost:8089/repositories/2/archival_objects/2 - response: - body: {string: !!python/unicode '{"lock_version":1,"position":1,"publish":false,"ref_id":"2d6194e7945563b58be69b5a70887239","component_id":"F1-2","title":"Test - series 2","display_string":"Test series 2","restrictions_apply":false,"created_by":"admin","last_modified_by":"admin","create_time":"2015-06-11T17:15:03Z","system_mtime":"2015-06-11T17:46:12Z","user_mtime":"2015-06-11T17:46:12Z","suppressed":false,"level":"series","jsonmodel_type":"archival_object","external_ids":[],"subjects":[],"linked_events":[],"extents":[],"dates":[],"external_documents":[],"rights_statements":[],"linked_agents":[],"instances":[],"notes":[],"uri":"/repositories/2/archival_objects/2","repository":{"ref":"/repositories/2"},"resource":{"ref":"/repositories/2/resources/1"},"has_unpublished_ancestor":true} - -'} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['758'] - content-type: [application/json] - date: ['Tue, 30 Jun 2015 23:35:07 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -version: 1 diff --git a/tests/fixtures/test_find_resource_children_at_max_recursion_level.yaml b/tests/fixtures/test_find_resource_children_at_max_recursion_level.yaml deleted file mode 100644 index 0ddd56a..0000000 --- a/tests/fixtures/test_find_resource_children_at_max_recursion_level.yaml +++ /dev/null @@ -1,83 +0,0 @@ -interactions: -- request: - body: !!binary | - cGFzc3dvcmQ9YWRtaW4mZXhwaXJpbmc9RmFsc2U= - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['29'] - Content-Type: [application/x-www-form-urlencoded] - User-Agent: [python-requests/2.8.1] - method: POST - uri: http://localhost:8089/users/admin/login - response: - body: {string: '{"session":"bf92956d5135eca4ad3d6b6418d96146a1182054c466bf81eeca0a8daef37931","user":{"lock_version":791,"username":"admin","name":"Administrator","is_system_user":true,"create_time":"2015-06-11T17:04:21Z","system_mtime":"2015-12-05T00:03:50Z","user_mtime":"2015-12-05T00:03:50Z","jsonmodel_type":"user","groups":[],"is_admin":true,"uri":"/users/1","agent_record":{"ref":"/agents/people/1"},"permissions":{"/repositories/1":["update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record","administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed"],"_archivesspace":["administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed","update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record"]}}} - -'} - headers: - Cache-Control: ['private, must-revalidate, max-age=0'] - Content-Length: ['2206'] - Content-Type: [application/json] - Date: ['Sat, 05 Dec 2015 00:03:49 GMT'] - Server: [Jetty(8.1.5.v20120716)] - X-Content-Type-Options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.8.1] - X-ArchivesSpace-Session: [bf92956d5135eca4ad3d6b6418d96146a1182054c466bf81eeca0a8daef37931] - method: GET - uri: http://localhost:8089/repositories/2/resources/1/tree - response: - body: {string: '{"title":"Test fonds","id":1,"node_type":"resource","publish":false,"suppressed":false,"children":[{"title":"Test - series, 1950 - 1972","id":1,"record_uri":"/repositories/2/archival_objects/1","publish":false,"suppressed":false,"node_type":"archival_object","level":"series","has_children":true,"children":[{"title":"Test - edited subseries, November, 2014 to November, 2015","id":3,"record_uri":"/repositories/2/archival_objects/3","publish":false,"suppressed":false,"node_type":"archival_object","level":"subseries","has_children":true,"children":[{"title":"Test - file","id":4,"record_uri":"/repositories/2/archival_objects/4","publish":false,"suppressed":false,"node_type":"archival_object","level":"file","has_children":false,"children":[],"instance_types":[],"containers":[]}],"instance_types":[],"containers":[]},{"title":"New - new new child","id":10,"record_uri":"/repositories/2/archival_objects/10","publish":false,"suppressed":false,"node_type":"archival_object","level":"series","has_children":false,"children":[],"instance_types":[],"containers":[]}],"instance_types":[],"containers":[]},{"title":"Test - series 2","id":2,"record_uri":"/repositories/2/archival_objects/2","publish":false,"suppressed":false,"node_type":"archival_object","level":"series","has_children":false,"children":[],"instance_types":[],"containers":[]},{"title":"Test - new child","id":13,"record_uri":"/repositories/2/archival_objects/13","publish":false,"suppressed":false,"node_type":"archival_object","level":"series","has_children":false,"children":[],"instance_types":[],"containers":[]},{"title":"Test - new child 2","id":14,"record_uri":"/repositories/2/archival_objects/14","publish":false,"suppressed":false,"node_type":"archival_object","level":"item","has_children":false,"children":[],"instance_types":[],"containers":[]},{"title":"Test - new child 3","id":16,"record_uri":"/repositories/2/archival_objects/16","publish":false,"suppressed":false,"node_type":"archival_object","level":"class","has_children":false,"children":[],"instance_types":[],"containers":[]},{"title":"New - child with note","id":17,"record_uri":"/repositories/2/archival_objects/17","publish":false,"suppressed":false,"node_type":"archival_object","level":"class","has_children":false,"children":[],"instance_types":[],"containers":[]},{"title":"New - child final","id":18,"record_uri":"/repositories/2/archival_objects/18","publish":false,"suppressed":false,"node_type":"archival_object","level":null,"has_children":false,"children":[],"instance_types":[],"containers":[]},{"title":"Child - with no note","id":19,"record_uri":"/repositories/2/archival_objects/19","publish":false,"suppressed":false,"node_type":"archival_object","level":"fonds","has_children":false,"children":[],"instance_types":[],"containers":[]},{"title":"Child - with no note","id":20,"record_uri":"/repositories/2/archival_objects/20","publish":false,"suppressed":false,"node_type":"archival_object","level":"fonds","has_children":false,"children":[],"instance_types":[],"containers":[]}],"record_uri":"/repositories/2/resources/1","level":"fonds","jsonmodel_type":"resource_tree","instance_types":[],"containers":[]} - -'} - headers: - Cache-Control: ['private, must-revalidate, max-age=0'] - Content-Length: ['3142'] - Content-Type: [application/json] - Date: ['Sat, 05 Dec 2015 00:03:50 GMT'] - Server: [Jetty(8.1.5.v20120716)] - X-Content-Type-Options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.8.1] - X-ArchivesSpace-Session: [bf92956d5135eca4ad3d6b6418d96146a1182054c466bf81eeca0a8daef37931] - method: GET - uri: http://localhost:8089/repositories/2/resources/1 - response: - body: {string: '{"lock_version":11,"title":"Test fonds","publish":false,"restrictions":false,"created_by":"admin","last_modified_by":"admin","create_time":"2015-06-11T17:08:42Z","system_mtime":"2015-12-03T00:03:41Z","user_mtime":"2015-12-03T00:03:41Z","suppressed":false,"id_0":"F1","language":"eng","level":"fonds","jsonmodel_type":"resource","external_ids":[],"subjects":[],"linked_events":[],"extents":[{"lock_version":0,"number":"1","created_by":"admin","last_modified_by":"admin","create_time":"2015-12-03T00:03:42Z","system_mtime":"2015-12-03T00:03:42Z","user_mtime":"2015-12-03T00:03:42Z","portion":"whole","extent_type":"cassettes","jsonmodel_type":"extent"}],"dates":[{"lock_version":0,"begin":"2015-01-01","created_by":"admin","last_modified_by":"admin","create_time":"2015-12-03T00:03:42Z","system_mtime":"2015-12-03T00:03:42Z","user_mtime":"2015-12-03T00:03:42Z","date_type":"single","label":"creation","jsonmodel_type":"date"}],"external_documents":[],"rights_statements":[],"linked_agents":[],"instances":[],"deaccessions":[],"related_accessions":[{"ref":"/repositories/2/accessions/1"}],"notes":[{"content":["Singlepart - note"],"type":"physdesc","jsonmodel_type":"note_singlepart","persistent_id":"cdc013c483de98b8a1762302faf8fd32","publish":true}],"uri":"/repositories/2/resources/1","repository":{"ref":"/repositories/2"},"tree":{"ref":"/repositories/2/resources/1/tree"}} - -'} - headers: - Cache-Control: ['private, must-revalidate, max-age=0'] - Content-Length: ['1373'] - Content-Type: [application/json] - Date: ['Sat, 05 Dec 2015 00:03:50 GMT'] - Server: [Jetty(8.1.5.v20120716)] - X-Content-Type-Options: [nosniff] - status: {code: 200, message: OK} -version: 1 diff --git a/tests/fixtures/test_find_resource_children_recursion.yaml b/tests/fixtures/test_find_resource_children_recursion.yaml deleted file mode 100644 index 7c2607d..0000000 --- a/tests/fixtures/test_find_resource_children_recursion.yaml +++ /dev/null @@ -1,160 +0,0 @@ -interactions: -- request: - body: password=admin - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Content-Length: ['14'] - Content-Type: [application/x-www-form-urlencoded] - User-Agent: [python-requests/2.3.0 CPython/2.7.10 Darwin/14.4.0] - method: POST - uri: http://localhost:8089/users/admin/login - response: - body: {string: !!python/unicode '{"session":"2f380c9b7b2d173d8409063c2ccd16f75990706a4844345fddbc7b9aa6de83f0","user":{"lock_version":19,"username":"admin","name":"Administrator","is_system_user":true,"create_time":"2015-06-11T17:04:21Z","system_mtime":"2015-06-30T23:35:33Z","user_mtime":"2015-06-30T23:35:33Z","jsonmodel_type":"user","groups":[],"is_admin":true,"uri":"/users/1","agent_record":{"ref":"/agents/people/1"},"permissions":{"/repositories/1":["update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record","administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed"],"_archivesspace":["administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed","update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record"]}}} - -'} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['2205'] - content-type: [application/json] - date: ['Tue, 30 Jun 2015 23:35:33 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - User-Agent: [python-requests/2.3.0 CPython/2.7.10 Darwin/14.4.0] - X-ArchivesSpace-Session: [!!python/unicode 2f380c9b7b2d173d8409063c2ccd16f75990706a4844345fddbc7b9aa6de83f0] - method: GET - uri: http://localhost:8089/repositories/2/resources/1/tree - response: - body: {string: !!python/unicode '{"title":"Test fonds","id":1,"node_type":"resource","publish":false,"suppressed":false,"children":[{"title":"Test - series","id":1,"record_uri":"/repositories/2/archival_objects/1","publish":false,"suppressed":false,"node_type":"archival_object","level":"series","has_children":true,"children":[{"title":"Test - subseries","id":3,"record_uri":"/repositories/2/archival_objects/3","publish":false,"suppressed":false,"node_type":"archival_object","level":"subseries","has_children":true,"children":[{"title":"Test - file","id":4,"record_uri":"/repositories/2/archival_objects/4","publish":false,"suppressed":false,"node_type":"archival_object","level":"file","has_children":false,"children":[],"instance_types":[],"containers":[]}],"instance_types":[],"containers":[]}],"instance_types":[],"containers":[]},{"title":"Test - series 2","id":2,"record_uri":"/repositories/2/archival_objects/2","publish":false,"suppressed":false,"node_type":"archival_object","level":"series","has_children":false,"children":[],"instance_types":[],"containers":[]}],"record_uri":"/repositories/2/resources/1","level":"fonds","jsonmodel_type":"resource_tree","instance_types":[],"containers":[]} - -'} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['1165'] - content-type: [application/json] - date: ['Tue, 30 Jun 2015 23:35:33 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - User-Agent: [python-requests/2.3.0 CPython/2.7.10 Darwin/14.4.0] - X-ArchivesSpace-Session: [!!python/unicode 2f380c9b7b2d173d8409063c2ccd16f75990706a4844345fddbc7b9aa6de83f0] - method: GET - uri: http://localhost:8089/repositories/2/resources/1 - response: - body: {string: !!python/unicode '{"lock_version":0,"title":"Test fonds","publish":false,"restrictions":false,"created_by":"admin","last_modified_by":"admin","create_time":"2015-06-11T17:08:42Z","system_mtime":"2015-06-11T17:08:42Z","user_mtime":"2015-06-11T17:08:42Z","suppressed":false,"id_0":"F1","language":"eng","level":"fonds","jsonmodel_type":"resource","external_ids":[],"subjects":[],"linked_events":[],"extents":[{"lock_version":0,"number":"1","created_by":"admin","last_modified_by":"admin","create_time":"2015-06-11T17:08:42Z","system_mtime":"2015-06-11T17:08:42Z","user_mtime":"2015-06-11T17:08:42Z","portion":"whole","extent_type":"cassettes","jsonmodel_type":"extent"}],"dates":[{"lock_version":0,"begin":"2015-01-01","created_by":"admin","last_modified_by":"admin","create_time":"2015-06-11T17:08:42Z","system_mtime":"2015-06-11T17:08:42Z","user_mtime":"2015-06-11T17:08:42Z","date_type":"single","label":"creation","jsonmodel_type":"date"}],"external_documents":[],"rights_statements":[],"linked_agents":[],"instances":[],"deaccessions":[],"related_accessions":[],"notes":[],"uri":"/repositories/2/resources/1","repository":{"ref":"/repositories/2"},"tree":{"ref":"/repositories/2/resources/1/tree"}} - -'} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['1184'] - content-type: [application/json] - date: ['Tue, 30 Jun 2015 23:35:33 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - User-Agent: [python-requests/2.3.0 CPython/2.7.10 Darwin/14.4.0] - X-ArchivesSpace-Session: [!!python/unicode 2f380c9b7b2d173d8409063c2ccd16f75990706a4844345fddbc7b9aa6de83f0] - method: GET - uri: http://localhost:8089/repositories/2/resources/1/tree - response: - body: {string: !!python/unicode '{"title":"Test fonds","id":1,"node_type":"resource","publish":false,"suppressed":false,"children":[{"title":"Test - series","id":1,"record_uri":"/repositories/2/archival_objects/1","publish":false,"suppressed":false,"node_type":"archival_object","level":"series","has_children":true,"children":[{"title":"Test - subseries","id":3,"record_uri":"/repositories/2/archival_objects/3","publish":false,"suppressed":false,"node_type":"archival_object","level":"subseries","has_children":true,"children":[{"title":"Test - file","id":4,"record_uri":"/repositories/2/archival_objects/4","publish":false,"suppressed":false,"node_type":"archival_object","level":"file","has_children":false,"children":[],"instance_types":[],"containers":[]}],"instance_types":[],"containers":[]}],"instance_types":[],"containers":[]},{"title":"Test - series 2","id":2,"record_uri":"/repositories/2/archival_objects/2","publish":false,"suppressed":false,"node_type":"archival_object","level":"series","has_children":false,"children":[],"instance_types":[],"containers":[]}],"record_uri":"/repositories/2/resources/1","level":"fonds","jsonmodel_type":"resource_tree","instance_types":[],"containers":[]} - -'} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['1165'] - content-type: [application/json] - date: ['Tue, 30 Jun 2015 23:35:33 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - User-Agent: [python-requests/2.3.0 CPython/2.7.10 Darwin/14.4.0] - X-ArchivesSpace-Session: [!!python/unicode 2f380c9b7b2d173d8409063c2ccd16f75990706a4844345fddbc7b9aa6de83f0] - method: GET - uri: http://localhost:8089/repositories/2/resources/1 - response: - body: {string: !!python/unicode '{"lock_version":0,"title":"Test fonds","publish":false,"restrictions":false,"created_by":"admin","last_modified_by":"admin","create_time":"2015-06-11T17:08:42Z","system_mtime":"2015-06-11T17:08:42Z","user_mtime":"2015-06-11T17:08:42Z","suppressed":false,"id_0":"F1","language":"eng","level":"fonds","jsonmodel_type":"resource","external_ids":[],"subjects":[],"linked_events":[],"extents":[{"lock_version":0,"number":"1","created_by":"admin","last_modified_by":"admin","create_time":"2015-06-11T17:08:42Z","system_mtime":"2015-06-11T17:08:42Z","user_mtime":"2015-06-11T17:08:42Z","portion":"whole","extent_type":"cassettes","jsonmodel_type":"extent"}],"dates":[{"lock_version":0,"begin":"2015-01-01","created_by":"admin","last_modified_by":"admin","create_time":"2015-06-11T17:08:42Z","system_mtime":"2015-06-11T17:08:42Z","user_mtime":"2015-06-11T17:08:42Z","date_type":"single","label":"creation","jsonmodel_type":"date"}],"external_documents":[],"rights_statements":[],"linked_agents":[],"instances":[],"deaccessions":[],"related_accessions":[],"notes":[],"uri":"/repositories/2/resources/1","repository":{"ref":"/repositories/2"},"tree":{"ref":"/repositories/2/resources/1/tree"}} - -'} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['1184'] - content-type: [application/json] - date: ['Tue, 30 Jun 2015 23:35:33 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - User-Agent: [python-requests/2.3.0 CPython/2.7.10 Darwin/14.4.0] - X-ArchivesSpace-Session: [!!python/unicode 2f380c9b7b2d173d8409063c2ccd16f75990706a4844345fddbc7b9aa6de83f0] - method: GET - uri: http://localhost:8089/repositories/2/archival_objects/1 - response: - body: {string: !!python/unicode '{"lock_version":1,"position":0,"publish":false,"ref_id":"72aa597a3d4078c3f61f6000ac068f38","component_id":"F1-1","title":"Test - series","display_string":"Test series","restrictions_apply":false,"created_by":"admin","last_modified_by":"admin","create_time":"2015-06-11T17:14:48Z","system_mtime":"2015-06-11T17:45:18Z","user_mtime":"2015-06-11T17:45:18Z","suppressed":false,"level":"series","jsonmodel_type":"archival_object","external_ids":[],"subjects":[],"linked_events":[],"extents":[],"dates":[],"external_documents":[],"rights_statements":[],"linked_agents":[],"instances":[],"notes":[],"uri":"/repositories/2/archival_objects/1","repository":{"ref":"/repositories/2"},"resource":{"ref":"/repositories/2/resources/1"},"has_unpublished_ancestor":true} - -'} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['754'] - content-type: [application/json] - date: ['Tue, 30 Jun 2015 23:35:33 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - User-Agent: [python-requests/2.3.0 CPython/2.7.10 Darwin/14.4.0] - X-ArchivesSpace-Session: [!!python/unicode 2f380c9b7b2d173d8409063c2ccd16f75990706a4844345fddbc7b9aa6de83f0] - method: GET - uri: http://localhost:8089/repositories/2/archival_objects/2 - response: - body: {string: !!python/unicode '{"lock_version":1,"position":1,"publish":false,"ref_id":"2d6194e7945563b58be69b5a70887239","component_id":"F1-2","title":"Test - series 2","display_string":"Test series 2","restrictions_apply":false,"created_by":"admin","last_modified_by":"admin","create_time":"2015-06-11T17:15:03Z","system_mtime":"2015-06-11T17:46:12Z","user_mtime":"2015-06-11T17:46:12Z","suppressed":false,"level":"series","jsonmodel_type":"archival_object","external_ids":[],"subjects":[],"linked_events":[],"extents":[],"dates":[],"external_documents":[],"rights_statements":[],"linked_agents":[],"instances":[],"notes":[],"uri":"/repositories/2/archival_objects/2","repository":{"ref":"/repositories/2"},"resource":{"ref":"/repositories/2/resources/1"},"has_unpublished_ancestor":true} - -'} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['758'] - content-type: [application/json] - date: ['Tue, 30 Jun 2015 23:35:33 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -version: 1 diff --git a/tests/fixtures/test_find_resource_component_children_at_max_recursion_level.yaml b/tests/fixtures/test_find_resource_component_children_at_max_recursion_level.yaml deleted file mode 100644 index fe78d92..0000000 --- a/tests/fixtures/test_find_resource_component_children_at_max_recursion_level.yaml +++ /dev/null @@ -1,77 +0,0 @@ -interactions: -- request: - body: !!binary | - cGFzc3dvcmQ9YWRtaW4mZXhwaXJpbmc9RmFsc2U= - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['29'] - Content-Type: [application/x-www-form-urlencoded] - User-Agent: [python-requests/2.8.1] - method: POST - uri: http://localhost:8089/users/admin/login - response: - body: {string: '{"session":"7ed82cd6151564b78f0e2a9474c513d5a5deb813ea938e7487048cd5cb0756f6","user":{"lock_version":792,"username":"admin","name":"Administrator","is_system_user":true,"create_time":"2015-06-11T17:04:21Z","system_mtime":"2015-12-05T00:03:50Z","user_mtime":"2015-12-05T00:03:50Z","jsonmodel_type":"user","groups":[],"is_admin":true,"uri":"/users/1","agent_record":{"ref":"/agents/people/1"},"permissions":{"/repositories/1":["update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record","administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed"],"_archivesspace":["administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed","update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record"]}}} - -'} - headers: - Cache-Control: ['private, must-revalidate, max-age=0'] - Content-Length: ['2206'] - Content-Type: [application/json] - Date: ['Sat, 05 Dec 2015 00:03:50 GMT'] - Server: [Jetty(8.1.5.v20120716)] - X-Content-Type-Options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.8.1] - X-ArchivesSpace-Session: [7ed82cd6151564b78f0e2a9474c513d5a5deb813ea938e7487048cd5cb0756f6] - method: GET - uri: http://localhost:8089/repositories/2/archival_objects/1 - response: - body: {string: '{"lock_version":3,"position":0,"publish":false,"ref_id":"72aa597a3d4078c3f61f6000ac068f38","component_id":"F1-1","title":"Test - series","display_string":"Test series, 1950 - 1972","restrictions_apply":false,"created_by":"admin","last_modified_by":"admin","create_time":"2015-06-11T17:14:48Z","system_mtime":"2015-12-04T00:59:35Z","user_mtime":"2015-12-04T00:59:35Z","suppressed":false,"level":"series","jsonmodel_type":"archival_object","external_ids":[],"subjects":[],"linked_events":[],"extents":[],"dates":[{"lock_version":0,"expression":"1950 - - 1972","begin":"1950-12-03","end":"1972-12-03","created_by":"admin","last_modified_by":"admin","create_time":"2015-12-04T00:59:35Z","system_mtime":"2015-12-04T00:59:35Z","user_mtime":"2015-12-04T00:59:35Z","date_type":"range","label":"creation","jsonmodel_type":"date"}],"external_documents":[],"rights_statements":[],"linked_agents":[],"instances":[{"lock_version":0,"created_by":"admin","last_modified_by":"admin","create_time":"2015-12-04T00:59:35Z","system_mtime":"2015-12-04T00:59:35Z","user_mtime":"2015-12-04T00:59:35Z","instance_type":"digital_object","jsonmodel_type":"instance","digital_object":{"ref":"/repositories/2/digital_objects/2"}}],"notes":[],"uri":"/repositories/2/archival_objects/1","repository":{"ref":"/repositories/2"},"resource":{"ref":"/repositories/2/resources/1"},"has_unpublished_ancestor":true} - -'} - headers: - Cache-Control: ['private, must-revalidate, max-age=0'] - Content-Length: ['1373'] - Content-Type: [application/json] - Date: ['Sat, 05 Dec 2015 00:03:50 GMT'] - Server: [Jetty(8.1.5.v20120716)] - X-Content-Type-Options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.8.1] - X-ArchivesSpace-Session: [7ed82cd6151564b78f0e2a9474c513d5a5deb813ea938e7487048cd5cb0756f6] - method: GET - uri: http://localhost:8089/repositories/2/archival_objects/1/children - response: - body: {string: '[{"lock_version":10,"position":0,"publish":false,"ref_id":"e61c441cd04eb5731ce64de35a4339ff","component_id":"F1-1-1","title":"Test - edited subseries","display_string":"Test edited subseries, November, 2014 - to November, 2015","restrictions_apply":false,"created_by":"admin","last_modified_by":"admin","create_time":"2015-06-11T17:20:19Z","system_mtime":"2015-12-04T00:59:36Z","user_mtime":"2015-12-03T01:24:00Z","suppressed":false,"level":"subseries","jsonmodel_type":"archival_object","external_ids":[],"subjects":[],"linked_events":[],"extents":[],"dates":[{"lock_version":0,"expression":"November, - 2014 to November, 2015","begin":"2014-11-01","end":"2015-11-01","created_by":"admin","last_modified_by":"admin","create_time":"2015-12-03T01:24:00Z","system_mtime":"2015-12-03T01:24:00Z","user_mtime":"2015-12-03T01:24:00Z","date_type":"inclusive","label":"creation","jsonmodel_type":"date"}],"external_documents":[],"rights_statements":[],"linked_agents":[],"instances":[{"lock_version":0,"created_by":"admin","last_modified_by":"admin","create_time":"2015-12-03T01:24:00Z","system_mtime":"2015-12-03T01:24:00Z","user_mtime":"2015-12-03T01:24:00Z","instance_type":"digital_object","jsonmodel_type":"instance","digital_object":{"ref":"/repositories/2/digital_objects/7"}},{"lock_version":0,"created_by":"admin","last_modified_by":"admin","create_time":"2015-12-03T01:24:00Z","system_mtime":"2015-12-03T01:24:00Z","user_mtime":"2015-12-03T01:24:00Z","instance_type":"digital_object","jsonmodel_type":"instance","digital_object":{"ref":"/repositories/2/digital_objects/8"}}],"notes":[{"jsonmodel_type":"note_multipart","persistent_id":"063373886a2f23d03fe1a51f7c96ca8b","subnotes":[{"content":"This - is a test note","publish":true,"jsonmodel_type":"note_text"}],"type":"odd","publish":true}],"uri":"/repositories/2/archival_objects/3","repository":{"ref":"/repositories/2"},"resource":{"ref":"/repositories/2/resources/1"},"parent":{"ref":"/repositories/2/archival_objects/1"},"has_unpublished_ancestor":true},{"lock_version":0,"position":1,"ref_id":"7a273392ede0464c8509f70f053d94bf","title":"New - new new child","display_string":"New new new child","restrictions_apply":false,"created_by":"admin","last_modified_by":"admin","create_time":"2015-09-10T21:00:56Z","system_mtime":"2015-12-04T00:59:36Z","user_mtime":"2015-09-10T21:00:56Z","suppressed":false,"level":"series","jsonmodel_type":"archival_object","external_ids":[],"subjects":[],"linked_events":[],"extents":[],"dates":[],"external_documents":[],"rights_statements":[],"linked_agents":[],"instances":[],"notes":[],"uri":"/repositories/2/archival_objects/10","repository":{"ref":"/repositories/2"},"resource":{"ref":"/repositories/2/resources/1"},"parent":{"ref":"/repositories/2/archival_objects/1"},"has_unpublished_ancestor":true}] - -'} - headers: - Cache-Control: ['private, must-revalidate, max-age=0'] - Content-Length: ['2789'] - Content-Type: [application/json] - Date: ['Sat, 05 Dec 2015 00:03:50 GMT'] - Server: [Jetty(8.1.5.v20120716)] - X-Content-Type-Options: [nosniff] - status: {code: 200, message: OK} -version: 1 diff --git a/tests/fixtures/test_find_resource_id.yaml b/tests/fixtures/test_find_resource_id.yaml deleted file mode 100644 index 82753cd..0000000 --- a/tests/fixtures/test_find_resource_id.yaml +++ /dev/null @@ -1,46 +0,0 @@ -interactions: -- request: - body: password=admin - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Content-Length: ['14'] - Content-Type: [application/x-www-form-urlencoded] - User-Agent: [python-requests/2.3.0 CPython/2.7.10 Darwin/14.4.0] - method: POST - uri: http://localhost:8089/users/admin/login - response: - body: {string: !!python/unicode '{"session":"1a00ae68128363e119356d43832dc6918f681c2a8fd910cf110302af22831160","user":{"lock_version":12,"username":"admin","name":"Administrator","is_system_user":true,"create_time":"2015-06-11T17:04:21Z","system_mtime":"2015-06-30T23:21:58Z","user_mtime":"2015-06-30T23:21:58Z","jsonmodel_type":"user","groups":[],"is_admin":true,"uri":"/users/1","agent_record":{"ref":"/agents/people/1"},"permissions":{"/repositories/1":["update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record","administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed"],"_archivesspace":["administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed","update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record"]}}} - -'} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['2205'] - content-type: [application/json] - date: ['Tue, 30 Jun 2015 23:21:58 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - User-Agent: [python-requests/2.3.0 CPython/2.7.10 Darwin/14.4.0] - X-ArchivesSpace-Session: [!!python/unicode 1a00ae68128363e119356d43832dc6918f681c2a8fd910cf110302af22831160] - method: GET - uri: http://localhost:8089/repositories/2/archival_objects/3 - response: - body: {string: !!python/unicode '{"lock_version":1,"position":0,"publish":false,"ref_id":"e61c441cd04eb5731ce64de35a4339ff","component_id":"F1-1-1","title":"Test - subseries","display_string":"Test subseries","restrictions_apply":false,"created_by":"admin","last_modified_by":"admin","create_time":"2015-06-11T17:20:19Z","system_mtime":"2015-06-11T17:45:27Z","user_mtime":"2015-06-11T17:45:27Z","suppressed":false,"level":"subseries","jsonmodel_type":"archival_object","external_ids":[],"subjects":[],"linked_events":[],"extents":[],"dates":[],"external_documents":[],"rights_statements":[],"linked_agents":[],"instances":[],"notes":[],"uri":"/repositories/2/archival_objects/3","repository":{"ref":"/repositories/2"},"resource":{"ref":"/repositories/2/resources/1"},"parent":{"ref":"/repositories/2/archival_objects/1"},"has_unpublished_ancestor":true} - -'} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['819'] - content-type: [application/json] - date: ['Tue, 30 Jun 2015 23:21:58 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -version: 1 diff --git a/tests/fixtures/test_identifier_exact_match.yaml b/tests/fixtures/test_identifier_exact_match.yaml deleted file mode 100644 index ac95bdc..0000000 --- a/tests/fixtures/test_identifier_exact_match.yaml +++ /dev/null @@ -1,124 +0,0 @@ -interactions: -- request: - body: expiring=False&password=admin - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['29'] - Content-Type: [application/x-www-form-urlencoded] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-63-generic] - method: POST - uri: http://localhost:8089/users/admin/login - response: - body: {string: !!python/unicode '{"session":"5bcf9db74ea8c5d9238ee4266d9895495e929c218bf49b509f62ac0e3f22abba","user":{"lock_version":281,"username":"admin","name":"Administrator","is_system_user":true,"create_time":"2015-06-11T17:04:21Z","system_mtime":"2015-10-27T23:39:31Z","user_mtime":"2015-10-27T23:39:31Z","jsonmodel_type":"user","groups":[],"is_admin":true,"uri":"/users/1","agent_record":{"ref":"/agents/people/1"},"permissions":{"/repositories/1":["update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record","administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed"],"_archivesspace":["administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed","update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record"]}}} - -'} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['2206'] - content-type: [application/json] - date: ['Tue, 27 Oct 2015 23:39:31 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-63-generic] - X-ArchivesSpace-Session: [!!python/unicode 5bcf9db74ea8c5d9238ee4266d9895495e929c218bf49b509f62ac0e3f22abba] - method: GET - uri: http://localhost:8089/repositories/2/search?q=primary_type%3Aresource+AND+identifier%3AF1&page=1 - response: - body: {string: !!python/unicode '{"first_page":1,"last_page":1,"this_page":1,"offset_first":1,"offset_last":1,"total_hits":1,"results":[{"id":"/repositories/2/resources/1","title":"Test - fonds","primary_type":"resource","types":["resource"],"json":"{\"lock_version\":1,\"title\":\"Test - fonds\",\"publish\":false,\"restrictions\":false,\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-06-11T17:08:42Z\",\"system_mtime\":\"2015-08-12T20:24:17Z\",\"user_mtime\":\"2015-08-12T20:24:17Z\",\"suppressed\":false,\"id_0\":\"F1\",\"language\":\"eng\",\"level\":\"fonds\",\"jsonmodel_type\":\"resource\",\"external_ids\":[],\"subjects\":[],\"linked_events\":[],\"extents\":[{\"lock_version\":0,\"number\":\"1\",\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-08-12T20:24:18Z\",\"system_mtime\":\"2015-08-12T20:24:18Z\",\"user_mtime\":\"2015-08-12T20:24:18Z\",\"portion\":\"whole\",\"extent_type\":\"cassettes\",\"jsonmodel_type\":\"extent\"}],\"dates\":[{\"lock_version\":0,\"begin\":\"2015-01-01\",\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-08-12T20:24:18Z\",\"system_mtime\":\"2015-08-12T20:24:18Z\",\"user_mtime\":\"2015-08-12T20:24:18Z\",\"date_type\":\"single\",\"label\":\"creation\",\"jsonmodel_type\":\"date\"}],\"external_documents\":[],\"rights_statements\":[],\"linked_agents\":[],\"instances\":[],\"deaccessions\":[],\"related_accessions\":[{\"ref\":\"/repositories/2/accessions/1\"}],\"notes\":[],\"uri\":\"/repositories/2/resources/1\",\"repository\":{\"ref\":\"/repositories/2\"},\"tree\":{\"ref\":\"/repositories/2/resources/1/tree\"}}","suppressed":false,"publish":false,"system_generated":false,"repository":"/repositories/2","created_by":"admin","last_modified_by":"admin","user_mtime":"2015-08-12T20:24:17Z","system_mtime":"2015-08-12T20:24:17Z","create_time":"2015-06-11T17:08:42Z","level":"fonds","identifier":"F1","language":"eng","restrictions":"false","four_part_id":"F1","uri":"/repositories/2/resources/1","jsonmodel_type":"resource"}],"facets":{"facet_queries":{},"facet_fields":{},"facet_dates":{},"facet_ranges":{}}} - -'} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['2100'] - content-type: [application/json] - date: ['Tue, 27 Oct 2015 23:39:31 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-63-generic] - X-ArchivesSpace-Session: [!!python/unicode 5bcf9db74ea8c5d9238ee4266d9895495e929c218bf49b509f62ac0e3f22abba] - method: GET - uri: http://localhost:8089/repositories/2/search?q=primary_type%3Aresource+AND+identifier%3AF1&page=1 - response: - body: {string: !!python/unicode '{"first_page":1,"last_page":1,"this_page":1,"offset_first":1,"offset_last":1,"total_hits":1,"results":[{"id":"/repositories/2/resources/1","title":"Test - fonds","primary_type":"resource","types":["resource"],"json":"{\"lock_version\":1,\"title\":\"Test - fonds\",\"publish\":false,\"restrictions\":false,\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-06-11T17:08:42Z\",\"system_mtime\":\"2015-08-12T20:24:17Z\",\"user_mtime\":\"2015-08-12T20:24:17Z\",\"suppressed\":false,\"id_0\":\"F1\",\"language\":\"eng\",\"level\":\"fonds\",\"jsonmodel_type\":\"resource\",\"external_ids\":[],\"subjects\":[],\"linked_events\":[],\"extents\":[{\"lock_version\":0,\"number\":\"1\",\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-08-12T20:24:18Z\",\"system_mtime\":\"2015-08-12T20:24:18Z\",\"user_mtime\":\"2015-08-12T20:24:18Z\",\"portion\":\"whole\",\"extent_type\":\"cassettes\",\"jsonmodel_type\":\"extent\"}],\"dates\":[{\"lock_version\":0,\"begin\":\"2015-01-01\",\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-08-12T20:24:18Z\",\"system_mtime\":\"2015-08-12T20:24:18Z\",\"user_mtime\":\"2015-08-12T20:24:18Z\",\"date_type\":\"single\",\"label\":\"creation\",\"jsonmodel_type\":\"date\"}],\"external_documents\":[],\"rights_statements\":[],\"linked_agents\":[],\"instances\":[],\"deaccessions\":[],\"related_accessions\":[{\"ref\":\"/repositories/2/accessions/1\"}],\"notes\":[],\"uri\":\"/repositories/2/resources/1\",\"repository\":{\"ref\":\"/repositories/2\"},\"tree\":{\"ref\":\"/repositories/2/resources/1/tree\"}}","suppressed":false,"publish":false,"system_generated":false,"repository":"/repositories/2","created_by":"admin","last_modified_by":"admin","user_mtime":"2015-08-12T20:24:17Z","system_mtime":"2015-08-12T20:24:17Z","create_time":"2015-06-11T17:08:42Z","level":"fonds","identifier":"F1","language":"eng","restrictions":"false","four_part_id":"F1","uri":"/repositories/2/resources/1","jsonmodel_type":"resource"}],"facets":{"facet_queries":{},"facet_fields":{},"facet_dates":{},"facet_ranges":{}}} - -'} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['2100'] - content-type: [application/json] - date: ['Tue, 27 Oct 2015 23:39:31 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-63-generic] - X-ArchivesSpace-Session: [!!python/unicode 5bcf9db74ea8c5d9238ee4266d9895495e929c218bf49b509f62ac0e3f22abba] - method: GET - uri: http://localhost:8089/repositories/2/search?q=primary_type%3Aresource+AND+identifier%3AF1&page=1&page_size=30 - response: - body: {string: !!python/unicode '{"first_page":1,"last_page":1,"this_page":1,"offset_first":1,"offset_last":1,"total_hits":1,"results":[{"id":"/repositories/2/resources/1","title":"Test - fonds","primary_type":"resource","types":["resource"],"json":"{\"lock_version\":1,\"title\":\"Test - fonds\",\"publish\":false,\"restrictions\":false,\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-06-11T17:08:42Z\",\"system_mtime\":\"2015-08-12T20:24:17Z\",\"user_mtime\":\"2015-08-12T20:24:17Z\",\"suppressed\":false,\"id_0\":\"F1\",\"language\":\"eng\",\"level\":\"fonds\",\"jsonmodel_type\":\"resource\",\"external_ids\":[],\"subjects\":[],\"linked_events\":[],\"extents\":[{\"lock_version\":0,\"number\":\"1\",\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-08-12T20:24:18Z\",\"system_mtime\":\"2015-08-12T20:24:18Z\",\"user_mtime\":\"2015-08-12T20:24:18Z\",\"portion\":\"whole\",\"extent_type\":\"cassettes\",\"jsonmodel_type\":\"extent\"}],\"dates\":[{\"lock_version\":0,\"begin\":\"2015-01-01\",\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-08-12T20:24:18Z\",\"system_mtime\":\"2015-08-12T20:24:18Z\",\"user_mtime\":\"2015-08-12T20:24:18Z\",\"date_type\":\"single\",\"label\":\"creation\",\"jsonmodel_type\":\"date\"}],\"external_documents\":[],\"rights_statements\":[],\"linked_agents\":[],\"instances\":[],\"deaccessions\":[],\"related_accessions\":[{\"ref\":\"/repositories/2/accessions/1\"}],\"notes\":[],\"uri\":\"/repositories/2/resources/1\",\"repository\":{\"ref\":\"/repositories/2\"},\"tree\":{\"ref\":\"/repositories/2/resources/1/tree\"}}","suppressed":false,"publish":false,"system_generated":false,"repository":"/repositories/2","created_by":"admin","last_modified_by":"admin","user_mtime":"2015-08-12T20:24:17Z","system_mtime":"2015-08-12T20:24:17Z","create_time":"2015-06-11T17:08:42Z","level":"fonds","identifier":"F1","language":"eng","restrictions":"false","four_part_id":"F1","uri":"/repositories/2/resources/1","jsonmodel_type":"resource"}],"facets":{"facet_queries":{},"facet_fields":{},"facet_dates":{},"facet_ranges":{}}} - -'} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['2100'] - content-type: [application/json] - date: ['Tue, 27 Oct 2015 23:39:31 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-63-generic] - X-ArchivesSpace-Session: [!!python/unicode 5bcf9db74ea8c5d9238ee4266d9895495e929c218bf49b509f62ac0e3f22abba] - method: GET - uri: http://localhost:8089/repositories/2/resources/1/tree?page=1 - response: - body: {string: !!python/unicode '{"title":"Test fonds","id":1,"node_type":"resource","publish":false,"suppressed":false,"children":[{"title":"Test - series","id":1,"record_uri":"/repositories/2/archival_objects/1","publish":false,"suppressed":false,"node_type":"archival_object","level":"series","has_children":true,"children":[{"title":"Test - subseries","id":3,"record_uri":"/repositories/2/archival_objects/3","publish":false,"suppressed":false,"node_type":"archival_object","level":"subseries","has_children":true,"children":[{"title":"Test - file","id":4,"record_uri":"/repositories/2/archival_objects/4","publish":false,"suppressed":false,"node_type":"archival_object","level":"file","has_children":false,"children":[],"instance_types":[],"containers":[]}],"instance_types":[],"containers":[]},{"title":"New - new new child","id":10,"record_uri":"/repositories/2/archival_objects/10","publish":false,"suppressed":false,"node_type":"archival_object","level":"series","has_children":false,"children":[],"instance_types":[],"containers":[]}],"instance_types":[],"containers":[]},{"title":"Test - series 2","id":2,"record_uri":"/repositories/2/archival_objects/2","publish":false,"suppressed":false,"node_type":"archival_object","level":"series","has_children":false,"children":[],"instance_types":[],"containers":[]}],"record_uri":"/repositories/2/resources/1","level":"fonds","jsonmodel_type":"resource_tree","instance_types":[],"containers":[]} - -'} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['1407'] - content-type: [application/json] - date: ['Tue, 27 Oct 2015 23:39:31 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -version: 1 diff --git a/tests/fixtures/test_identifier_wildcard.yaml b/tests/fixtures/test_identifier_wildcard.yaml deleted file mode 100644 index ef24768..0000000 --- a/tests/fixtures/test_identifier_wildcard.yaml +++ /dev/null @@ -1,241 +0,0 @@ -interactions: -- request: - body: expiring=False&password=admin - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['29'] - Content-Type: [application/x-www-form-urlencoded] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-63-generic] - method: POST - uri: http://localhost:8089/users/admin/login - response: - body: {string: !!python/unicode '{"session":"b75502af2ca0fb38605e8dff31ffe026f078db9bacb6a4bedfa1339d2ef15389","user":{"lock_version":282,"username":"admin","name":"Administrator","is_system_user":true,"create_time":"2015-06-11T17:04:21Z","system_mtime":"2015-10-27T23:39:31Z","user_mtime":"2015-10-27T23:39:31Z","jsonmodel_type":"user","groups":[],"is_admin":true,"uri":"/users/1","agent_record":{"ref":"/agents/people/1"},"permissions":{"/repositories/1":["update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record","administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed"],"_archivesspace":["administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed","update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record"]}}} - -'} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['2206'] - content-type: [application/json] - date: ['Tue, 27 Oct 2015 23:39:31 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-63-generic] - X-ArchivesSpace-Session: [!!python/unicode b75502af2ca0fb38605e8dff31ffe026f078db9bacb6a4bedfa1339d2ef15389] - method: GET - uri: http://localhost:8089/repositories/2/search?q=primary_type%3Aresource+AND+identifier%3AF&page=1 - response: - body: {string: !!python/unicode '{"first_page":1,"last_page":0,"this_page":1,"offset_first":1,"offset_last":0,"total_hits":0,"results":[],"facets":{"facet_queries":{},"facet_fields":{},"facet_dates":{},"facet_ranges":{}}} - -'} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['189'] - content-type: [application/json] - date: ['Tue, 27 Oct 2015 23:39:31 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-63-generic] - X-ArchivesSpace-Session: [!!python/unicode b75502af2ca0fb38605e8dff31ffe026f078db9bacb6a4bedfa1339d2ef15389] - method: GET - uri: http://localhost:8089/repositories/2/search?q=primary_type%3Aresource+AND+identifier%3AF&page=1 - response: - body: {string: !!python/unicode '{"first_page":1,"last_page":0,"this_page":1,"offset_first":1,"offset_last":0,"total_hits":0,"results":[],"facets":{"facet_queries":{},"facet_fields":{},"facet_dates":{},"facet_ranges":{}}} - -'} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['189'] - content-type: [application/json] - date: ['Tue, 27 Oct 2015 23:39:31 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-63-generic] - X-ArchivesSpace-Session: [!!python/unicode b75502af2ca0fb38605e8dff31ffe026f078db9bacb6a4bedfa1339d2ef15389] - method: GET - uri: http://localhost:8089/repositories/2/search?q=primary_type%3Aresource+AND+identifier%3AF&page=1&page_size=30 - response: - body: {string: !!python/unicode '{"first_page":1,"last_page":0,"this_page":1,"offset_first":1,"offset_last":0,"total_hits":0,"results":[],"facets":{"facet_queries":{},"facet_fields":{},"facet_dates":{},"facet_ranges":{}}} - -'} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['189'] - content-type: [application/json] - date: ['Tue, 27 Oct 2015 23:39:31 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-63-generic] - X-ArchivesSpace-Session: [!!python/unicode b75502af2ca0fb38605e8dff31ffe026f078db9bacb6a4bedfa1339d2ef15389] - method: GET - uri: http://localhost:8089/repositories/2/search?q=primary_type%3Aresource+AND+identifier%3AF%2A&page=1 - response: - body: {string: !!python/unicode '{"first_page":1,"last_page":1,"this_page":1,"offset_first":1,"offset_last":2,"total_hits":2,"results":[{"id":"/repositories/2/resources/1","title":"Test - fonds","primary_type":"resource","types":["resource"],"json":"{\"lock_version\":1,\"title\":\"Test - fonds\",\"publish\":false,\"restrictions\":false,\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-06-11T17:08:42Z\",\"system_mtime\":\"2015-08-12T20:24:17Z\",\"user_mtime\":\"2015-08-12T20:24:17Z\",\"suppressed\":false,\"id_0\":\"F1\",\"language\":\"eng\",\"level\":\"fonds\",\"jsonmodel_type\":\"resource\",\"external_ids\":[],\"subjects\":[],\"linked_events\":[],\"extents\":[{\"lock_version\":0,\"number\":\"1\",\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-08-12T20:24:18Z\",\"system_mtime\":\"2015-08-12T20:24:18Z\",\"user_mtime\":\"2015-08-12T20:24:18Z\",\"portion\":\"whole\",\"extent_type\":\"cassettes\",\"jsonmodel_type\":\"extent\"}],\"dates\":[{\"lock_version\":0,\"begin\":\"2015-01-01\",\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-08-12T20:24:18Z\",\"system_mtime\":\"2015-08-12T20:24:18Z\",\"user_mtime\":\"2015-08-12T20:24:18Z\",\"date_type\":\"single\",\"label\":\"creation\",\"jsonmodel_type\":\"date\"}],\"external_documents\":[],\"rights_statements\":[],\"linked_agents\":[],\"instances\":[],\"deaccessions\":[],\"related_accessions\":[{\"ref\":\"/repositories/2/accessions/1\"}],\"notes\":[],\"uri\":\"/repositories/2/resources/1\",\"repository\":{\"ref\":\"/repositories/2\"},\"tree\":{\"ref\":\"/repositories/2/resources/1/tree\"}}","suppressed":false,"publish":false,"system_generated":false,"repository":"/repositories/2","created_by":"admin","last_modified_by":"admin","user_mtime":"2015-08-12T20:24:17Z","system_mtime":"2015-08-12T20:24:17Z","create_time":"2015-06-11T17:08:42Z","level":"fonds","identifier":"F1","language":"eng","restrictions":"false","four_part_id":"F1","uri":"/repositories/2/resources/1","jsonmodel_type":"resource"},{"id":"/repositories/2/resources/2","title":"Some - other fonds","primary_type":"resource","types":["resource"],"json":"{\"lock_version\":0,\"title\":\"Some - other fonds\",\"publish\":false,\"restrictions\":false,\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-06-30T23:17:57Z\",\"system_mtime\":\"2015-06-30T23:17:57Z\",\"user_mtime\":\"2015-06-30T23:17:57Z\",\"suppressed\":false,\"id_0\":\"F2\",\"level\":\"fonds\",\"jsonmodel_type\":\"resource\",\"external_ids\":[],\"subjects\":[],\"linked_events\":[],\"extents\":[{\"lock_version\":0,\"number\":\"1\",\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-06-30T23:17:57Z\",\"system_mtime\":\"2015-06-30T23:17:57Z\",\"user_mtime\":\"2015-06-30T23:17:57Z\",\"portion\":\"whole\",\"extent_type\":\"cassettes\",\"jsonmodel_type\":\"extent\"}],\"dates\":[{\"lock_version\":0,\"begin\":\"2015-06-29\",\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-06-30T23:17:57Z\",\"system_mtime\":\"2015-06-30T23:17:57Z\",\"user_mtime\":\"2015-06-30T23:17:57Z\",\"date_type\":\"bulk\",\"label\":\"creation\",\"jsonmodel_type\":\"date\"}],\"external_documents\":[],\"rights_statements\":[],\"linked_agents\":[],\"instances\":[],\"deaccessions\":[],\"related_accessions\":[],\"notes\":[],\"uri\":\"/repositories/2/resources/2\",\"repository\":{\"ref\":\"/repositories/2\"},\"tree\":{\"ref\":\"/repositories/2/resources/2/tree\"}}","suppressed":false,"publish":false,"system_generated":false,"repository":"/repositories/2","created_by":"admin","last_modified_by":"admin","user_mtime":"2015-06-30T23:17:57Z","system_mtime":"2015-06-30T23:17:57Z","create_time":"2015-06-30T23:17:57Z","level":"fonds","identifier":"F2","restrictions":"false","four_part_id":"F2","uri":"/repositories/2/resources/2","jsonmodel_type":"resource"}],"facets":{"facet_queries":{},"facet_fields":{},"facet_dates":{},"facet_ranges":{}}} - -'} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['3942'] - content-type: [application/json] - date: ['Tue, 27 Oct 2015 23:39:31 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-63-generic] - X-ArchivesSpace-Session: [!!python/unicode b75502af2ca0fb38605e8dff31ffe026f078db9bacb6a4bedfa1339d2ef15389] - method: GET - uri: http://localhost:8089/repositories/2/search?q=primary_type%3Aresource&page=2 - response: - body: {string: !!python/unicode '{"first_page":1,"last_page":1,"this_page":2,"offset_first":11,"offset_last":3,"total_hits":3,"results":[],"facets":{"facet_queries":{},"facet_fields":{},"facet_dates":{},"facet_ranges":{}}} - -'} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['190'] - content-type: [application/json] - date: ['Tue, 27 Oct 2015 23:39:31 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-63-generic] - X-ArchivesSpace-Session: [!!python/unicode b75502af2ca0fb38605e8dff31ffe026f078db9bacb6a4bedfa1339d2ef15389] - method: GET - uri: http://localhost:8089/repositories/2/search?q=primary_type%3Aresource+AND+identifier%3AF%2A&page=1 - response: - body: {string: !!python/unicode '{"first_page":1,"last_page":1,"this_page":1,"offset_first":1,"offset_last":2,"total_hits":2,"results":[{"id":"/repositories/2/resources/1","title":"Test - fonds","primary_type":"resource","types":["resource"],"json":"{\"lock_version\":1,\"title\":\"Test - fonds\",\"publish\":false,\"restrictions\":false,\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-06-11T17:08:42Z\",\"system_mtime\":\"2015-08-12T20:24:17Z\",\"user_mtime\":\"2015-08-12T20:24:17Z\",\"suppressed\":false,\"id_0\":\"F1\",\"language\":\"eng\",\"level\":\"fonds\",\"jsonmodel_type\":\"resource\",\"external_ids\":[],\"subjects\":[],\"linked_events\":[],\"extents\":[{\"lock_version\":0,\"number\":\"1\",\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-08-12T20:24:18Z\",\"system_mtime\":\"2015-08-12T20:24:18Z\",\"user_mtime\":\"2015-08-12T20:24:18Z\",\"portion\":\"whole\",\"extent_type\":\"cassettes\",\"jsonmodel_type\":\"extent\"}],\"dates\":[{\"lock_version\":0,\"begin\":\"2015-01-01\",\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-08-12T20:24:18Z\",\"system_mtime\":\"2015-08-12T20:24:18Z\",\"user_mtime\":\"2015-08-12T20:24:18Z\",\"date_type\":\"single\",\"label\":\"creation\",\"jsonmodel_type\":\"date\"}],\"external_documents\":[],\"rights_statements\":[],\"linked_agents\":[],\"instances\":[],\"deaccessions\":[],\"related_accessions\":[{\"ref\":\"/repositories/2/accessions/1\"}],\"notes\":[],\"uri\":\"/repositories/2/resources/1\",\"repository\":{\"ref\":\"/repositories/2\"},\"tree\":{\"ref\":\"/repositories/2/resources/1/tree\"}}","suppressed":false,"publish":false,"system_generated":false,"repository":"/repositories/2","created_by":"admin","last_modified_by":"admin","user_mtime":"2015-08-12T20:24:17Z","system_mtime":"2015-08-12T20:24:17Z","create_time":"2015-06-11T17:08:42Z","level":"fonds","identifier":"F1","language":"eng","restrictions":"false","four_part_id":"F1","uri":"/repositories/2/resources/1","jsonmodel_type":"resource"},{"id":"/repositories/2/resources/2","title":"Some - other fonds","primary_type":"resource","types":["resource"],"json":"{\"lock_version\":0,\"title\":\"Some - other fonds\",\"publish\":false,\"restrictions\":false,\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-06-30T23:17:57Z\",\"system_mtime\":\"2015-06-30T23:17:57Z\",\"user_mtime\":\"2015-06-30T23:17:57Z\",\"suppressed\":false,\"id_0\":\"F2\",\"level\":\"fonds\",\"jsonmodel_type\":\"resource\",\"external_ids\":[],\"subjects\":[],\"linked_events\":[],\"extents\":[{\"lock_version\":0,\"number\":\"1\",\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-06-30T23:17:57Z\",\"system_mtime\":\"2015-06-30T23:17:57Z\",\"user_mtime\":\"2015-06-30T23:17:57Z\",\"portion\":\"whole\",\"extent_type\":\"cassettes\",\"jsonmodel_type\":\"extent\"}],\"dates\":[{\"lock_version\":0,\"begin\":\"2015-06-29\",\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-06-30T23:17:57Z\",\"system_mtime\":\"2015-06-30T23:17:57Z\",\"user_mtime\":\"2015-06-30T23:17:57Z\",\"date_type\":\"bulk\",\"label\":\"creation\",\"jsonmodel_type\":\"date\"}],\"external_documents\":[],\"rights_statements\":[],\"linked_agents\":[],\"instances\":[],\"deaccessions\":[],\"related_accessions\":[],\"notes\":[],\"uri\":\"/repositories/2/resources/2\",\"repository\":{\"ref\":\"/repositories/2\"},\"tree\":{\"ref\":\"/repositories/2/resources/2/tree\"}}","suppressed":false,"publish":false,"system_generated":false,"repository":"/repositories/2","created_by":"admin","last_modified_by":"admin","user_mtime":"2015-06-30T23:17:57Z","system_mtime":"2015-06-30T23:17:57Z","create_time":"2015-06-30T23:17:57Z","level":"fonds","identifier":"F2","restrictions":"false","four_part_id":"F2","uri":"/repositories/2/resources/2","jsonmodel_type":"resource"}],"facets":{"facet_queries":{},"facet_fields":{},"facet_dates":{},"facet_ranges":{}}} - -'} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['3942'] - content-type: [application/json] - date: ['Tue, 27 Oct 2015 23:39:31 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-63-generic] - X-ArchivesSpace-Session: [!!python/unicode b75502af2ca0fb38605e8dff31ffe026f078db9bacb6a4bedfa1339d2ef15389] - method: GET - uri: http://localhost:8089/repositories/2/search?q=primary_type%3Aresource+AND+identifier%3AF%2A&page=1&page_size=30 - response: - body: {string: !!python/unicode '{"first_page":1,"last_page":1,"this_page":1,"offset_first":1,"offset_last":2,"total_hits":2,"results":[{"id":"/repositories/2/resources/1","title":"Test - fonds","primary_type":"resource","types":["resource"],"json":"{\"lock_version\":1,\"title\":\"Test - fonds\",\"publish\":false,\"restrictions\":false,\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-06-11T17:08:42Z\",\"system_mtime\":\"2015-08-12T20:24:17Z\",\"user_mtime\":\"2015-08-12T20:24:17Z\",\"suppressed\":false,\"id_0\":\"F1\",\"language\":\"eng\",\"level\":\"fonds\",\"jsonmodel_type\":\"resource\",\"external_ids\":[],\"subjects\":[],\"linked_events\":[],\"extents\":[{\"lock_version\":0,\"number\":\"1\",\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-08-12T20:24:18Z\",\"system_mtime\":\"2015-08-12T20:24:18Z\",\"user_mtime\":\"2015-08-12T20:24:18Z\",\"portion\":\"whole\",\"extent_type\":\"cassettes\",\"jsonmodel_type\":\"extent\"}],\"dates\":[{\"lock_version\":0,\"begin\":\"2015-01-01\",\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-08-12T20:24:18Z\",\"system_mtime\":\"2015-08-12T20:24:18Z\",\"user_mtime\":\"2015-08-12T20:24:18Z\",\"date_type\":\"single\",\"label\":\"creation\",\"jsonmodel_type\":\"date\"}],\"external_documents\":[],\"rights_statements\":[],\"linked_agents\":[],\"instances\":[],\"deaccessions\":[],\"related_accessions\":[{\"ref\":\"/repositories/2/accessions/1\"}],\"notes\":[],\"uri\":\"/repositories/2/resources/1\",\"repository\":{\"ref\":\"/repositories/2\"},\"tree\":{\"ref\":\"/repositories/2/resources/1/tree\"}}","suppressed":false,"publish":false,"system_generated":false,"repository":"/repositories/2","created_by":"admin","last_modified_by":"admin","user_mtime":"2015-08-12T20:24:17Z","system_mtime":"2015-08-12T20:24:17Z","create_time":"2015-06-11T17:08:42Z","level":"fonds","identifier":"F1","language":"eng","restrictions":"false","four_part_id":"F1","uri":"/repositories/2/resources/1","jsonmodel_type":"resource"},{"id":"/repositories/2/resources/2","title":"Some - other fonds","primary_type":"resource","types":["resource"],"json":"{\"lock_version\":0,\"title\":\"Some - other fonds\",\"publish\":false,\"restrictions\":false,\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-06-30T23:17:57Z\",\"system_mtime\":\"2015-06-30T23:17:57Z\",\"user_mtime\":\"2015-06-30T23:17:57Z\",\"suppressed\":false,\"id_0\":\"F2\",\"level\":\"fonds\",\"jsonmodel_type\":\"resource\",\"external_ids\":[],\"subjects\":[],\"linked_events\":[],\"extents\":[{\"lock_version\":0,\"number\":\"1\",\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-06-30T23:17:57Z\",\"system_mtime\":\"2015-06-30T23:17:57Z\",\"user_mtime\":\"2015-06-30T23:17:57Z\",\"portion\":\"whole\",\"extent_type\":\"cassettes\",\"jsonmodel_type\":\"extent\"}],\"dates\":[{\"lock_version\":0,\"begin\":\"2015-06-29\",\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-06-30T23:17:57Z\",\"system_mtime\":\"2015-06-30T23:17:57Z\",\"user_mtime\":\"2015-06-30T23:17:57Z\",\"date_type\":\"bulk\",\"label\":\"creation\",\"jsonmodel_type\":\"date\"}],\"external_documents\":[],\"rights_statements\":[],\"linked_agents\":[],\"instances\":[],\"deaccessions\":[],\"related_accessions\":[],\"notes\":[],\"uri\":\"/repositories/2/resources/2\",\"repository\":{\"ref\":\"/repositories/2\"},\"tree\":{\"ref\":\"/repositories/2/resources/2/tree\"}}","suppressed":false,"publish":false,"system_generated":false,"repository":"/repositories/2","created_by":"admin","last_modified_by":"admin","user_mtime":"2015-06-30T23:17:57Z","system_mtime":"2015-06-30T23:17:57Z","create_time":"2015-06-30T23:17:57Z","level":"fonds","identifier":"F2","restrictions":"false","four_part_id":"F2","uri":"/repositories/2/resources/2","jsonmodel_type":"resource"}],"facets":{"facet_queries":{},"facet_fields":{},"facet_dates":{},"facet_ranges":{}}} - -'} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['3942'] - content-type: [application/json] - date: ['Tue, 27 Oct 2015 23:39:31 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-63-generic] - X-ArchivesSpace-Session: [!!python/unicode b75502af2ca0fb38605e8dff31ffe026f078db9bacb6a4bedfa1339d2ef15389] - method: GET - uri: http://localhost:8089/repositories/2/resources/1/tree?page=1 - response: - body: {string: !!python/unicode '{"title":"Test fonds","id":1,"node_type":"resource","publish":false,"suppressed":false,"children":[{"title":"Test - series","id":1,"record_uri":"/repositories/2/archival_objects/1","publish":false,"suppressed":false,"node_type":"archival_object","level":"series","has_children":true,"children":[{"title":"Test - subseries","id":3,"record_uri":"/repositories/2/archival_objects/3","publish":false,"suppressed":false,"node_type":"archival_object","level":"subseries","has_children":true,"children":[{"title":"Test - file","id":4,"record_uri":"/repositories/2/archival_objects/4","publish":false,"suppressed":false,"node_type":"archival_object","level":"file","has_children":false,"children":[],"instance_types":[],"containers":[]}],"instance_types":[],"containers":[]},{"title":"New - new new child","id":10,"record_uri":"/repositories/2/archival_objects/10","publish":false,"suppressed":false,"node_type":"archival_object","level":"series","has_children":false,"children":[],"instance_types":[],"containers":[]}],"instance_types":[],"containers":[]},{"title":"Test - series 2","id":2,"record_uri":"/repositories/2/archival_objects/2","publish":false,"suppressed":false,"node_type":"archival_object","level":"series","has_children":false,"children":[],"instance_types":[],"containers":[]}],"record_uri":"/repositories/2/resources/1","level":"fonds","jsonmodel_type":"resource_tree","instance_types":[],"containers":[]} - -'} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['1407'] - content-type: [application/json] - date: ['Tue, 27 Oct 2015 23:39:31 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-63-generic] - X-ArchivesSpace-Session: [!!python/unicode b75502af2ca0fb38605e8dff31ffe026f078db9bacb6a4bedfa1339d2ef15389] - method: GET - uri: http://localhost:8089/repositories/2/resources/2/tree?page=1 - response: - body: {string: !!python/unicode '{"title":"Some other fonds","id":2,"node_type":"resource","publish":false,"suppressed":false,"children":[{"title":"New - resource child","id":12,"record_uri":"/repositories/2/archival_objects/12","publish":false,"suppressed":false,"node_type":"archival_object","level":"series","has_children":false,"children":[],"instance_types":[],"containers":[]}],"record_uri":"/repositories/2/resources/2","level":"fonds","jsonmodel_type":"resource_tree","instance_types":[],"containers":[]} - -'} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['478'] - content-type: [application/json] - date: ['Tue, 27 Oct 2015 23:39:31 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -version: 1 diff --git a/tests/fixtures/test_listing_collections.yaml b/tests/fixtures/test_listing_collections.yaml deleted file mode 100644 index 132e210..0000000 --- a/tests/fixtures/test_listing_collections.yaml +++ /dev/null @@ -1,101 +0,0 @@ -interactions: -- request: - body: expiring=False&password=admin - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['29'] - Content-Type: [application/x-www-form-urlencoded] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-63-generic] - method: POST - uri: http://localhost:8089/users/admin/login - response: - body: {string: !!python/unicode '{"session":"beb7f2a62252458338b751e91b1a7b2ba663b87029b499fe53f035f3764bb0d0","user":{"lock_version":287,"username":"admin","name":"Administrator","is_system_user":true,"create_time":"2015-06-11T17:04:21Z","system_mtime":"2015-10-27T23:47:37Z","user_mtime":"2015-10-27T23:47:37Z","jsonmodel_type":"user","groups":[],"is_admin":true,"uri":"/users/1","agent_record":{"ref":"/agents/people/1"},"permissions":{"/repositories/1":["update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record","administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed"],"_archivesspace":["administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed","update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record"]}}} - -'} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['2206'] - content-type: [application/json] - date: ['Tue, 27 Oct 2015 23:47:37 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-63-generic] - X-ArchivesSpace-Session: [!!python/unicode beb7f2a62252458338b751e91b1a7b2ba663b87029b499fe53f035f3764bb0d0] - method: GET - uri: http://localhost:8089/repositories/2/search?q=primary_type%3Aresource&page=1&page_size=30 - response: - body: {string: !!python/unicode '{"first_page":1,"last_page":1,"this_page":1,"offset_first":1,"offset_last":2,"total_hits":2,"results":[{"id":"/repositories/2/resources/1","title":"Test - fonds","primary_type":"resource","types":["resource"],"json":"{\"lock_version\":1,\"title\":\"Test - fonds\",\"publish\":false,\"restrictions\":false,\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-06-11T17:08:42Z\",\"system_mtime\":\"2015-08-12T20:24:17Z\",\"user_mtime\":\"2015-08-12T20:24:17Z\",\"suppressed\":false,\"id_0\":\"F1\",\"language\":\"eng\",\"level\":\"fonds\",\"jsonmodel_type\":\"resource\",\"external_ids\":[],\"subjects\":[],\"linked_events\":[],\"extents\":[{\"lock_version\":0,\"number\":\"1\",\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-08-12T20:24:18Z\",\"system_mtime\":\"2015-08-12T20:24:18Z\",\"user_mtime\":\"2015-08-12T20:24:18Z\",\"portion\":\"whole\",\"extent_type\":\"cassettes\",\"jsonmodel_type\":\"extent\"}],\"dates\":[{\"lock_version\":0,\"begin\":\"2015-01-01\",\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-08-12T20:24:18Z\",\"system_mtime\":\"2015-08-12T20:24:18Z\",\"user_mtime\":\"2015-08-12T20:24:18Z\",\"date_type\":\"single\",\"label\":\"creation\",\"jsonmodel_type\":\"date\"}],\"external_documents\":[],\"rights_statements\":[],\"linked_agents\":[],\"instances\":[],\"deaccessions\":[],\"related_accessions\":[{\"ref\":\"/repositories/2/accessions/1\"}],\"notes\":[],\"uri\":\"/repositories/2/resources/1\",\"repository\":{\"ref\":\"/repositories/2\"},\"tree\":{\"ref\":\"/repositories/2/resources/1/tree\"}}","suppressed":false,"publish":false,"system_generated":false,"repository":"/repositories/2","created_by":"admin","last_modified_by":"admin","user_mtime":"2015-08-12T20:24:17Z","system_mtime":"2015-08-12T20:24:17Z","create_time":"2015-06-11T17:08:42Z","level":"fonds","identifier":"F1","language":"eng","restrictions":"false","four_part_id":"F1","uri":"/repositories/2/resources/1","jsonmodel_type":"resource"},{"id":"/repositories/2/resources/2","title":"Some - other fonds","primary_type":"resource","types":["resource"],"json":"{\"lock_version\":0,\"title\":\"Some - other fonds\",\"publish\":false,\"restrictions\":false,\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-06-30T23:17:57Z\",\"system_mtime\":\"2015-06-30T23:17:57Z\",\"user_mtime\":\"2015-06-30T23:17:57Z\",\"suppressed\":false,\"id_0\":\"F2\",\"level\":\"fonds\",\"jsonmodel_type\":\"resource\",\"external_ids\":[],\"subjects\":[],\"linked_events\":[],\"extents\":[{\"lock_version\":0,\"number\":\"1\",\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-06-30T23:17:57Z\",\"system_mtime\":\"2015-06-30T23:17:57Z\",\"user_mtime\":\"2015-06-30T23:17:57Z\",\"portion\":\"whole\",\"extent_type\":\"cassettes\",\"jsonmodel_type\":\"extent\"}],\"dates\":[{\"lock_version\":0,\"begin\":\"2015-06-29\",\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-06-30T23:17:57Z\",\"system_mtime\":\"2015-06-30T23:17:57Z\",\"user_mtime\":\"2015-06-30T23:17:57Z\",\"date_type\":\"bulk\",\"label\":\"creation\",\"jsonmodel_type\":\"date\"}],\"external_documents\":[],\"rights_statements\":[],\"linked_agents\":[],\"instances\":[],\"deaccessions\":[],\"related_accessions\":[],\"notes\":[],\"uri\":\"/repositories/2/resources/2\",\"repository\":{\"ref\":\"/repositories/2\"},\"tree\":{\"ref\":\"/repositories/2/resources/2/tree\"}}","suppressed":false,"publish":false,"system_generated":false,"repository":"/repositories/2","created_by":"admin","last_modified_by":"admin","user_mtime":"2015-06-30T23:17:57Z","system_mtime":"2015-06-30T23:17:57Z","create_time":"2015-06-30T23:17:57Z","level":"fonds","identifier":"F2","restrictions":"false","four_part_id":"F2","uri":"/repositories/2/resources/2","jsonmodel_type":"resource"}],"facets":{"facet_queries":{},"facet_fields":{},"facet_dates":{},"facet_ranges":{}}} - -'} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['3942'] - content-type: [application/json] - date: ['Tue, 27 Oct 2015 23:47:37 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-63-generic] - X-ArchivesSpace-Session: [!!python/unicode beb7f2a62252458338b751e91b1a7b2ba663b87029b499fe53f035f3764bb0d0] - method: GET - uri: http://localhost:8089/repositories/2/resources/1/tree?page=1 - response: - body: {string: !!python/unicode '{"title":"Test fonds","id":1,"node_type":"resource","publish":false,"suppressed":false,"children":[{"title":"Test - series","id":1,"record_uri":"/repositories/2/archival_objects/1","publish":false,"suppressed":false,"node_type":"archival_object","level":"series","has_children":true,"children":[{"title":"Test - subseries","id":3,"record_uri":"/repositories/2/archival_objects/3","publish":false,"suppressed":false,"node_type":"archival_object","level":"subseries","has_children":true,"children":[{"title":"Test - file","id":4,"record_uri":"/repositories/2/archival_objects/4","publish":false,"suppressed":false,"node_type":"archival_object","level":"file","has_children":false,"children":[],"instance_types":[],"containers":[]}],"instance_types":[],"containers":[]},{"title":"New - new new child","id":10,"record_uri":"/repositories/2/archival_objects/10","publish":false,"suppressed":false,"node_type":"archival_object","level":"series","has_children":false,"children":[],"instance_types":[],"containers":[]}],"instance_types":[],"containers":[]},{"title":"Test - series 2","id":2,"record_uri":"/repositories/2/archival_objects/2","publish":false,"suppressed":false,"node_type":"archival_object","level":"series","has_children":false,"children":[],"instance_types":[],"containers":[]}],"record_uri":"/repositories/2/resources/1","level":"fonds","jsonmodel_type":"resource_tree","instance_types":[],"containers":[]} - -'} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['1407'] - content-type: [application/json] - date: ['Tue, 27 Oct 2015 23:47:37 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-63-generic] - X-ArchivesSpace-Session: [!!python/unicode beb7f2a62252458338b751e91b1a7b2ba663b87029b499fe53f035f3764bb0d0] - method: GET - uri: http://localhost:8089/repositories/2/resources/2/tree?page=1 - response: - body: {string: !!python/unicode '{"title":"Some other fonds","id":2,"node_type":"resource","publish":false,"suppressed":false,"children":[{"title":"New - resource child","id":12,"record_uri":"/repositories/2/archival_objects/12","publish":false,"suppressed":false,"node_type":"archival_object","level":"series","has_children":false,"children":[],"instance_types":[],"containers":[]}],"record_uri":"/repositories/2/resources/2","level":"fonds","jsonmodel_type":"resource_tree","instance_types":[],"containers":[]} - -'} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['478'] - content-type: [application/json] - date: ['Tue, 27 Oct 2015 23:47:37 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -version: 1 diff --git a/tests/fixtures/test_listing_collections_search.yaml b/tests/fixtures/test_listing_collections_search.yaml deleted file mode 100644 index 4cada45..0000000 --- a/tests/fixtures/test_listing_collections_search.yaml +++ /dev/null @@ -1,115 +0,0 @@ -interactions: -- request: - body: !!binary | - ZXhwaXJpbmc9RmFsc2UmcGFzc3dvcmQ9YWRtaW4= - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['29'] - Content-Type: [application/x-www-form-urlencoded] - User-Agent: [python-requests/2.9.1] - method: POST - uri: http://localhost:8089/users/admin/login - response: - body: {string: '{"session":"34a45d1d93fd8d14fe0b93b5e49011612e6b19a395afd03a3f6d311073f18606","user":{"lock_version":1172,"username":"admin","name":"Administrator","is_system_user":true,"create_time":"2015-06-11T17:04:21Z","system_mtime":"2016-02-15T23:29:50Z","user_mtime":"2016-02-15T23:29:50Z","jsonmodel_type":"user","groups":[],"is_admin":true,"uri":"/users/1","agent_record":{"ref":"/agents/people/1"},"permissions":{"/repositories/1":["update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record","administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed"],"_archivesspace":["administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed","update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record"]}}} - -'} - headers: - Cache-Control: ['private, must-revalidate, max-age=0'] - Content-Length: ['2207'] - Content-Type: [application/json] - Date: ['Mon, 15 Feb 2016 23:29:50 GMT'] - Server: [Jetty(8.1.5.v20120716)] - X-Content-Type-Options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.9.1] - X-ArchivesSpace-Session: [34a45d1d93fd8d14fe0b93b5e49011612e6b19a395afd03a3f6d311073f18606] - method: GET - uri: http://localhost:8089/repositories/2/search?page=1&q=primary_type%3Aresource+AND+title%3ATest%5C%5C+fonds&page_size=30 - response: - body: {string: '{"first_page":1,"last_page":1,"this_page":1,"offset_first":1,"offset_last":1,"total_hits":1,"results":[{"id":"/repositories/2/resources/1","title":"Test - fonds","primary_type":"resource","types":["resource"],"json":"{\"lock_version\":11,\"title\":\"Test - fonds\",\"publish\":false,\"restrictions\":false,\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-06-11T17:08:42Z\",\"system_mtime\":\"2015-12-03T00:03:41Z\",\"user_mtime\":\"2015-12-03T00:03:41Z\",\"suppressed\":false,\"id_0\":\"F1\",\"language\":\"eng\",\"level\":\"fonds\",\"jsonmodel_type\":\"resource\",\"external_ids\":[],\"subjects\":[],\"linked_events\":[],\"extents\":[{\"lock_version\":0,\"number\":\"1\",\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-12-03T00:03:42Z\",\"system_mtime\":\"2015-12-03T00:03:42Z\",\"user_mtime\":\"2015-12-03T00:03:42Z\",\"portion\":\"whole\",\"extent_type\":\"cassettes\",\"jsonmodel_type\":\"extent\"}],\"dates\":[{\"lock_version\":0,\"begin\":\"2015-01-01\",\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-12-03T00:03:42Z\",\"system_mtime\":\"2015-12-03T00:03:42Z\",\"user_mtime\":\"2015-12-03T00:03:42Z\",\"date_type\":\"single\",\"label\":\"creation\",\"jsonmodel_type\":\"date\"}],\"external_documents\":[],\"rights_statements\":[],\"linked_agents\":[],\"instances\":[],\"deaccessions\":[],\"related_accessions\":[{\"ref\":\"/repositories/2/accessions/1\"}],\"notes\":[{\"content\":[\"Singlepart - note\"],\"type\":\"physdesc\",\"jsonmodel_type\":\"note_singlepart\",\"persistent_id\":\"cdc013c483de98b8a1762302faf8fd32\",\"publish\":true}],\"uri\":\"/repositories/2/resources/1\",\"repository\":{\"ref\":\"/repositories/2\"},\"tree\":{\"ref\":\"/repositories/2/resources/1/tree\"}}","suppressed":false,"publish":false,"system_generated":false,"repository":"/repositories/2","created_by":"admin","last_modified_by":"admin","user_mtime":"2015-12-03T00:03:41Z","system_mtime":"2015-12-03T00:03:41Z","create_time":"2015-06-11T17:08:42Z","level":"fonds","identifier":"F1","language":"eng","restrictions":"false","four_part_id":"F1","uri":"/repositories/2/resources/1","jsonmodel_type":"resource"}],"facets":{"facet_queries":{},"facet_fields":{},"facet_dates":{},"facet_ranges":{}}} - -'} - headers: - Cache-Control: ['private, must-revalidate, max-age=0'] - Content-Length: ['2269'] - Content-Type: [application/json] - Date: ['Mon, 15 Feb 2016 23:29:50 GMT'] - Server: [Jetty(8.1.5.v20120716)] - X-Content-Type-Options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.9.1] - X-ArchivesSpace-Session: [34a45d1d93fd8d14fe0b93b5e49011612e6b19a395afd03a3f6d311073f18606] - method: GET - uri: http://localhost:8089/repositories/2/resources/1/tree?page=1 - response: - body: {string: '{"title":"Test fonds","id":1,"node_type":"resource","publish":false,"suppressed":false,"children":[{"title":"Test - series, 1950 - 1972","id":1,"record_uri":"/repositories/2/archival_objects/1","publish":false,"suppressed":false,"node_type":"archival_object","level":"series","has_children":true,"children":[{"title":"Test - edited subseries w/ empty note, November, 2014 to November, 2015","id":3,"record_uri":"/repositories/2/archival_objects/3","publish":false,"suppressed":false,"node_type":"archival_object","level":"subseries","has_children":true,"children":[{"title":"Test - file","id":4,"record_uri":"/repositories/2/archival_objects/4","publish":false,"suppressed":false,"node_type":"archival_object","level":"file","has_children":false,"children":[],"instance_types":[],"containers":[]}],"instance_types":[],"containers":[]},{"title":"New - new new edited child","id":10,"record_uri":"/repositories/2/archival_objects/10","publish":false,"suppressed":false,"node_type":"archival_object","level":"series","has_children":false,"children":[],"instance_types":[],"containers":[]}],"instance_types":[],"containers":[]},{"title":"Test - series 2","id":2,"record_uri":"/repositories/2/archival_objects/2","publish":false,"suppressed":false,"node_type":"archival_object","level":"series","has_children":false,"children":[],"instance_types":[],"containers":[]},{"title":"Test - new child","id":13,"record_uri":"/repositories/2/archival_objects/13","publish":false,"suppressed":false,"node_type":"archival_object","level":"series","has_children":false,"children":[],"instance_types":[],"containers":[]},{"title":"Test - new child 2","id":14,"record_uri":"/repositories/2/archival_objects/14","publish":false,"suppressed":false,"node_type":"archival_object","level":"item","has_children":false,"children":[],"instance_types":[],"containers":[]},{"title":"Test - new child 3","id":16,"record_uri":"/repositories/2/archival_objects/16","publish":false,"suppressed":false,"node_type":"archival_object","level":"class","has_children":false,"children":[],"instance_types":[],"containers":[]},{"title":"New - child with note","id":17,"record_uri":"/repositories/2/archival_objects/17","publish":false,"suppressed":false,"node_type":"archival_object","level":"class","has_children":false,"children":[],"instance_types":[],"containers":[]},{"title":"New - child final","id":18,"record_uri":"/repositories/2/archival_objects/18","publish":false,"suppressed":false,"node_type":"archival_object","level":null,"has_children":false,"children":[],"instance_types":[],"containers":[]},{"title":"Child - with no note","id":19,"record_uri":"/repositories/2/archival_objects/19","publish":false,"suppressed":false,"node_type":"archival_object","level":"fonds","has_children":false,"children":[],"instance_types":[],"containers":[]},{"title":"Child - with no note","id":20,"record_uri":"/repositories/2/archival_objects/20","publish":false,"suppressed":false,"node_type":"archival_object","level":"fonds","has_children":false,"children":[],"instance_types":[],"containers":[]},{"title":"Test - child","id":26,"record_uri":"/repositories/2/archival_objects/26","publish":false,"suppressed":false,"node_type":"archival_object","level":"recordgrp","has_children":false,"children":[],"instance_types":[],"containers":[]},{"title":"Test - child","id":27,"record_uri":"/repositories/2/archival_objects/27","publish":false,"suppressed":false,"node_type":"archival_object","level":"recordgrp","has_children":false,"children":[],"instance_types":[],"containers":[]},{"title":"Test - child","id":28,"record_uri":"/repositories/2/archival_objects/28","publish":false,"suppressed":false,"node_type":"archival_object","level":"recordgrp","has_children":false,"children":[],"instance_types":[],"containers":[]},{"title":"Test - child","id":29,"record_uri":"/repositories/2/archival_objects/29","publish":false,"suppressed":false,"node_type":"archival_object","level":"recordgrp","has_children":false,"children":[],"instance_types":[],"containers":[]},{"title":"Record - with two notes","id":32,"record_uri":"/repositories/2/archival_objects/32","publish":false,"suppressed":false,"node_type":"archival_object","level":null,"has_children":false,"children":[],"instance_types":[],"containers":[]},{"title":"Second - child with two notes","id":33,"record_uri":"/repositories/2/archival_objects/33","publish":false,"suppressed":false,"node_type":"archival_object","level":"recordgrp","has_children":false,"children":[],"instance_types":[],"containers":[]},{"title":"Third - record with two notes","id":34,"record_uri":"/repositories/2/archival_objects/34","publish":false,"suppressed":false,"node_type":"archival_object","level":null,"has_children":false,"children":[],"instance_types":[],"containers":[]},{"title":"Test - child","id":35,"record_uri":"/repositories/2/archival_objects/35","publish":false,"suppressed":false,"node_type":"archival_object","level":"recordgrp","has_children":false,"children":[],"instance_types":[],"containers":[]}],"record_uri":"/repositories/2/resources/1","level":"fonds","jsonmodel_type":"resource_tree","instance_types":[],"containers":[]} - -'} - headers: - Cache-Control: ['private, must-revalidate, max-age=0'] - Content-Length: ['5098'] - Content-Type: [application/json] - Date: ['Mon, 15 Feb 2016 23:29:50 GMT'] - Server: [Jetty(8.1.5.v20120716)] - X-Content-Type-Options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.9.1] - X-ArchivesSpace-Session: [34a45d1d93fd8d14fe0b93b5e49011612e6b19a395afd03a3f6d311073f18606] - method: GET - uri: http://localhost:8089/repositories/2/search?page=1&q=primary_type%3Aresource+AND+title%3ANo%5C%5C+such%5C%5C+fonds&page_size=30 - response: - body: {string: '{"first_page":1,"last_page":0,"this_page":1,"offset_first":1,"offset_last":0,"total_hits":0,"results":[],"facets":{"facet_queries":{},"facet_fields":{},"facet_dates":{},"facet_ranges":{}}} - -'} - headers: - Cache-Control: ['private, must-revalidate, max-age=0'] - Content-Length: ['189'] - Content-Type: [application/json] - Date: ['Mon, 15 Feb 2016 23:29:50 GMT'] - Server: [Jetty(8.1.5.v20120716)] - X-Content-Type-Options: [nosniff] - status: {code: 200, message: OK} -version: 1 diff --git a/tests/fixtures/test_listing_collections_search_spaces.yaml b/tests/fixtures/test_listing_collections_search_spaces.yaml deleted file mode 100644 index 15b935d..0000000 --- a/tests/fixtures/test_listing_collections_search_spaces.yaml +++ /dev/null @@ -1,74 +0,0 @@ -interactions: -- request: - body: !!binary | - ZXhwaXJpbmc9RmFsc2UmcGFzc3dvcmQ9YWRtaW4= - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['29'] - Content-Type: [application/x-www-form-urlencoded] - User-Agent: [python-requests/2.9.1] - method: POST - uri: http://localhost:8089/users/admin/login - response: - body: {string: '{"session":"7dca265a6dc0619007212824e18b22141ff9eb9e7533bf5d6b0501bc4256d0df","user":{"lock_version":1095,"username":"admin","name":"Administrator","is_system_user":true,"create_time":"2015-06-11T17:04:21Z","system_mtime":"2016-02-13T01:21:40Z","user_mtime":"2016-02-13T01:21:40Z","jsonmodel_type":"user","groups":[],"is_admin":true,"uri":"/users/1","agent_record":{"ref":"/agents/people/1"},"permissions":{"/repositories/1":["update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record","administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed"],"_archivesspace":["administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed","update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record"]}}} - -'} - headers: - Cache-Control: ['private, must-revalidate, max-age=0'] - Content-Length: ['2207'] - Content-Type: [application/json] - Date: ['Sat, 13 Feb 2016 01:21:40 GMT'] - Server: [Jetty(8.1.5.v20120716)] - X-Content-Type-Options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.9.1] - X-ArchivesSpace-Session: [7dca265a6dc0619007212824e18b22141ff9eb9e7533bf5d6b0501bc4256d0df] - method: GET - uri: http://localhost:8089/repositories/2/search?page=1&page_size=30&q=primary_type%3Aresource+AND+identifier%3A2015044%5C+Aa%5C+Ac - response: - body: {string: '{"first_page":1,"last_page":1,"this_page":1,"offset_first":1,"offset_last":1,"total_hits":1,"results":[{"id":"/repositories/2/resources/6","title":"Resource - with spaces in the identifier","primary_type":"resource","types":["resource"],"json":"{\"lock_version\":1,\"title\":\"Resource - with spaces in the identifier\",\"publish\":false,\"restrictions\":false,\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2016-02-13T00:41:44Z\",\"system_mtime\":\"2016-02-13T00:42:41Z\",\"user_mtime\":\"2016-02-13T00:42:41Z\",\"suppressed\":false,\"id_0\":\"2015044 - Aa Ac\",\"level\":\"collection\",\"jsonmodel_type\":\"resource\",\"external_ids\":[],\"subjects\":[],\"linked_events\":[],\"extents\":[{\"lock_version\":0,\"number\":\"50\",\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2016-02-13T00:42:41Z\",\"system_mtime\":\"2016-02-13T00:42:41Z\",\"user_mtime\":\"2016-02-13T00:42:41Z\",\"portion\":\"whole\",\"extent_type\":\"cassettes\",\"jsonmodel_type\":\"extent\"}],\"dates\":[{\"lock_version\":0,\"expression\":\"sdfsdf\",\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2016-02-13T00:42:41Z\",\"system_mtime\":\"2016-02-13T00:42:41Z\",\"user_mtime\":\"2016-02-13T00:42:41Z\",\"date_type\":\"bulk\",\"label\":\"creation\",\"jsonmodel_type\":\"date\"}],\"external_documents\":[],\"rights_statements\":[],\"linked_agents\":[],\"instances\":[],\"deaccessions\":[],\"related_accessions\":[],\"notes\":[],\"uri\":\"/repositories/2/resources/6\",\"repository\":{\"ref\":\"/repositories/2\"},\"tree\":{\"ref\":\"/repositories/2/resources/6/tree\"}}","suppressed":false,"publish":false,"system_generated":false,"repository":"/repositories/2","created_by":"admin","last_modified_by":"admin","user_mtime":"2016-02-13T00:42:41Z","system_mtime":"2016-02-13T00:42:41Z","create_time":"2016-02-13T00:41:44Z","level":"collection","identifier":"2015044 - Aa Ac","restrictions":"false","four_part_id":"2015044 Aa Ac","uri":"/repositories/2/resources/6","jsonmodel_type":"resource"}],"facets":{"facet_queries":{},"facet_fields":{},"facet_dates":{},"facet_ranges":{}}} - -'} - headers: - Cache-Control: ['private, must-revalidate, max-age=0'] - Content-Length: ['2119'] - Content-Type: [application/json] - Date: ['Sat, 13 Feb 2016 01:21:40 GMT'] - Server: [Jetty(8.1.5.v20120716)] - X-Content-Type-Options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.9.1] - X-ArchivesSpace-Session: [7dca265a6dc0619007212824e18b22141ff9eb9e7533bf5d6b0501bc4256d0df] - method: GET - uri: http://localhost:8089/repositories/2/resources/6/tree?page=1 - response: - body: {string: '{"title":"Resource with spaces in the identifier","id":6,"node_type":"resource","publish":false,"suppressed":false,"children":[],"record_uri":"/repositories/2/resources/6","level":"collection","jsonmodel_type":"resource_tree","instance_types":[],"containers":[]} - -'} - headers: - Cache-Control: ['private, must-revalidate, max-age=0'] - Content-Length: ['263'] - Content-Type: [application/json] - Date: ['Sat, 13 Feb 2016 01:21:40 GMT'] - Server: [Jetty(8.1.5.v20120716)] - X-Content-Type-Options: [nosniff] - status: {code: 200, message: OK} -version: 1 diff --git a/tests/fixtures/test_listing_collections_sort.yaml b/tests/fixtures/test_listing_collections_sort.yaml deleted file mode 100644 index 54ab276..0000000 --- a/tests/fixtures/test_listing_collections_sort.yaml +++ /dev/null @@ -1,177 +0,0 @@ -interactions: -- request: - body: expiring=False&password=admin - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['29'] - Content-Type: [application/x-www-form-urlencoded] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-63-generic] - method: POST - uri: http://localhost:8089/users/admin/login - response: - body: {string: !!python/unicode '{"session":"b2e5017a17414086304abced192a02b53c9d98df2b8ae9f415a32f97bda8e31b","user":{"lock_version":286,"username":"admin","name":"Administrator","is_system_user":true,"create_time":"2015-06-11T17:04:21Z","system_mtime":"2015-10-27T23:46:42Z","user_mtime":"2015-10-27T23:46:42Z","jsonmodel_type":"user","groups":[],"is_admin":true,"uri":"/users/1","agent_record":{"ref":"/agents/people/1"},"permissions":{"/repositories/1":["update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record","administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed"],"_archivesspace":["administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed","update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record"]}}} - -'} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['2206'] - content-type: [application/json] - date: ['Tue, 27 Oct 2015 23:46:42 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-63-generic] - X-ArchivesSpace-Session: [!!python/unicode b2e5017a17414086304abced192a02b53c9d98df2b8ae9f415a32f97bda8e31b] - method: GET - uri: http://localhost:8089/repositories/2/search?q=primary_type%3Aresource&sort=title_sort+asc&page=1&page_size=30 - response: - body: {string: !!python/unicode '{"first_page":1,"last_page":1,"this_page":1,"offset_first":1,"offset_last":2,"total_hits":2,"results":[{"id":"/repositories/2/resources/2","title":"Some - other fonds","primary_type":"resource","types":["resource"],"json":"{\"lock_version\":0,\"title\":\"Some - other fonds\",\"publish\":false,\"restrictions\":false,\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-06-30T23:17:57Z\",\"system_mtime\":\"2015-06-30T23:17:57Z\",\"user_mtime\":\"2015-06-30T23:17:57Z\",\"suppressed\":false,\"id_0\":\"F2\",\"level\":\"fonds\",\"jsonmodel_type\":\"resource\",\"external_ids\":[],\"subjects\":[],\"linked_events\":[],\"extents\":[{\"lock_version\":0,\"number\":\"1\",\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-06-30T23:17:57Z\",\"system_mtime\":\"2015-06-30T23:17:57Z\",\"user_mtime\":\"2015-06-30T23:17:57Z\",\"portion\":\"whole\",\"extent_type\":\"cassettes\",\"jsonmodel_type\":\"extent\"}],\"dates\":[{\"lock_version\":0,\"begin\":\"2015-06-29\",\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-06-30T23:17:57Z\",\"system_mtime\":\"2015-06-30T23:17:57Z\",\"user_mtime\":\"2015-06-30T23:17:57Z\",\"date_type\":\"bulk\",\"label\":\"creation\",\"jsonmodel_type\":\"date\"}],\"external_documents\":[],\"rights_statements\":[],\"linked_agents\":[],\"instances\":[],\"deaccessions\":[],\"related_accessions\":[],\"notes\":[],\"uri\":\"/repositories/2/resources/2\",\"repository\":{\"ref\":\"/repositories/2\"},\"tree\":{\"ref\":\"/repositories/2/resources/2/tree\"}}","suppressed":false,"publish":false,"system_generated":false,"repository":"/repositories/2","created_by":"admin","last_modified_by":"admin","user_mtime":"2015-06-30T23:17:57Z","system_mtime":"2015-06-30T23:17:57Z","create_time":"2015-06-30T23:17:57Z","level":"fonds","identifier":"F2","restrictions":"false","four_part_id":"F2","uri":"/repositories/2/resources/2","jsonmodel_type":"resource"},{"id":"/repositories/2/resources/1","title":"Test - fonds","primary_type":"resource","types":["resource"],"json":"{\"lock_version\":1,\"title\":\"Test - fonds\",\"publish\":false,\"restrictions\":false,\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-06-11T17:08:42Z\",\"system_mtime\":\"2015-08-12T20:24:17Z\",\"user_mtime\":\"2015-08-12T20:24:17Z\",\"suppressed\":false,\"id_0\":\"F1\",\"language\":\"eng\",\"level\":\"fonds\",\"jsonmodel_type\":\"resource\",\"external_ids\":[],\"subjects\":[],\"linked_events\":[],\"extents\":[{\"lock_version\":0,\"number\":\"1\",\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-08-12T20:24:18Z\",\"system_mtime\":\"2015-08-12T20:24:18Z\",\"user_mtime\":\"2015-08-12T20:24:18Z\",\"portion\":\"whole\",\"extent_type\":\"cassettes\",\"jsonmodel_type\":\"extent\"}],\"dates\":[{\"lock_version\":0,\"begin\":\"2015-01-01\",\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-08-12T20:24:18Z\",\"system_mtime\":\"2015-08-12T20:24:18Z\",\"user_mtime\":\"2015-08-12T20:24:18Z\",\"date_type\":\"single\",\"label\":\"creation\",\"jsonmodel_type\":\"date\"}],\"external_documents\":[],\"rights_statements\":[],\"linked_agents\":[],\"instances\":[],\"deaccessions\":[],\"related_accessions\":[{\"ref\":\"/repositories/2/accessions/1\"}],\"notes\":[],\"uri\":\"/repositories/2/resources/1\",\"repository\":{\"ref\":\"/repositories/2\"},\"tree\":{\"ref\":\"/repositories/2/resources/1/tree\"}}","suppressed":false,"publish":false,"system_generated":false,"repository":"/repositories/2","created_by":"admin","last_modified_by":"admin","user_mtime":"2015-08-12T20:24:17Z","system_mtime":"2015-08-12T20:24:17Z","create_time":"2015-06-11T17:08:42Z","level":"fonds","identifier":"F1","language":"eng","restrictions":"false","four_part_id":"F1","uri":"/repositories/2/resources/1","jsonmodel_type":"resource"}],"facets":{"facet_queries":{},"facet_fields":{},"facet_dates":{},"facet_ranges":{}}} - -'} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['3942'] - content-type: [application/json] - date: ['Tue, 27 Oct 2015 23:46:42 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-63-generic] - X-ArchivesSpace-Session: [!!python/unicode b2e5017a17414086304abced192a02b53c9d98df2b8ae9f415a32f97bda8e31b] - method: GET - uri: http://localhost:8089/repositories/2/resources/2/tree?page=1 - response: - body: {string: !!python/unicode '{"title":"Some other fonds","id":2,"node_type":"resource","publish":false,"suppressed":false,"children":[{"title":"New - resource child","id":12,"record_uri":"/repositories/2/archival_objects/12","publish":false,"suppressed":false,"node_type":"archival_object","level":"series","has_children":false,"children":[],"instance_types":[],"containers":[]}],"record_uri":"/repositories/2/resources/2","level":"fonds","jsonmodel_type":"resource_tree","instance_types":[],"containers":[]} - -'} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['478'] - content-type: [application/json] - date: ['Tue, 27 Oct 2015 23:46:42 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-63-generic] - X-ArchivesSpace-Session: [!!python/unicode b2e5017a17414086304abced192a02b53c9d98df2b8ae9f415a32f97bda8e31b] - method: GET - uri: http://localhost:8089/repositories/2/resources/1/tree?page=1 - response: - body: {string: !!python/unicode '{"title":"Test fonds","id":1,"node_type":"resource","publish":false,"suppressed":false,"children":[{"title":"Test - series","id":1,"record_uri":"/repositories/2/archival_objects/1","publish":false,"suppressed":false,"node_type":"archival_object","level":"series","has_children":true,"children":[{"title":"Test - subseries","id":3,"record_uri":"/repositories/2/archival_objects/3","publish":false,"suppressed":false,"node_type":"archival_object","level":"subseries","has_children":true,"children":[{"title":"Test - file","id":4,"record_uri":"/repositories/2/archival_objects/4","publish":false,"suppressed":false,"node_type":"archival_object","level":"file","has_children":false,"children":[],"instance_types":[],"containers":[]}],"instance_types":[],"containers":[]},{"title":"New - new new child","id":10,"record_uri":"/repositories/2/archival_objects/10","publish":false,"suppressed":false,"node_type":"archival_object","level":"series","has_children":false,"children":[],"instance_types":[],"containers":[]}],"instance_types":[],"containers":[]},{"title":"Test - series 2","id":2,"record_uri":"/repositories/2/archival_objects/2","publish":false,"suppressed":false,"node_type":"archival_object","level":"series","has_children":false,"children":[],"instance_types":[],"containers":[]}],"record_uri":"/repositories/2/resources/1","level":"fonds","jsonmodel_type":"resource_tree","instance_types":[],"containers":[]} - -'} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['1407'] - content-type: [application/json] - date: ['Tue, 27 Oct 2015 23:46:42 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-63-generic] - X-ArchivesSpace-Session: [!!python/unicode b2e5017a17414086304abced192a02b53c9d98df2b8ae9f415a32f97bda8e31b] - method: GET - uri: http://localhost:8089/repositories/2/search?q=primary_type%3Aresource&sort=title_sort+desc&page=1&page_size=30 - response: - body: {string: !!python/unicode '{"first_page":1,"last_page":1,"this_page":1,"offset_first":1,"offset_last":2,"total_hits":2,"results":[{"id":"/repositories/2/resources/1","title":"Test - fonds","primary_type":"resource","types":["resource"],"json":"{\"lock_version\":1,\"title\":\"Test - fonds\",\"publish\":false,\"restrictions\":false,\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-06-11T17:08:42Z\",\"system_mtime\":\"2015-08-12T20:24:17Z\",\"user_mtime\":\"2015-08-12T20:24:17Z\",\"suppressed\":false,\"id_0\":\"F1\",\"language\":\"eng\",\"level\":\"fonds\",\"jsonmodel_type\":\"resource\",\"external_ids\":[],\"subjects\":[],\"linked_events\":[],\"extents\":[{\"lock_version\":0,\"number\":\"1\",\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-08-12T20:24:18Z\",\"system_mtime\":\"2015-08-12T20:24:18Z\",\"user_mtime\":\"2015-08-12T20:24:18Z\",\"portion\":\"whole\",\"extent_type\":\"cassettes\",\"jsonmodel_type\":\"extent\"}],\"dates\":[{\"lock_version\":0,\"begin\":\"2015-01-01\",\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-08-12T20:24:18Z\",\"system_mtime\":\"2015-08-12T20:24:18Z\",\"user_mtime\":\"2015-08-12T20:24:18Z\",\"date_type\":\"single\",\"label\":\"creation\",\"jsonmodel_type\":\"date\"}],\"external_documents\":[],\"rights_statements\":[],\"linked_agents\":[],\"instances\":[],\"deaccessions\":[],\"related_accessions\":[{\"ref\":\"/repositories/2/accessions/1\"}],\"notes\":[],\"uri\":\"/repositories/2/resources/1\",\"repository\":{\"ref\":\"/repositories/2\"},\"tree\":{\"ref\":\"/repositories/2/resources/1/tree\"}}","suppressed":false,"publish":false,"system_generated":false,"repository":"/repositories/2","created_by":"admin","last_modified_by":"admin","user_mtime":"2015-08-12T20:24:17Z","system_mtime":"2015-08-12T20:24:17Z","create_time":"2015-06-11T17:08:42Z","level":"fonds","identifier":"F1","language":"eng","restrictions":"false","four_part_id":"F1","uri":"/repositories/2/resources/1","jsonmodel_type":"resource"},{"id":"/repositories/2/resources/2","title":"Some - other fonds","primary_type":"resource","types":["resource"],"json":"{\"lock_version\":0,\"title\":\"Some - other fonds\",\"publish\":false,\"restrictions\":false,\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-06-30T23:17:57Z\",\"system_mtime\":\"2015-06-30T23:17:57Z\",\"user_mtime\":\"2015-06-30T23:17:57Z\",\"suppressed\":false,\"id_0\":\"F2\",\"level\":\"fonds\",\"jsonmodel_type\":\"resource\",\"external_ids\":[],\"subjects\":[],\"linked_events\":[],\"extents\":[{\"lock_version\":0,\"number\":\"1\",\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-06-30T23:17:57Z\",\"system_mtime\":\"2015-06-30T23:17:57Z\",\"user_mtime\":\"2015-06-30T23:17:57Z\",\"portion\":\"whole\",\"extent_type\":\"cassettes\",\"jsonmodel_type\":\"extent\"}],\"dates\":[{\"lock_version\":0,\"begin\":\"2015-06-29\",\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-06-30T23:17:57Z\",\"system_mtime\":\"2015-06-30T23:17:57Z\",\"user_mtime\":\"2015-06-30T23:17:57Z\",\"date_type\":\"bulk\",\"label\":\"creation\",\"jsonmodel_type\":\"date\"}],\"external_documents\":[],\"rights_statements\":[],\"linked_agents\":[],\"instances\":[],\"deaccessions\":[],\"related_accessions\":[],\"notes\":[],\"uri\":\"/repositories/2/resources/2\",\"repository\":{\"ref\":\"/repositories/2\"},\"tree\":{\"ref\":\"/repositories/2/resources/2/tree\"}}","suppressed":false,"publish":false,"system_generated":false,"repository":"/repositories/2","created_by":"admin","last_modified_by":"admin","user_mtime":"2015-06-30T23:17:57Z","system_mtime":"2015-06-30T23:17:57Z","create_time":"2015-06-30T23:17:57Z","level":"fonds","identifier":"F2","restrictions":"false","four_part_id":"F2","uri":"/repositories/2/resources/2","jsonmodel_type":"resource"}],"facets":{"facet_queries":{},"facet_fields":{},"facet_dates":{},"facet_ranges":{}}} - -'} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['3942'] - content-type: [application/json] - date: ['Tue, 27 Oct 2015 23:46:42 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-63-generic] - X-ArchivesSpace-Session: [!!python/unicode b2e5017a17414086304abced192a02b53c9d98df2b8ae9f415a32f97bda8e31b] - method: GET - uri: http://localhost:8089/repositories/2/resources/1/tree?page=1 - response: - body: {string: !!python/unicode '{"title":"Test fonds","id":1,"node_type":"resource","publish":false,"suppressed":false,"children":[{"title":"Test - series","id":1,"record_uri":"/repositories/2/archival_objects/1","publish":false,"suppressed":false,"node_type":"archival_object","level":"series","has_children":true,"children":[{"title":"Test - subseries","id":3,"record_uri":"/repositories/2/archival_objects/3","publish":false,"suppressed":false,"node_type":"archival_object","level":"subseries","has_children":true,"children":[{"title":"Test - file","id":4,"record_uri":"/repositories/2/archival_objects/4","publish":false,"suppressed":false,"node_type":"archival_object","level":"file","has_children":false,"children":[],"instance_types":[],"containers":[]}],"instance_types":[],"containers":[]},{"title":"New - new new child","id":10,"record_uri":"/repositories/2/archival_objects/10","publish":false,"suppressed":false,"node_type":"archival_object","level":"series","has_children":false,"children":[],"instance_types":[],"containers":[]}],"instance_types":[],"containers":[]},{"title":"Test - series 2","id":2,"record_uri":"/repositories/2/archival_objects/2","publish":false,"suppressed":false,"node_type":"archival_object","level":"series","has_children":false,"children":[],"instance_types":[],"containers":[]}],"record_uri":"/repositories/2/resources/1","level":"fonds","jsonmodel_type":"resource_tree","instance_types":[],"containers":[]} - -'} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['1407'] - content-type: [application/json] - date: ['Tue, 27 Oct 2015 23:46:42 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-63-generic] - X-ArchivesSpace-Session: [!!python/unicode b2e5017a17414086304abced192a02b53c9d98df2b8ae9f415a32f97bda8e31b] - method: GET - uri: http://localhost:8089/repositories/2/resources/2/tree?page=1 - response: - body: {string: !!python/unicode '{"title":"Some other fonds","id":2,"node_type":"resource","publish":false,"suppressed":false,"children":[{"title":"New - resource child","id":12,"record_uri":"/repositories/2/archival_objects/12","publish":false,"suppressed":false,"node_type":"archival_object","level":"series","has_children":false,"children":[],"instance_types":[],"containers":[]}],"record_uri":"/repositories/2/resources/2","level":"fonds","jsonmodel_type":"resource_tree","instance_types":[],"containers":[]} - -'} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['478'] - content-type: [application/json] - date: ['Tue, 27 Oct 2015 23:46:42 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -version: 1 diff --git a/tests/fixtures/test_posting_contentless_note.yaml b/tests/fixtures/test_posting_contentless_note.yaml deleted file mode 100644 index cbbb5eb..0000000 --- a/tests/fixtures/test_posting_contentless_note.yaml +++ /dev/null @@ -1,98 +0,0 @@ -interactions: -- request: - body: !!binary | - cGFzc3dvcmQ9YWRtaW4mZXhwaXJpbmc9RmFsc2U= - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['29'] - Content-Type: [application/x-www-form-urlencoded] - User-Agent: [python-requests/2.9.1] - method: POST - uri: http://localhost:8089/users/admin/login - response: - body: {string: '{"session":"a76c444cf976f1910c78069d7419792904c754f609960bb098a09a8367c78de2","user":{"lock_version":876,"username":"admin","name":"Administrator","is_system_user":true,"create_time":"2015-06-11T17:04:21Z","system_mtime":"2016-02-01T19:57:27Z","user_mtime":"2016-02-01T19:57:27Z","jsonmodel_type":"user","groups":[],"is_admin":true,"uri":"/users/1","agent_record":{"ref":"/agents/people/1"},"permissions":{"/repositories/1":["update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record","administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed"],"_archivesspace":["administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed","update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record"]}}} - -'} - headers: - Cache-Control: ['private, must-revalidate, max-age=0'] - Content-Length: ['2206'] - Content-Type: [application/json] - Date: ['Mon, 01 Feb 2016 19:57:27 GMT'] - Server: [Jetty(8.1.5.v20120716)] - X-Content-Type-Options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.9.1] - X-ArchivesSpace-Session: [a76c444cf976f1910c78069d7419792904c754f609960bb098a09a8367c78de2] - method: GET - uri: http://localhost:8089/repositories/2/resources/1 - response: - body: {string: '{"lock_version":11,"title":"Test fonds","publish":false,"restrictions":false,"created_by":"admin","last_modified_by":"admin","create_time":"2015-06-11T17:08:42Z","system_mtime":"2015-12-03T00:03:41Z","user_mtime":"2015-12-03T00:03:41Z","suppressed":false,"id_0":"F1","language":"eng","level":"fonds","jsonmodel_type":"resource","external_ids":[],"subjects":[],"linked_events":[],"extents":[{"lock_version":0,"number":"1","created_by":"admin","last_modified_by":"admin","create_time":"2015-12-03T00:03:42Z","system_mtime":"2015-12-03T00:03:42Z","user_mtime":"2015-12-03T00:03:42Z","portion":"whole","extent_type":"cassettes","jsonmodel_type":"extent"}],"dates":[{"lock_version":0,"begin":"2015-01-01","created_by":"admin","last_modified_by":"admin","create_time":"2015-12-03T00:03:42Z","system_mtime":"2015-12-03T00:03:42Z","user_mtime":"2015-12-03T00:03:42Z","date_type":"single","label":"creation","jsonmodel_type":"date"}],"external_documents":[],"rights_statements":[],"linked_agents":[],"instances":[],"deaccessions":[],"related_accessions":[{"ref":"/repositories/2/accessions/1"}],"notes":[{"content":["Singlepart - note"],"type":"physdesc","jsonmodel_type":"note_singlepart","persistent_id":"cdc013c483de98b8a1762302faf8fd32","publish":true}],"uri":"/repositories/2/resources/1","repository":{"ref":"/repositories/2"},"tree":{"ref":"/repositories/2/resources/1/tree"}} - -'} - headers: - Cache-Control: ['private, must-revalidate, max-age=0'] - Content-Length: ['1373'] - Content-Type: [application/json] - Date: ['Mon, 01 Feb 2016 19:57:27 GMT'] - Server: [Jetty(8.1.5.v20120716)] - X-Content-Type-Options: [nosniff] - status: {code: 200, message: OK} -- request: - body: !!binary | - eyJsZXZlbCI6ICJyZWNvcmRncnAiLCAianNvbm1vZGVsX3R5cGUiOiAiYXJjaGl2YWxfb2JqZWN0 - IiwgInJlc291cmNlIjogeyJyZWYiOiAiL3JlcG9zaXRvcmllcy8yL3Jlc291cmNlcy8xIn0sICJ0 - aXRsZSI6ICJUZXN0IGNoaWxkIn0= - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['134'] - User-Agent: [python-requests/2.9.1] - X-ArchivesSpace-Session: [a76c444cf976f1910c78069d7419792904c754f609960bb098a09a8367c78de2] - method: POST - uri: http://localhost:8089/repositories/2/archival_objects - response: - body: {string: '{"status":"Created","id":29,"lock_version":0,"stale":true,"uri":"/repositories/2/archival_objects/29","warnings":[]} - -'} - headers: - Cache-Control: ['private, must-revalidate, max-age=0'] - Content-Length: ['117'] - Content-Type: [application/json] - Date: ['Mon, 01 Feb 2016 19:57:27 GMT'] - Server: [Jetty(8.1.5.v20120716)] - X-Content-Type-Options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.9.1] - X-ArchivesSpace-Session: [a76c444cf976f1910c78069d7419792904c754f609960bb098a09a8367c78de2] - method: GET - uri: http://localhost:8089/repositories/2/archival_objects/29 - response: - body: {string: '{"lock_version":0,"position":12,"ref_id":"f25dbd797433c55e35869f7341b65b34","title":"Test - child","display_string":"Test child","restrictions_apply":false,"created_by":"admin","last_modified_by":"admin","create_time":"2016-02-01T19:57:28Z","system_mtime":"2016-02-01T19:57:28Z","user_mtime":"2016-02-01T19:57:28Z","suppressed":false,"level":"recordgrp","jsonmodel_type":"archival_object","external_ids":[],"subjects":[],"linked_events":[],"extents":[],"dates":[],"external_documents":[],"rights_statements":[],"linked_agents":[],"instances":[],"notes":[],"uri":"/repositories/2/archival_objects/29","repository":{"ref":"/repositories/2"},"resource":{"ref":"/repositories/2/resources/1"},"has_unpublished_ancestor":true} - -'} - headers: - Cache-Control: ['private, must-revalidate, max-age=0'] - Content-Length: ['719'] - Content-Type: [application/json] - Date: ['Mon, 01 Feb 2016 19:57:28 GMT'] - Server: [Jetty(8.1.5.v20120716)] - X-Content-Type-Options: [nosniff] - status: {code: 200, message: OK} -version: 1 diff --git a/tests/fixtures/test_posting_multiple_notes.yaml b/tests/fixtures/test_posting_multiple_notes.yaml deleted file mode 100644 index adc9b05..0000000 --- a/tests/fixtures/test_posting_multiple_notes.yaml +++ /dev/null @@ -1,104 +0,0 @@ -interactions: -- request: - body: !!binary | - ZXhwaXJpbmc9RmFsc2UmcGFzc3dvcmQ9YWRtaW4= - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['29'] - Content-Type: [application/x-www-form-urlencoded] - User-Agent: [python-requests/2.9.1] - method: POST - uri: http://localhost:8089/users/admin/login - response: - body: {string: '{"session":"4adb3e9ec9d6136fd9cd238ea90df00d455a3b3b07b278265eb0ba8a8ef7cf81","user":{"lock_version":1033,"username":"admin","name":"Administrator","is_system_user":true,"create_time":"2015-06-11T17:04:21Z","system_mtime":"2016-02-11T00:05:10Z","user_mtime":"2016-02-11T00:05:10Z","jsonmodel_type":"user","groups":[],"is_admin":true,"uri":"/users/1","agent_record":{"ref":"/agents/people/1"},"permissions":{"/repositories/1":["update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record","administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed"],"_archivesspace":["administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed","update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record"]}}} - -'} - headers: - Cache-Control: ['private, must-revalidate, max-age=0'] - Content-Length: ['2207'] - Content-Type: [application/json] - Date: ['Thu, 11 Feb 2016 00:05:09 GMT'] - Server: [Jetty(8.1.5.v20120716)] - X-Content-Type-Options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.9.1] - X-ArchivesSpace-Session: [4adb3e9ec9d6136fd9cd238ea90df00d455a3b3b07b278265eb0ba8a8ef7cf81] - method: GET - uri: http://localhost:8089/repositories/2/resources/1 - response: - body: {string: '{"lock_version":11,"title":"Test fonds","publish":false,"restrictions":false,"created_by":"admin","last_modified_by":"admin","create_time":"2015-06-11T17:08:42Z","system_mtime":"2015-12-03T00:03:41Z","user_mtime":"2015-12-03T00:03:41Z","suppressed":false,"id_0":"F1","language":"eng","level":"fonds","jsonmodel_type":"resource","external_ids":[],"subjects":[],"linked_events":[],"extents":[{"lock_version":0,"number":"1","created_by":"admin","last_modified_by":"admin","create_time":"2015-12-03T00:03:42Z","system_mtime":"2015-12-03T00:03:42Z","user_mtime":"2015-12-03T00:03:42Z","portion":"whole","extent_type":"cassettes","jsonmodel_type":"extent"}],"dates":[{"lock_version":0,"begin":"2015-01-01","created_by":"admin","last_modified_by":"admin","create_time":"2015-12-03T00:03:42Z","system_mtime":"2015-12-03T00:03:42Z","user_mtime":"2015-12-03T00:03:42Z","date_type":"single","label":"creation","jsonmodel_type":"date"}],"external_documents":[],"rights_statements":[],"linked_agents":[],"instances":[],"deaccessions":[],"related_accessions":[{"ref":"/repositories/2/accessions/1"}],"notes":[{"content":["Singlepart - note"],"type":"physdesc","jsonmodel_type":"note_singlepart","persistent_id":"cdc013c483de98b8a1762302faf8fd32","publish":true}],"uri":"/repositories/2/resources/1","repository":{"ref":"/repositories/2"},"tree":{"ref":"/repositories/2/resources/1/tree"}} - -'} - headers: - Cache-Control: ['private, must-revalidate, max-age=0'] - Content-Length: ['1373'] - Content-Type: [application/json] - Date: ['Thu, 11 Feb 2016 00:05:10 GMT'] - Server: [Jetty(8.1.5.v20120716)] - X-Content-Type-Options: [nosniff] - status: {code: 200, message: OK} -- request: - body: !!binary | - eyJsZXZlbCI6ICJyZWNvcmRncnAiLCAicmVzb3VyY2UiOiB7InJlZiI6ICIvcmVwb3NpdG9yaWVz - LzIvcmVzb3VyY2VzLzEifSwgInRpdGxlIjogIlRlc3QgY2hpbGQiLCAianNvbm1vZGVsX3R5cGUi - OiAiYXJjaGl2YWxfb2JqZWN0IiwgIm5vdGVzIjogW3sic3Vibm90ZXMiOiBbeyJjb250ZW50Ijog - IkdlbmVyYWwiLCAianNvbm1vZGVsX3R5cGUiOiAibm90ZV90ZXh0IiwgInB1Ymxpc2giOiB0cnVl - fV0sICJqc29ubW9kZWxfdHlwZSI6ICJub3RlX211bHRpcGFydCIsICJwdWJsaXNoIjogdHJ1ZSwg - InR5cGUiOiAib2RkIn0sIHsic3Vibm90ZXMiOiBbeyJjb250ZW50IjogIkFjY2VzcyIsICJqc29u - bW9kZWxfdHlwZSI6ICJub3RlX3RleHQiLCAicHVibGlzaCI6IHRydWV9XSwgImpzb25tb2RlbF90 - eXBlIjogIm5vdGVfbXVsdGlwYXJ0IiwgInB1Ymxpc2giOiB0cnVlLCAidHlwZSI6ICJhY2Nlc3Ny - ZXN0cmljdCJ9XX0= - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['467'] - User-Agent: [python-requests/2.9.1] - X-ArchivesSpace-Session: [4adb3e9ec9d6136fd9cd238ea90df00d455a3b3b07b278265eb0ba8a8ef7cf81] - method: POST - uri: http://localhost:8089/repositories/2/archival_objects - response: - body: {string: '{"status":"Created","id":35,"lock_version":0,"stale":true,"uri":"/repositories/2/archival_objects/35","warnings":[]} - -'} - headers: - Cache-Control: ['private, must-revalidate, max-age=0'] - Content-Length: ['117'] - Content-Type: [application/json] - Date: ['Thu, 11 Feb 2016 00:05:10 GMT'] - Server: [Jetty(8.1.5.v20120716)] - X-Content-Type-Options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.9.1] - X-ArchivesSpace-Session: [4adb3e9ec9d6136fd9cd238ea90df00d455a3b3b07b278265eb0ba8a8ef7cf81] - method: GET - uri: http://localhost:8089/repositories/2/archival_objects/35 - response: - body: {string: '{"lock_version":0,"position":16,"ref_id":"4d6631016cc84c7cc58b46119585df5d","title":"Test - child","display_string":"Test child","restrictions_apply":false,"created_by":"admin","last_modified_by":"admin","create_time":"2016-02-11T00:05:10Z","system_mtime":"2016-02-11T00:05:10Z","user_mtime":"2016-02-11T00:05:10Z","suppressed":false,"level":"recordgrp","jsonmodel_type":"archival_object","external_ids":[],"subjects":[],"linked_events":[],"extents":[],"dates":[],"external_documents":[],"rights_statements":[],"linked_agents":[],"instances":[],"notes":[{"subnotes":[{"content":"General","jsonmodel_type":"note_text","publish":true}],"jsonmodel_type":"note_multipart","type":"odd","persistent_id":"d3587a0e5a752b31858fca9a5d6d499c","publish":true},{"subnotes":[{"content":"Access","jsonmodel_type":"note_text","publish":true}],"jsonmodel_type":"note_multipart","type":"accessrestrict","persistent_id":"81b79e0152596bd5e4b6e89ab30e8ccb","publish":true}],"uri":"/repositories/2/archival_objects/35","repository":{"ref":"/repositories/2"},"resource":{"ref":"/repositories/2/resources/1"},"has_unpublished_ancestor":true} - -'} - headers: - Cache-Control: ['private, must-revalidate, max-age=0'] - Content-Length: ['1116'] - Content-Type: [application/json] - Date: ['Thu, 11 Feb 2016 00:05:10 GMT'] - Server: [Jetty(8.1.5.v20120716)] - X-Content-Type-Options: [nosniff] - status: {code: 200, message: OK} -version: 1 diff --git a/tests/fixtures/test_resource_type.yaml b/tests/fixtures/test_resource_type.yaml deleted file mode 100644 index a96b397..0000000 --- a/tests/fixtures/test_resource_type.yaml +++ /dev/null @@ -1,24 +0,0 @@ -interactions: -- request: - body: password=admin - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Content-Length: ['14'] - Content-Type: [application/x-www-form-urlencoded] - User-Agent: [python-requests/2.3.0 CPython/2.7.10 Darwin/14.4.0] - method: POST - uri: http://localhost:8089/users/admin/login - response: - body: {string: !!python/unicode '{"session":"aee48628790858481963be28725c8023a0d4c8c01e3911ce5ca5ae74ad9f7501","user":{"lock_version":27,"username":"admin","name":"Administrator","is_system_user":true,"create_time":"2015-06-11T17:04:21Z","system_mtime":"2015-07-15T19:12:18Z","user_mtime":"2015-07-15T19:12:18Z","jsonmodel_type":"user","groups":[],"is_admin":true,"uri":"/users/1","agent_record":{"ref":"/agents/people/1"},"permissions":{"/repositories/1":["update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record","administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed"],"_archivesspace":["administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed","update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record"]}}} - -'} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['2205'] - content-type: [application/json] - date: ['Wed, 15 Jul 2015 19:12:17 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -version: 1 diff --git a/tests/fixtures/test_singlepart_note.yaml b/tests/fixtures/test_singlepart_note.yaml deleted file mode 100644 index 962eedc..0000000 --- a/tests/fixtures/test_singlepart_note.yaml +++ /dev/null @@ -1,109 +0,0 @@ -interactions: -- request: - body: expiring=False&password=admin - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Content-Length: ['29'] - Content-Type: [application/x-www-form-urlencoded] - User-Agent: [python-requests/2.8.1] - method: POST - uri: http://localhost:8089/users/admin/login - response: - body: {string: !!python/unicode '{"session":"958640d703ed8dd063b518f825cc4f4206ec86f049837099257471065e936f02","user":{"lock_version":700,"username":"admin","name":"Administrator","is_system_user":true,"create_time":"2015-06-11T17:04:21Z","system_mtime":"2015-12-03T00:08:07Z","user_mtime":"2015-12-03T00:08:07Z","jsonmodel_type":"user","groups":[],"is_admin":true,"uri":"/users/1","agent_record":{"ref":"/agents/people/1"},"permissions":{"/repositories/1":["update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record","administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed"],"_archivesspace":["administer_system","become_user","cancel_importer_job","create_repository","delete_archival_record","delete_classification_record","delete_event_record","delete_repository","import_records","index_system","manage_agent_record","manage_repository","manage_subject_record","manage_users","manage_vocabulary_record","mediate_edits","merge_agents_and_subjects","merge_archival_record","suppress_archival_record","system_config","transfer_archival_record","transfer_repository","update_accession_record","update_classification_record","update_digital_object_record","update_event_record","update_resource_record","view_all_records","view_repository","view_suppressed","update_location_record","delete_vocabulary_record","update_subject_record","delete_subject_record","update_agent_record","delete_agent_record","update_vocabulary_record","merge_subject_record","merge_agent_record"]}}} - -'} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['2206'] - content-type: [application/json] - date: ['Thu, 03 Dec 2015 00:08:06 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.8.1] - X-ArchivesSpace-Session: [!!python/unicode 958640d703ed8dd063b518f825cc4f4206ec86f049837099257471065e936f02] - method: GET - uri: http://localhost:8089/repositories/2/search?q=primary_type%3Aresource&page=1&page_size=30 - response: - body: {string: !!python/unicode '{"first_page":1,"last_page":1,"this_page":1,"offset_first":1,"offset_last":2,"total_hits":2,"results":[{"id":"/repositories/2/resources/2","title":"Some - other fonds","primary_type":"resource","types":["resource"],"json":"{\"lock_version\":4,\"title\":\"Some - other fonds\",\"publish\":false,\"restrictions\":false,\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-06-30T23:17:57Z\",\"system_mtime\":\"2015-12-02T01:05:21Z\",\"user_mtime\":\"2015-12-02T01:05:21Z\",\"suppressed\":false,\"id_0\":\"F2\",\"level\":\"fonds\",\"jsonmodel_type\":\"resource\",\"external_ids\":[],\"subjects\":[],\"linked_events\":[],\"extents\":[{\"lock_version\":0,\"number\":\"1\",\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-12-02T01:05:21Z\",\"system_mtime\":\"2015-12-02T01:05:21Z\",\"user_mtime\":\"2015-12-02T01:05:21Z\",\"portion\":\"whole\",\"extent_type\":\"cassettes\",\"jsonmodel_type\":\"extent\"}],\"dates\":[{\"lock_version\":0,\"begin\":\"2015-06-29\",\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-12-02T01:05:21Z\",\"system_mtime\":\"2015-12-02T01:05:21Z\",\"user_mtime\":\"2015-12-02T01:05:21Z\",\"date_type\":\"bulk\",\"label\":\"creation\",\"jsonmodel_type\":\"date\"}],\"external_documents\":[],\"rights_statements\":[],\"linked_agents\":[],\"instances\":[{\"lock_version\":0,\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-12-02T01:05:21Z\",\"system_mtime\":\"2015-12-02T01:05:21Z\",\"user_mtime\":\"2015-12-02T01:05:21Z\",\"instance_type\":\"digital_object\",\"jsonmodel_type\":\"instance\",\"digital_object\":{\"ref\":\"/repositories/2/digital_objects/3\",\"_resolved\":{\"lock_version\":4,\"digital_object_id\":\"f808032e-c6ec-4242-b7aa-5395988b9f7e\",\"title\":\"test\",\"restrictions\":false,\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-12-02T00:55:38Z\",\"system_mtime\":\"2015-12-02T01:05:22Z\",\"user_mtime\":\"2015-12-02T00:55:38Z\",\"suppressed\":false,\"digital_object_type\":\"text\",\"jsonmodel_type\":\"digital_object\",\"external_ids\":[],\"subjects\":[],\"linked_events\":[],\"extents\":[],\"dates\":[],\"external_documents\":[],\"rights_statements\":[],\"linked_agents\":[],\"file_versions\":[],\"notes\":[{\"content\":[\"test\"],\"type\":\"originalsloc\",\"jsonmodel_type\":\"note_digital_object\",\"persistent_id\":\"4e5eec95fcb62440f20a4f5b89c6d16b\",\"publish\":true}],\"linked_instances\":[{\"ref\":\"/repositories/2/resources/2\"}],\"uri\":\"/repositories/2/digital_objects/3\",\"repository\":{\"ref\":\"/repositories/2\"},\"tree\":{\"ref\":\"/repositories/2/digital_objects/3/tree\"}}}},{\"lock_version\":0,\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-12-02T01:05:22Z\",\"system_mtime\":\"2015-12-02T01:05:22Z\",\"user_mtime\":\"2015-12-02T01:05:22Z\",\"instance_type\":\"digital_object\",\"jsonmodel_type\":\"instance\",\"digital_object\":{\"ref\":\"/repositories/2/digital_objects/4\",\"_resolved\":{\"lock_version\":3,\"digital_object_id\":\"5517ddb1-36dd-4a02-a363-f1571982670f\",\"title\":\"test\",\"restrictions\":false,\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-12-02T00:55:53Z\",\"system_mtime\":\"2015-12-02T01:05:22Z\",\"user_mtime\":\"2015-12-02T00:55:53Z\",\"suppressed\":false,\"digital_object_type\":\"text\",\"jsonmodel_type\":\"digital_object\",\"external_ids\":[],\"subjects\":[],\"linked_events\":[],\"extents\":[],\"dates\":[],\"external_documents\":[],\"rights_statements\":[],\"linked_agents\":[],\"file_versions\":[],\"notes\":[{\"content\":[\"test\"],\"type\":\"originalsloc\",\"jsonmodel_type\":\"note_digital_object\",\"persistent_id\":\"bdfe911944a3d26a9fd43455aa968c52\",\"publish\":true}],\"linked_instances\":[{\"ref\":\"/repositories/2/resources/2\"}],\"uri\":\"/repositories/2/digital_objects/4\",\"repository\":{\"ref\":\"/repositories/2\"},\"tree\":{\"ref\":\"/repositories/2/digital_objects/4/tree\"}}}},{\"lock_version\":0,\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-12-02T01:05:22Z\",\"system_mtime\":\"2015-12-02T01:05:22Z\",\"user_mtime\":\"2015-12-02T01:05:22Z\",\"instance_type\":\"digital_object\",\"jsonmodel_type\":\"instance\",\"digital_object\":{\"ref\":\"/repositories/2/digital_objects/5\",\"_resolved\":{\"lock_version\":2,\"digital_object_id\":\"8ea81c4d-6df3-4775-a314-4bef4f44dd3c\",\"title\":\"Some - other fonds\",\"restrictions\":false,\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-12-02T01:04:57Z\",\"system_mtime\":\"2015-12-02T01:05:22Z\",\"user_mtime\":\"2015-12-02T01:04:57Z\",\"suppressed\":false,\"digital_object_type\":\"text\",\"jsonmodel_type\":\"digital_object\",\"external_ids\":[],\"subjects\":[],\"linked_events\":[],\"extents\":[],\"dates\":[],\"external_documents\":[],\"rights_statements\":[],\"linked_agents\":[],\"file_versions\":[],\"notes\":[{\"content\":[\"test\"],\"type\":\"originalsloc\",\"jsonmodel_type\":\"note_digital_object\",\"persistent_id\":\"68242ba5c0cbff4b674c6a2fa2335ad0\",\"publish\":true}],\"linked_instances\":[{\"ref\":\"/repositories/2/resources/2\"}],\"uri\":\"/repositories/2/digital_objects/5\",\"repository\":{\"ref\":\"/repositories/2\"},\"tree\":{\"ref\":\"/repositories/2/digital_objects/5/tree\"}}}},{\"lock_version\":0,\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-12-02T01:05:22Z\",\"system_mtime\":\"2015-12-02T01:05:22Z\",\"user_mtime\":\"2015-12-02T01:05:22Z\",\"instance_type\":\"digital_object\",\"jsonmodel_type\":\"instance\",\"digital_object\":{\"ref\":\"/repositories/2/digital_objects/6\",\"_resolved\":{\"lock_version\":1,\"digital_object_id\":\"a1672927-9a56-41c4-b423-5d76e4a1c660\",\"title\":\"Some - other fonds\",\"restrictions\":false,\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-12-02T01:05:21Z\",\"system_mtime\":\"2015-12-02T01:05:22Z\",\"user_mtime\":\"2015-12-02T01:05:21Z\",\"suppressed\":false,\"digital_object_type\":\"text\",\"jsonmodel_type\":\"digital_object\",\"external_ids\":[],\"subjects\":[],\"linked_events\":[],\"extents\":[],\"dates\":[],\"external_documents\":[],\"rights_statements\":[],\"linked_agents\":[],\"file_versions\":[],\"notes\":[{\"content\":[\"test\"],\"type\":\"originalsloc\",\"jsonmodel_type\":\"note_digital_object\",\"persistent_id\":\"3453d8096aabc607723b4359ab8fdd3c\",\"publish\":true}],\"linked_instances\":[{\"ref\":\"/repositories/2/resources/2\"}],\"uri\":\"/repositories/2/digital_objects/6\",\"repository\":{\"ref\":\"/repositories/2\"},\"tree\":{\"ref\":\"/repositories/2/digital_objects/6/tree\"}}}}],\"deaccessions\":[],\"related_accessions\":[],\"notes\":[],\"uri\":\"/repositories/2/resources/2\",\"repository\":{\"ref\":\"/repositories/2\"},\"tree\":{\"ref\":\"/repositories/2/resources/2/tree\"}}","suppressed":false,"publish":false,"system_generated":false,"repository":"/repositories/2","created_by":"admin","last_modified_by":"admin","user_mtime":"2015-12-02T01:05:21Z","system_mtime":"2015-12-02T01:05:21Z","create_time":"2015-06-30T23:17:57Z","level":"fonds","identifier":"F2","restrictions":"false","four_part_id":"F2","uri":"/repositories/2/resources/2","jsonmodel_type":"resource"},{"id":"/repositories/2/resources/1","title":"Test - fonds","primary_type":"resource","types":["resource"],"json":"{\"lock_version\":11,\"title\":\"Test - fonds\",\"publish\":false,\"restrictions\":false,\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-06-11T17:08:42Z\",\"system_mtime\":\"2015-12-03T00:03:41Z\",\"user_mtime\":\"2015-12-03T00:03:41Z\",\"suppressed\":false,\"id_0\":\"F1\",\"language\":\"eng\",\"level\":\"fonds\",\"jsonmodel_type\":\"resource\",\"external_ids\":[],\"subjects\":[],\"linked_events\":[],\"extents\":[{\"lock_version\":0,\"number\":\"1\",\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-12-03T00:03:42Z\",\"system_mtime\":\"2015-12-03T00:03:42Z\",\"user_mtime\":\"2015-12-03T00:03:42Z\",\"portion\":\"whole\",\"extent_type\":\"cassettes\",\"jsonmodel_type\":\"extent\"}],\"dates\":[{\"lock_version\":0,\"begin\":\"2015-01-01\",\"created_by\":\"admin\",\"last_modified_by\":\"admin\",\"create_time\":\"2015-12-03T00:03:42Z\",\"system_mtime\":\"2015-12-03T00:03:42Z\",\"user_mtime\":\"2015-12-03T00:03:42Z\",\"date_type\":\"single\",\"label\":\"creation\",\"jsonmodel_type\":\"date\"}],\"external_documents\":[],\"rights_statements\":[],\"linked_agents\":[],\"instances\":[],\"deaccessions\":[],\"related_accessions\":[{\"ref\":\"/repositories/2/accessions/1\"}],\"notes\":[{\"content\":[\"Singlepart - note\"],\"type\":\"physdesc\",\"jsonmodel_type\":\"note_singlepart\",\"persistent_id\":\"cdc013c483de98b8a1762302faf8fd32\",\"publish\":true}],\"uri\":\"/repositories/2/resources/1\",\"repository\":{\"ref\":\"/repositories/2\"},\"tree\":{\"ref\":\"/repositories/2/resources/1/tree\"}}","suppressed":false,"publish":false,"system_generated":false,"repository":"/repositories/2","created_by":"admin","last_modified_by":"admin","user_mtime":"2015-12-03T00:03:41Z","system_mtime":"2015-12-03T00:03:41Z","create_time":"2015-06-11T17:08:42Z","level":"fonds","identifier":"F1","language":"eng","restrictions":"false","four_part_id":"F1","uri":"/repositories/2/resources/1","jsonmodel_type":"resource"}],"facets":{"facet_queries":{},"facet_fields":{},"facet_dates":{},"facet_ranges":{}}} - -'} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['9418'] - content-type: [application/json] - date: ['Thu, 03 Dec 2015 00:08:07 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.8.1] - X-ArchivesSpace-Session: [!!python/unicode 958640d703ed8dd063b518f825cc4f4206ec86f049837099257471065e936f02] - method: GET - uri: http://localhost:8089/repositories/2/resources/2/tree?page=1 - response: - body: {string: !!python/unicode '{"title":"Some other fonds","id":2,"node_type":"resource","publish":false,"suppressed":false,"children":[{"title":"New - resource child","id":12,"record_uri":"/repositories/2/archival_objects/12","publish":false,"suppressed":false,"node_type":"archival_object","level":"series","has_children":false,"children":[],"instance_types":[],"containers":[]}],"record_uri":"/repositories/2/resources/2","level":"fonds","jsonmodel_type":"resource_tree","instance_types":[],"containers":[]} - -'} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['478'] - content-type: [application/json] - date: ['Thu, 03 Dec 2015 00:08:07 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [python-requests/2.8.1] - X-ArchivesSpace-Session: [!!python/unicode 958640d703ed8dd063b518f825cc4f4206ec86f049837099257471065e936f02] - method: GET - uri: http://localhost:8089/repositories/2/resources/1/tree?page=1 - response: - body: {string: !!python/unicode '{"title":"Test fonds","id":1,"node_type":"resource","publish":false,"suppressed":false,"children":[{"title":"Test - series","id":1,"record_uri":"/repositories/2/archival_objects/1","publish":false,"suppressed":false,"node_type":"archival_object","level":"series","has_children":true,"children":[{"title":"Test - edited subseries, November, 2014 to November, 2015","id":3,"record_uri":"/repositories/2/archival_objects/3","publish":false,"suppressed":false,"node_type":"archival_object","level":"subseries","has_children":true,"children":[{"title":"Test - file","id":4,"record_uri":"/repositories/2/archival_objects/4","publish":false,"suppressed":false,"node_type":"archival_object","level":"file","has_children":false,"children":[],"instance_types":[],"containers":[]}],"instance_types":[],"containers":[]},{"title":"New - new new child","id":10,"record_uri":"/repositories/2/archival_objects/10","publish":false,"suppressed":false,"node_type":"archival_object","level":"series","has_children":false,"children":[],"instance_types":[],"containers":[]}],"instance_types":[],"containers":[]},{"title":"Test - series 2","id":2,"record_uri":"/repositories/2/archival_objects/2","publish":false,"suppressed":false,"node_type":"archival_object","level":"series","has_children":false,"children":[],"instance_types":[],"containers":[]},{"title":"Test - new child","id":13,"record_uri":"/repositories/2/archival_objects/13","publish":false,"suppressed":false,"node_type":"archival_object","level":"series","has_children":false,"children":[],"instance_types":[],"containers":[]},{"title":"Test - new child 2","id":14,"record_uri":"/repositories/2/archival_objects/14","publish":false,"suppressed":false,"node_type":"archival_object","level":"item","has_children":false,"children":[],"instance_types":[],"containers":[]},{"title":"Test - new child 3","id":16,"record_uri":"/repositories/2/archival_objects/16","publish":false,"suppressed":false,"node_type":"archival_object","level":"class","has_children":false,"children":[],"instance_types":[],"containers":[]},{"title":"New - child with note","id":17,"record_uri":"/repositories/2/archival_objects/17","publish":false,"suppressed":false,"node_type":"archival_object","level":"class","has_children":false,"children":[],"instance_types":[],"containers":[]},{"title":"New - child final","id":18,"record_uri":"/repositories/2/archival_objects/18","publish":false,"suppressed":false,"node_type":"archival_object","level":null,"has_children":false,"children":[],"instance_types":[],"containers":[]}],"record_uri":"/repositories/2/resources/1","level":"fonds","jsonmodel_type":"resource_tree","instance_types":[],"containers":[]} - -'} - headers: - cache-control: ['private, must-revalidate, max-age=0'] - content-length: ['2645'] - content-type: [application/json] - date: ['Thu, 03 Dec 2015 00:08:07 GMT'] - server: [Jetty(8.1.5.v20120716)] - x-content-type-options: [nosniff] - status: {code: 200, message: OK} -version: 1 diff --git a/tests/test_archivesspace_client.py b/tests/test_archivesspace_client.py index 30fc127..5606a37 100644 --- a/tests/test_archivesspace_client.py +++ b/tests/test_archivesspace_client.py @@ -1,9 +1,10 @@ import collections +import json import os +from unittest import mock import pytest import requests -import vcr from agentarchives.archivesspace.client import ArchivesSpaceClient from agentarchives.archivesspace.client import ArchivesSpaceError @@ -58,15 +59,62 @@ def test_base_url_config(mocker, params, raises, base_url): assert client.base_url == base_url, f"Failed with params: {params}" -@vcr.use_cassette(os.path.join(THIS_DIR, "fixtures", "test_client_logout.yaml")) -def test_logout(): +SESSION_MOCK = mock.Mock(status_code=200, **{"json.return_value": {"session": "1"}}) + + +@mock.patch("requests.post", side_effect=[SESSION_MOCK]) +@mock.patch( + "requests.Session.post", + side_effect=[ + mock.Mock( + status_code=200, **{"json.return_value": {"status": "session_logged_out"}} + ), + ], +) +def test_logout(session_post, post): client = ArchivesSpaceClient(**AUTH) client.logout() assert client.session is None -@vcr.use_cassette(os.path.join(THIS_DIR, "fixtures", "test_listing_collections.yaml")) -def test_listing_collections(): +@mock.patch("requests.post", side_effect=[SESSION_MOCK]) +@mock.patch( + "requests.Session.get", + side_effect=[ + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "results": [ + { + "json": json.dumps( + { + "level": "fonds", + "notes": [], + "title": "Test fonds", + "uri": "/repositories/2/resources/1", + } + ), + }, + { + "json": json.dumps( + { + "level": "fonds", + "notes": [], + "title": "Some other fonds", + "uri": "/repositories/2/resources/1", + } + ), + }, + ], + } + }, + ), + mock.Mock(status_code=200, **{"json.return_value": {"children": []}}), + mock.Mock(status_code=200, **{"json.return_value": {"children": []}}), + ], +) +def test_listing_collections(get, post): client = ArchivesSpaceClient(**AUTH) collections = client.find_collections() assert len(collections) == 2 @@ -74,20 +122,93 @@ def test_listing_collections(): assert collections[0]["type"] == "resource" -# The cassette for this test contains a record with a singlepart note, which -# raised errors in a previous version of ArchivesSpaceClient. -@vcr.use_cassette(os.path.join(THIS_DIR, "fixtures", "test_singlepart_note.yaml")) -def test_rendering_record_containing_a_singlepart_note(): +@mock.patch("requests.post", side_effect=[SESSION_MOCK]) +@mock.patch( + "requests.Session.get", + side_effect=[ + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "results": [ + { + "json": json.dumps( + { + "level": "fonds", + "notes": [], + "title": "Some other fonds", + "uri": "/repositories/2/resources/2", + } + ), + }, + { + "json": json.dumps( + { + "level": "fonds", + "notes": [ + { + "content": ["Singlepart note"], + "jsonmodel_type": "note_singlepart", + "type": "physdesc", + } + ], + "title": "Test fonds", + "uri": "/repositories/2/resources/1", + } + ), + }, + ], + } + }, + ), + mock.Mock(status_code=200, **{"json.return_value": {"children": []}}), + mock.Mock(status_code=200, **{"json.return_value": {"children": []}}), + ], +) +def test_rendering_record_containing_a_singlepart_note(get, post): client = ArchivesSpaceClient(**AUTH) collections = client.find_collections() assert len(collections) == 2 assert collections[1]["notes"][0]["content"] == "Singlepart note" -@vcr.use_cassette( - os.path.join(THIS_DIR, "fixtures", "test_listing_collections_search.yaml") +@mock.patch("requests.post", side_effect=[SESSION_MOCK]) +@mock.patch( + "requests.Session.get", + side_effect=[ + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "results": [ + { + "json": json.dumps( + { + "level": "fonds", + "notes": [], + "title": "Test fonds", + "uri": "/repositories/2/resources/1", + } + ), + } + ], + } + }, + ), + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "children": [], + "node_type": "resource", + "title": "Test fonds", + } + }, + ), + mock.Mock(status_code=200, **{"json.return_value": {"results": []}}), + ], ) -def test_listing_collections_search(): +def test_listing_collections_search(get, post): client = ArchivesSpaceClient(**AUTH) collections = client.find_collections(search_pattern="Test fonds") assert len(collections) == 1 @@ -98,10 +219,33 @@ def test_listing_collections_search(): assert len(no_results) == 0 -@vcr.use_cassette( - os.path.join(THIS_DIR, "fixtures", "test_listing_collections_search_spaces.yaml") +@mock.patch("requests.post", side_effect=[SESSION_MOCK]) +@mock.patch( + "requests.Session.get", + side_effect=[ + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "results": [ + { + "json": json.dumps( + { + "level": "collection", + "notes": [], + "title": "Resource with spaces in the identifier", + "uri": "/repositories/2/resources/6", + } + ), + } + ], + } + }, + ), + mock.Mock(status_code=200, **{"json.return_value": {"children": []}}), + ], ) -def test_listing_collections_search_spaces(): +def test_listing_collections_search_spaces(get, post): client = ArchivesSpaceClient(**AUTH) collections = client.find_collections(identifier="2015044 Aa Ac") assert len(collections) == 1 @@ -109,10 +253,75 @@ def test_listing_collections_search_spaces(): assert collections[0]["levelOfDescription"] == "collection" -@vcr.use_cassette( - os.path.join(THIS_DIR, "fixtures", "test_listing_collections_sort.yaml") +@mock.patch("requests.post", side_effect=[SESSION_MOCK]) +@mock.patch( + "requests.Session.get", + side_effect=[ + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "results": [ + { + "json": json.dumps( + { + "level": "fonds", + "notes": [], + "title": "Some other fonds", + "uri": "/repositories/2/resources/2", + } + ), + }, + { + "json": json.dumps( + { + "level": "fonds", + "notes": [], + "title": "Test fonds", + "uri": "/repositories/2/resources/1", + } + ), + }, + ], + } + }, + ), + mock.Mock(status_code=200, **{"json.return_value": {"children": []}}), + mock.Mock(status_code=200, **{"json.return_value": {"children": []}}), + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "results": [ + { + "json": json.dumps( + { + "level": "fonds", + "notes": [], + "title": "Test fonds", + "uri": "/repositories/2/resources/1", + } + ), + }, + { + "json": json.dumps( + { + "level": "fonds", + "notes": [], + "title": "Some other fonds", + "uri": "/repositories/2/resources/2", + } + ), + }, + ], + } + }, + ), + mock.Mock(status_code=200, **{"json.return_value": {"children": []}}), + mock.Mock(status_code=200, **{"json.return_value": {"children": []}}), + ], ) -def test_listing_collections_sort(): +def test_listing_collections_sort(get, post): client = ArchivesSpaceClient(**AUTH) asc = client.find_collections(sort_by="asc") assert len(asc) == 2 @@ -125,8 +334,21 @@ def test_listing_collections_sort(): assert desc[0]["type"] == "resource" -@vcr.use_cassette(os.path.join(THIS_DIR, "fixtures", "test_find_resource_id.yaml")) -def test_find_resource_id(): +@mock.patch("requests.post", side_effect=[SESSION_MOCK]) +@mock.patch( + "requests.Session.get", + side_effect=[ + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "resource": {"ref": "/repositories/2/resources/1"} + } + }, + ) + ], +) +def test_find_resource_id(get, post): client = ArchivesSpaceClient(**AUTH) assert ( client.find_resource_id_for_component("/repositories/2/archival_objects/3") @@ -134,8 +356,29 @@ def test_find_resource_id(): ) -@vcr.use_cassette(os.path.join(THIS_DIR, "fixtures", "test_find_component_parent.yaml")) -def test_find_component_parent(): +@mock.patch("requests.post", side_effect=[SESSION_MOCK]) +@mock.patch( + "requests.Session.get", + side_effect=[ + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "parent": {"ref": "/repositories/2/archival_objects/1"} + } + }, + ), + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "resource": {"ref": "/repositories/2/resources/1"} + } + }, + ), + ], +) +def test_find_component_parent(get, post): client = ArchivesSpaceClient(**AUTH) type, id = client.find_parent_id_for_component("/repositories/2/archival_objects/3") @@ -147,10 +390,46 @@ def test_find_component_parent(): assert id == "/repositories/2/resources/1" -@vcr.use_cassette( - os.path.join(THIS_DIR, "fixtures", "test_find_resource_children.yaml") +@mock.patch("requests.post", side_effect=[SESSION_MOCK]) +@mock.patch( + "requests.Session.get", + side_effect=[ + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "children": [ + { + "children": [], + "level": "series", + "record_uri": "/repositories/2/archival_objects/1", + }, + { + "children": [], + "level": "series", + "record_uri": "/repositories/2/archival_objects/2", + }, + ], + "level": "fonds", + "record_uri": "/repositories/2/resources/1", + } + }, + ), + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "level": "fonds", + "notes": [], + "title": "Test fonds", + } + }, + ), + mock.Mock(status_code=200, **{"json.return_value": {"notes": []}}), + mock.Mock(status_code=200, **{"json.return_value": {"notes": []}}), + ], ) -def test_find_resource_children(): +def test_find_resource_children(get, post): client = ArchivesSpaceClient(**AUTH) data = client.get_resource_component_and_children("/repositories/2/resources/1") @@ -161,10 +440,48 @@ def test_find_resource_children(): assert data["type"] == "resource" -@vcr.use_cassette( - os.path.join(THIS_DIR, "fixtures", "test_find_resource_children_recursion.yaml") +@mock.patch("requests.post", side_effect=[SESSION_MOCK]) +@mock.patch( + "requests.Session.get", + side_effect=[ + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "children": [{"children": []}, {"children": []}], + "level": "fonds", + "record_uri": "/repositories/2/resources/1", + } + }, + ), + mock.Mock(status_code=200, **{"json.return_value": {"notes": []}}), + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "children": [ + { + "children": [], + "level": "series", + "record_uri": "/repositories/2/archival_objects/1", + }, + { + "children": [], + "level": "series", + "record_uri": "/repositories/2/archival_objects/2", + }, + ], + "level": "fonds", + "record_uri": "/repositories/2/resources/1", + } + }, + ), + mock.Mock(status_code=200, **{"json.return_value": {"notes": []}}), + mock.Mock(status_code=200, **{"json.return_value": {"notes": []}}), + mock.Mock(status_code=200, **{"json.return_value": {"notes": []}}), + ], ) -def test_find_resource_children_recursion_level(): +def test_find_resource_children_recursion_level(get, post): client = ArchivesSpaceClient(**AUTH) data = client.get_resource_component_and_children( "/repositories/2/resources/1", recurse_max_level=1 @@ -179,12 +496,36 @@ def test_find_resource_children_recursion_level(): assert data["has_children"] is True -@vcr.use_cassette( - os.path.join( - THIS_DIR, "fixtures", "test_find_resource_children_at_max_recursion_level.yaml" - ) +@mock.patch("requests.post", side_effect=[SESSION_MOCK]) +@mock.patch( + "requests.Session.get", + side_effect=[ + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "children": [ + { + "children": [ + { + "children": [], + "level": "subseries", + "record_uri": "/repositories/2/archival_objects/3", + }, + ], + "level": "series", + "record_uri": "/repositories/2/archival_objects/1", + }, + ], + "level": "fonds", + "record_uri": "/repositories/2/resources/1", + } + }, + ), + mock.Mock(status_code=200, **{"json.return_value": {"notes": []}}), + ], ) -def test_find_resource_children_at_max_recursion_level(): +def test_find_resource_children_at_max_recursion_level(get, post): client = ArchivesSpaceClient(**AUTH) record = client.get_resource_component_and_children( "/repositories/2/resources/1", recurse_max_level=1 @@ -193,14 +534,37 @@ def test_find_resource_children_at_max_recursion_level(): assert record["has_children"] is True -@vcr.use_cassette( - os.path.join( - THIS_DIR, - "fixtures", - "test_find_resource_component_children_at_max_recursion_level.yaml", - ) +@mock.patch("requests.post", side_effect=[SESSION_MOCK]) +@mock.patch( + "requests.Session.get", + side_effect=[ + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "level": "series", + "notes": [], + "resource": {"ref": "/repositories/2/resources/1"}, + "uri": "/repositories/2/archival_objects/1", + } + }, + ), + mock.Mock( + status_code=200, + **{ + "json.return_value": [ + { + "level": "subseries", + "notes": [], + "resource": {"ref": "/repositories/2/resources/1"}, + "uri": "/repositories/2/archival_objects/3", + }, + ] + }, + ), + ], ) -def test_find_resource_component_children_at_max_recursion_level(): +def test_find_resource_component_children_at_max_recursion_level(get, post): client = ArchivesSpaceClient(**AUTH) record = client.get_resource_component_and_children( "/repositories/2/archival_objects/1", recurse_max_level=1 @@ -209,40 +573,156 @@ def test_find_resource_component_children_at_max_recursion_level(): assert record["has_children"] is True -@vcr.use_cassette(os.path.join(THIS_DIR, "fixtures", "test_find_collection_ids.yaml")) -def test_find_collection_ids(): +@mock.patch("requests.post", side_effect=[SESSION_MOCK]) +@mock.patch( + "requests.Session.get", + side_effect=[ + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "first_page": 1, + "last_page": 1, + "offset_first": 1, + "offset_last": 2, + "results": [ + {"uri": "/repositories/2/resources/1"}, + {"uri": "/repositories/2/resources/2"}, + ], + "this_page": 1, + "total_hits": 2, + } + }, + ), + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "first_page": 1, + "last_page": 1, + "offset_first": 11, + "offset_last": 2, + "results": [], + "this_page": 2, + "total_hits": 2, + } + }, + ), + ], +) +def test_find_collection_ids(get, post): client = ArchivesSpaceClient(**AUTH) ids = client.find_collection_ids() assert ids == ["/repositories/2/resources/1", "/repositories/2/resources/2"] -@vcr.use_cassette( - os.path.join(THIS_DIR, "fixtures", "test_find_collection_ids_search.yaml") +@mock.patch("requests.post", side_effect=[SESSION_MOCK]) +@mock.patch( + "requests.Session.get", + side_effect=[ + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "first_page": 1, + "last_page": 1, + "offset_first": 1, + "offset_last": 1, + "results": [{"uri": "/repositories/2/resources/2"}], + "this_page": 1, + "total_hits": 1, + } + }, + ) + ], ) -def test_find_collection_ids_search(): +def test_find_collection_ids_search(get, post): client = ArchivesSpaceClient(**AUTH) ids = client.find_collection_ids(search_pattern="Some") assert ids == ["/repositories/2/resources/2"] -@vcr.use_cassette(os.path.join(THIS_DIR, "fixtures", "test_count_collection_ids.yaml")) -def test_count_collection_ids(): +@mock.patch("requests.post", side_effect=[SESSION_MOCK]) +@mock.patch( + "requests.Session.get", + side_effect=[ + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "first_page": 1, + "last_page": 1, + "offset_first": 1, + "offset_last": 2, + "results": [ + {"uri": "/repositories/2/resources/1"}, + {"uri": "/repositories/2/resources/2"}, + ], + "this_page": 1, + "total_hits": 2, + } + }, + ) + ], +) +def test_count_collection_ids(get, post): client = ArchivesSpaceClient(**AUTH) ids = client.count_collections() assert ids == 2 -@vcr.use_cassette( - os.path.join(THIS_DIR, "fixtures", "test_count_collection_ids_search.yaml") +@mock.patch("requests.post", side_effect=[SESSION_MOCK]) +@mock.patch( + "requests.Session.get", + side_effect=[ + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "first_page": 1, + "last_page": 1, + "offset_first": 1, + "offset_last": 1, + "results": [{"uri": "/repositories/2/resources/2"}], + "this_page": 1, + "total_hits": 1, + } + }, + ) + ], ) -def test_count_collection_ids_search(): +def test_count_collection_ids_search(get, post): client = ArchivesSpaceClient(**AUTH) ids = client.count_collections(search_pattern="Some") assert ids == 1 -@vcr.use_cassette(os.path.join(THIS_DIR, "fixtures", "test_find_by_id_refid.yaml")) -def test_find_by_id_refid(): +@mock.patch("requests.post", side_effect=[SESSION_MOCK]) +@mock.patch( + "requests.Session.get", + side_effect=[ + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "archival_objects": [ + { + "ref": "/repositories/2/archival_objects/752250", + "_resolved": { + "level": "file", + "notes": [], + "ref_id": "a118514fab1b2ee6a7e9ad259e1de355", + "title": "Test AO", + "uri": "/repositories/2/archival_objects/752250", + }, + } + ] + } + }, + ) + ], +) +def test_find_by_id_refid(get, post): client = ArchivesSpaceClient(**AUTH) data = client.find_by_id( "archival_objects", "ref_id", "a118514fab1b2ee6a7e9ad259e1de355" @@ -256,8 +736,91 @@ def test_find_by_id_refid(): assert item["levelOfDescription"] == "file" -@vcr.use_cassette(os.path.join(THIS_DIR, "fixtures", "test_augment_ids.yaml")) -def test_augment_ids(): +@mock.patch("requests.post", side_effect=[SESSION_MOCK]) +@mock.patch( + "requests.Session.get", + side_effect=[ + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "children": [ + { + "children": [], + "level": "series", + "record_uri": "/repositories/2/archival_objects/1", + "title": "Test series", + }, + { + "children": [], + "level": "series", + "record_uri": "/repositories/2/archival_objects/2", + "title": "Test series 2", + }, + ], + "level": "fonds", + "title": "Test fonds", + "record_uri": "/repositories/2/resources/1", + } + }, + ), + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "notes": [], + "title": "Test fonds", + "uri": "/repositories/2/resources/1", + } + }, + ), + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "notes": [], + "resource": {"ref": "/repositories/2/resources/1"}, + "title": "Test series", + "uri": "/repositories/2/archival_objects/1", + } + }, + ), + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "notes": [], + "resource": {"ref": "/repositories/2/resources/1"}, + "title": "Test series 2", + "uri": "/repositories/2/archival_objects/2", + } + }, + ), + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "children": [], + "level": "fonds", + "record_uri": "/repositories/2/resources/2", + "title": "Some other fonds", + } + }, + ), + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "notes": [], + "repository": {"ref": "/repositories/2"}, + "title": "Some other fonds", + "uri": "/repositories/2/resources/2", + } + }, + ), + ], +) +def test_augment_ids(get, post): client = ArchivesSpaceClient(**AUTH) data = client.augment_resource_ids( ["/repositories/2/resources/1", "/repositories/2/resources/2"] @@ -269,8 +832,8 @@ def test_augment_ids(): assert data[1]["type"] == "resource" -@vcr.use_cassette(os.path.join(THIS_DIR, "fixtures", "test_resource_type.yaml")) -def test_get_resource_type(): +@mock.patch("requests.post", side_effect=[SESSION_MOCK]) +def test_get_resource_type(post): client = ArchivesSpaceClient(**AUTH) assert client.resource_type("/repositories/2/resources/2") == "resource" assert ( @@ -279,17 +842,67 @@ def test_get_resource_type(): ) -@vcr.use_cassette(os.path.join(THIS_DIR, "fixtures", "test_resource_type.yaml")) -def test_get_resource_type_raises_on_invalid_input(): +@mock.patch("requests.post", side_effect=[SESSION_MOCK]) +def test_get_resource_type_raises_on_invalid_input(post): client = ArchivesSpaceClient(**AUTH) with pytest.raises(ArchivesSpaceError): client.resource_type("invalid") -@vcr.use_cassette( - os.path.join(THIS_DIR, "fixtures", "test_identifier_exact_match.yaml") +@mock.patch("requests.post", side_effect=[SESSION_MOCK]) +@mock.patch( + "requests.Session.get", + side_effect=[ + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "first_page": 1, + "last_page": 1, + "offset_first": 1, + "offset_last": 1, + "results": [{"uri": "/repositories/2/resources/1"}], + "this_page": 1, + "total_hits": 1, + } + }, + ), + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "first_page": 1, + "last_page": 1, + "offset_first": 1, + "offset_last": 1, + "results": [{"uri": "/repositories/2/resources/1"}], + "this_page": 1, + "total_hits": 1, + } + }, + ), + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "results": [ + { + "json": json.dumps( + { + "level": "fonds", + "notes": [], + "uri": "/repositories/2/resources/1", + } + ), + } + ], + } + }, + ), + mock.Mock(status_code=200, **{"json.return_value": {"children": []}}), + ], ) -def test_identifier_search_exact_match(): +def test_identifier_search_exact_match(get, post): client = ArchivesSpaceClient(**AUTH) assert client.find_collection_ids(identifier="F1") == [ "/repositories/2/resources/1" @@ -298,8 +911,140 @@ def test_identifier_search_exact_match(): assert len(client.find_collections(identifier="F1")) == 1 -@vcr.use_cassette(os.path.join(THIS_DIR, "fixtures", "test_identifier_wildcard.yaml")) -def test_identifier_search_wildcard(): +@mock.patch("requests.post", side_effect=[SESSION_MOCK]) +@mock.patch( + "requests.Session.get", + side_effect=[ + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "first_page": 1, + "last_page": 0, + "offset_first": 1, + "offset_last": 0, + "results": [], + "this_page": 1, + "total_hits": 0, + } + }, + ), + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "first_page": 1, + "last_page": 0, + "offset_first": 1, + "offset_last": 0, + "results": [], + "this_page": 1, + "total_hits": 0, + } + }, + ), + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "first_page": 1, + "last_page": 0, + "offset_first": 1, + "offset_last": 0, + "results": [], + "this_page": 1, + "total_hits": 0, + } + }, + ), + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "first_page": 1, + "last_page": 1, + "offset_first": 1, + "offset_last": 2, + "results": [ + {"uri": "/repositories/2/resources/1"}, + {"uri": "/repositories/2/resources/2"}, + ], + "this_page": 1, + "total_hits": 2, + } + }, + ), + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "first_page": 1, + "last_page": 1, + "offset_first": 11, + "offset_last": 3, + "results": [], + "this_page": 2, + "total_hits": 3, + } + }, + ), + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "first_page": 1, + "last_page": 1, + "offset_first": 1, + "offset_last": 2, + "results": [ + {"uri": "/repositories/2/resources/1"}, + {"uri": "/repositories/2/resources/2"}, + ], + "this_page": 1, + "total_hits": 2, + } + }, + ), + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "first_page": 1, + "last_page": 1, + "offset_first": 1, + "offset_last": 2, + "results": [ + { + "json": json.dumps( + { + "level": "fonds", + "notes": [], + "uri": "/repositories/2/resources/1", + } + ), + "uri": "/repositories/2/resources/1", + }, + { + "json": json.dumps( + { + "level": "fonds", + "notes": [], + "uri": "/repositories/2/resources/2", + } + ), + "uri": "/repositories/2/resources/2", + }, + ], + "this_page": 1, + "total_hits": 2, + } + }, + ), + mock.Mock(status_code=200, **{"json.return_value": {"children": []}}), + mock.Mock(status_code=200, **{"json.return_value": {"children": []}}), + ], +) +def test_identifier_search_wildcard(get, post): client = ArchivesSpaceClient(**AUTH) # Searching for an identifier prefix with no wildcard returns nothing assert client.find_collection_ids(identifier="F") == [] @@ -314,8 +1059,33 @@ def test_identifier_search_wildcard(): assert len(client.find_collections(identifier="F*")) == 2 -@vcr.use_cassette(os.path.join(THIS_DIR, "fixtures", "test_add_child_resource.yaml")) -def test_add_child_resource(): +@mock.patch("requests.post", side_effect=[SESSION_MOCK]) +@mock.patch( + "requests.Session.post", + side_effect=[ + mock.Mock( + status_code=200, + **{"json.return_value": {"uri": "/repositories/2/archival_objects/3"}}, + ), + ], +) +@mock.patch( + "requests.Session.get", + side_effect=[ + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "level": "collection", + "notes": [], + "repository": {"ref": "/repositories/2"}, + "uri": "/repositories/2/resources/2", + } + }, + ) + ], +) +def test_add_child_resource(get, session_post, post): client = ArchivesSpaceClient(**AUTH) uri = client.add_child( "/repositories/2/resources/2", title="Test child", level="item" @@ -323,10 +1093,31 @@ def test_add_child_resource(): assert uri == "/repositories/2/archival_objects/3" -@vcr.use_cassette( - os.path.join(THIS_DIR, "fixtures", "test_add_child_resource_component.yaml") +@mock.patch("requests.post", side_effect=[SESSION_MOCK]) +@mock.patch( + "requests.Session.post", + side_effect=[ + mock.Mock( + status_code=200, + **{"json.return_value": {"uri": "/repositories/2/archival_objects/5"}}, + ) + ], ) -def test_add_child_resource_component(): +@mock.patch( + "requests.Session.get", + side_effect=[ + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "repository": {"ref": "/repositories/2"}, + "resource": {"ref": "/repositories/2/resources/2"}, + } + }, + ) + ], +) +def test_add_child_resource_component(get, session_post, post): client = ArchivesSpaceClient(**AUTH) uri = client.add_child( "/repositories/2/archival_objects/1", title="Test child", level="item" @@ -334,10 +1125,31 @@ def test_add_child_resource_component(): assert uri == "/repositories/2/archival_objects/5" -@vcr.use_cassette( - os.path.join(THIS_DIR, "fixtures", "test_adding_child_with_note.yaml") +@mock.patch("requests.post", side_effect=[SESSION_MOCK]) +@mock.patch( + "requests.Session.post", + side_effect=[ + mock.Mock( + status_code=200, + **{"json.return_value": {"uri": "/repositories/2/archival_objects/24"}}, + ) + ], ) -def test_adding_child_with_note(): +@mock.patch( + "requests.Session.get", + side_effect=[ + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "repository": {"ref": "/repositories/2"}, + "uri": "/repositories/2/resources/5", + } + }, + ) + ], +) +def test_adding_child_with_note(get, session_post, post): client = ArchivesSpaceClient(**AUTH) uri = client.add_child( "/repositories/2/resources/5", @@ -348,10 +1160,32 @@ def test_adding_child_with_note(): assert uri == "/repositories/2/archival_objects/24" -@vcr.use_cassette( - os.path.join(THIS_DIR, "fixtures", "test_posting_contentless_note.yaml") +@mock.patch("requests.post", side_effect=[SESSION_MOCK]) +@mock.patch( + "requests.Session.post", + side_effect=[ + mock.Mock( + status_code=200, + **{"json.return_value": {"uri": "/repositories/2/archival_objects/29"}}, + ) + ], +) +@mock.patch( + "requests.Session.get", + side_effect=[ + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "repository": {"ref": "/repositories/2"}, + "uri": "/repositories/2/resources/1", + } + }, + ), + mock.Mock(status_code=200, **{"json.return_value": {"notes": []}}), + ], ) -def test_posting_contentless_note(): +def test_posting_contentless_note(get, session_post, post): client = ArchivesSpaceClient(**AUTH) uri = client.add_child( "/repositories/2/resources/1", @@ -362,10 +1196,49 @@ def test_posting_contentless_note(): assert client.get_record(uri)["notes"] == [] -@vcr.use_cassette( - os.path.join(THIS_DIR, "fixtures", "test_posting_multiple_notes.yaml") +@mock.patch("requests.post", side_effect=[SESSION_MOCK]) +@mock.patch( + "requests.Session.post", + side_effect=[ + mock.Mock( + status_code=200, + **{"json.return_value": {"uri": "/repositories/2/archival_objects/35"}}, + ) + ], ) -def test_posting_multiple_notes(): +@mock.patch( + "requests.Session.get", + side_effect=[ + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "repository": {"ref": "/repositories/2"}, + "uri": "/repositories/2/resources/1", + } + }, + ), + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "notes": [ + { + "subnotes": [{"content": "General"}], + "type": "odd", + }, + { + "subnotes": [{"content": "Access"}], + "type": "accessrestrict", + }, + ], + "uri": "/repositories/2/archival_objects/35", + } + }, + ), + ], +) +def test_posting_multiple_notes(get, session_post, post): client = ArchivesSpaceClient(**AUTH) uri = client.add_child( "/repositories/2/resources/1", @@ -383,10 +1256,26 @@ def test_posting_multiple_notes(): assert record["notes"][1]["subnotes"][0]["content"] == "Access" -@vcr.use_cassette( - os.path.join(THIS_DIR, "fixtures", "test_delete_record_resource.yaml") +@mock.patch("requests.post", side_effect=[SESSION_MOCK]) +@mock.patch( + "requests.Session.get", + side_effect=[ + mock.Mock( + status_code=200, + **{"json.return_value": {"uri": "/repositories/2/resources/3"}}, + ), + mock.Mock( + status_code=404, **{"json.return_value": {"error": "Resource not found"}} + ), + ], ) -def test_delete_record_resource(): +@mock.patch( + "requests.Session.delete", + side_effect=[ + mock.Mock(status_code=200, **{"json.return_value": {"status": "Deleted"}}) + ], +) +def test_delete_record_resource(delete, get, post): client = ArchivesSpaceClient(**AUTH) record_id = "/repositories/2/resources/3" assert client.get_record(record_id) @@ -396,10 +1285,27 @@ def test_delete_record_resource(): client.get_record(record_id) -@vcr.use_cassette( - os.path.join(THIS_DIR, "fixtures", "test_delete_record_archival_object.yaml") +@mock.patch("requests.post", side_effect=[SESSION_MOCK]) +@mock.patch( + "requests.Session.get", + side_effect=[ + mock.Mock( + status_code=200, + **{"json.return_value": {"uri": "/repositories/2/archival_objects/4"}}, + ), + mock.Mock( + status_code=404, + **{"json.return_value": {"error": "ArchivalObject not found"}}, + ), + ], ) -def test_delete_record_archival_object(): +@mock.patch( + "requests.Session.delete", + side_effect=[ + mock.Mock(status_code=200, **{"json.return_value": {"status": "Deleted"}}) + ], +) +def test_delete_record_archival_object(delete, get, post): client = ArchivesSpaceClient(**AUTH) record_id = "/repositories/2/archival_objects/4" assert client.get_record(record_id) @@ -409,8 +1315,76 @@ def test_delete_record_archival_object(): client.get_record(record_id) -@vcr.use_cassette(os.path.join(THIS_DIR, "fixtures", "test_edit_archival_object.yaml")) -def test_edit_archival_object(): +@mock.patch("requests.post", side_effect=[SESSION_MOCK]) +@mock.patch( + "requests.Session.post", + side_effect=[ + mock.Mock( + status_code=200, + **{"json.return_value": {"uri": "/repositories/2/archival_objects/3"}}, + ) + ], +) +@mock.patch( + "requests.Session.get", + side_effect=[ + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "dates": [ + { + "begin": "2014-01-01", + "end": "2015-01-01", + } + ], + "notes": [], + "title": "Test subseries", + "uri": "/repositories/2/archival_objects/3", + } + }, + ), + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "dates": [ + { + "begin": "2014-01-01", + "end": "2015-01-01", + } + ], + "notes": [], + "title": "Test subseries", + "uri": "/repositories/2/archival_objects/3", + } + }, + ), + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "dates": [ + { + "begin": "2014-11-01", + "end": "2015-11-01", + "expression": "November, 2014 to November, 2015", + } + ], + "notes": [ + { + "subnotes": [{"content": "This is a test note"}], + "type": "odd", + } + ], + "title": "Test edited subseries", + "uri": "/repositories/2/archival_objects/3", + } + }, + ), + ], +) +def test_edit_archival_object(get, session_post, post): client = ArchivesSpaceClient(**AUTH) original = client.get_record("/repositories/2/archival_objects/3") assert original["title"] == "Test subseries" @@ -437,10 +1411,61 @@ def test_edit_archival_object(): ) -@vcr.use_cassette( - os.path.join(THIS_DIR, "fixtures", "test_edit_record_empty_note.yaml") +@mock.patch("requests.post", side_effect=[SESSION_MOCK]) +@mock.patch( + "requests.Session.post", + side_effect=[ + mock.Mock( + status_code=200, + **{"json.return_value": {"uri": "/repositories/2/archival_objects/3"}}, + ) + ], ) -def test_edit_record_empty_note(): +@mock.patch( + "requests.Session.get", + side_effect=[ + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "notes": [ + { + "subnotes": [{"content": "This is a test note"}], + "type": "odd", + } + ], + "uri": "/repositories/2/archival_objects/3", + } + }, + ), + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "dates": [ + { + "begin": "2014-11-01", + "end": "2015-11-01", + "expression": "November, 2014 to November, 2015", + } + ], + "notes": [], + "uri": "/repositories/2/archival_objects/3", + } + }, + ), + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "notes": [], + "uri": "/repositories/2/archival_objects/3", + } + }, + ), + ], +) +def test_edit_record_empty_note(get, session_post, post): client = ArchivesSpaceClient(**AUTH) original = client.get_record("/repositories/2/archival_objects/3") assert original["notes"] @@ -457,10 +1482,41 @@ def test_edit_record_empty_note(): assert not updated["notes"] -@vcr.use_cassette( - os.path.join(THIS_DIR, "fixtures", "test_edit_record_multiple_notes.yaml") +@mock.patch("requests.post", side_effect=[SESSION_MOCK]) +@mock.patch( + "requests.Session.post", + side_effect=[ + mock.Mock( + status_code=200, + **{"json.return_value": {"uri": "/repositories/2/archival_objects/9253"}}, + ) + ], ) -def test_edit_record_multiple_notes(): +@mock.patch( + "requests.Session.get", + side_effect=[ + mock.Mock(status_code=200, **{"json.return_value": {}}), + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "notes": [ + { + "subnotes": [{"content": "General note content"}], + "type": "odd", + }, + { + "subnotes": [{"content": "Access restriction note"}], + "type": "accessrestrict", + }, + ], + "uri": "/repositories/2/archival_objects/9253", + } + }, + ), + ], +) +def test_edit_record_multiple_notes(get, session_post, post): client = ArchivesSpaceClient(**AUTH) new_record = { "id": "/repositories/2/archival_objects/9253", @@ -484,8 +1540,39 @@ def test_edit_record_multiple_notes(): ) -@vcr.use_cassette(os.path.join(THIS_DIR, "fixtures", "test_add_digital_object.yaml")) -def test_add_digital_object(): +@mock.patch("requests.post", side_effect=[SESSION_MOCK]) +@mock.patch( + "requests.Session.post", + side_effect=[ + mock.Mock( + status_code=200, + **{"json.return_value": {"uri": "/repositories/2/digital_objects/8"}}, + ), + mock.Mock( + status_code=200, + **{"json.return_value": {"uri": "/repositories/2/archival_objects/3"}}, + ), + ], +) +@mock.patch( + "requests.Session.get", + side_effect=[ + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "instances": [], + "linked_agents": [], + "notes": [], + "repository": {"ref": "/repositories/2"}, + "subjects": [], + "uri": "/repositories/2/archival_objects/3", + } + }, + ) + ], +) +def test_add_digital_object(get, session_post, post): client = ArchivesSpaceClient(**AUTH) do = client.add_digital_object( "/repositories/2/archival_objects/3", @@ -495,10 +1582,53 @@ def test_add_digital_object(): assert do["id"] == "/repositories/2/digital_objects/8" -@vcr.use_cassette( - os.path.join(THIS_DIR, "fixtures", "test_add_digital_object_note.yaml") +@mock.patch("requests.post", side_effect=[SESSION_MOCK]) +@mock.patch( + "requests.Session.post", + side_effect=[ + mock.Mock( + status_code=200, + **{"json.return_value": {"uri": "/repositories/2/digital_objects/7"}}, + ), + mock.Mock( + status_code=200, + **{"json.return_value": {"uri": "/repositories/2/archival_objects/3"}}, + ), + ], +) +@mock.patch( + "requests.Session.get", + side_effect=[ + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "instances": [], + "linked_agents": [], + "notes": [], + "repository": {"ref": "/repositories/2"}, + "subjects": [], + "uri": "/repositories/2/archival_objects/3", + } + }, + ), + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "notes": [ + {"content": ["The ether"], "type": "originalsloc"}, + {"content": ["This is a test note"], "type": "note"}, + ], + "repository": {"ref": "/repositories/2"}, + "subjects": [], + "uri": "/repositories/2/digital_objects/7", + } + }, + ), + ], ) -def test_digital_object_with_location_of_originals_note(): +def test_digital_object_with_location_of_originals_note(get, session_post, post): client = ArchivesSpaceClient(**AUTH) do = client.add_digital_object( "/repositories/2/archival_objects/3", @@ -511,14 +1641,53 @@ def test_digital_object_with_location_of_originals_note(): assert note["type"] == "originalsloc" -@vcr.use_cassette( - os.path.join( - THIS_DIR, - "fixtures", - "test_adding_a_digital_object_to_a_record_with_a_singlepart_note.yaml", - ) +@mock.patch("requests.post", side_effect=[SESSION_MOCK]) +@mock.patch( + "requests.Session.post", + side_effect=[ + mock.Mock( + status_code=200, + **{"json.return_value": {"uri": "/repositories/2/digital_objects/9"}}, + ), + mock.Mock( + status_code=200, + **{"json.return_value": {"uri": "/repositories/2/archival_objects/21"}}, + ), + ], ) -def test_adding_a_digital_object_to_a_record_with_a_singlepart_note(): +@mock.patch( + "requests.Session.get", + side_effect=[ + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "instances": [], + "linked_agents": [], + "notes": [], + "repository": {"ref": "/repositories/2"}, + "subjects": [], + "uri": "/repositories/2/archival_objects/21", + } + }, + ), + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "linked_agents": [], + "notes": [{"content": ["This is an abstract"], "type": "note"}], + "repository": {"ref": "/repositories/2"}, + "subjects": [], + "uri": "/repositories/2/digital_objects/9", + } + }, + ), + ], +) +def test_adding_a_digital_object_to_a_record_with_a_singlepart_note( + get, session_post, post +): client = ArchivesSpaceClient(**AUTH) do = client.add_digital_object( "/repositories/2/archival_objects/21", @@ -529,10 +1698,35 @@ def test_adding_a_digital_object_to_a_record_with_a_singlepart_note(): assert len(note["content"]) == 1 -@vcr.use_cassette( - os.path.join(THIS_DIR, "fixtures", "test_add_digital_object_component.yaml") +@mock.patch("requests.post", side_effect=[SESSION_MOCK]) +@mock.patch( + "requests.Session.post", + side_effect=[ + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "uri": "/repositories/2/digital_object_components/3" + } + }, + ) + ], +) +@mock.patch( + "requests.Session.get", + side_effect=[ + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "repository": {"ref": "/repositories/2"}, + "uri": "/repositories/2/digital_objects/1", + } + }, + ) + ], ) -def test_add_digital_object_component(): +def test_add_digital_object_component(get, session_post, post): client = ArchivesSpaceClient(**AUTH) doc = client.add_digital_object_component( "/repositories/2/digital_objects/1", @@ -544,10 +1738,45 @@ def test_add_digital_object_component(): assert doc["title"] == "This is a test DOC" -@vcr.use_cassette( - os.path.join(THIS_DIR, "fixtures", "test_add_nested_digital_object_component.yaml") +@mock.patch("requests.post", side_effect=[SESSION_MOCK]) +@mock.patch( + "requests.Session.post", + side_effect=[ + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "uri": "/repositories/2/digital_object_components/5" + } + }, + ) + ], +) +@mock.patch( + "requests.Session.get", + side_effect=[ + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "repository": {"ref": "/repositories/2"}, + "uri": "/repositories/2/digital_objects/1", + } + }, + ), + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "parent": {"ref": "/repositories/2/digital_object_components/3"}, + "repository": {"ref": "/repositories/2"}, + "uri": "/repositories/2/digital_object_components/5", + } + }, + ), + ], ) -def test_add_nested_digital_object_component(): +def test_add_nested_digital_object_component(get, session_post, post): client = ArchivesSpaceClient(**AUTH) parent = "/repositories/2/digital_object_components/3" doc = client.add_digital_object_component( @@ -559,8 +1788,31 @@ def test_add_nested_digital_object_component(): assert client.get_record(doc["id"])["parent"]["ref"] == parent -@vcr.use_cassette(os.path.join(THIS_DIR, "fixtures", "test_date_expression.yaml")) -def test_date_expression(): +@mock.patch("requests.post", side_effect=[SESSION_MOCK]) +@mock.patch( + "requests.Session.get", + side_effect=[ + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "dates": [ + { + "begin": "2014-11-01", + "end": "2015-11-01", + "expression": "November, 2014 to November, 2015", + } + ], + "level": "subseries", + "notes": [], + "uri": "/repositories/2/archival_objects/3", + } + }, + ), + mock.Mock(status_code=200, **{"json.return_value": [{}]}), + ], +) +def test_date_expression(get, post): client = ArchivesSpaceClient(**AUTH) record = client.get_resource_component_and_children( "/repositories/2/archival_objects/3", recurse_max_level=1 @@ -568,8 +1820,80 @@ def test_date_expression(): assert record["date_expression"] == "November, 2014 to November, 2015" -@vcr.use_cassette(os.path.join(THIS_DIR, "fixtures", "test_empty_dates.yaml")) -def test_empty_dates(): +@mock.patch("requests.post", side_effect=[SESSION_MOCK]) +@mock.patch( + "requests.Session.get", + side_effect=[ + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "level": "series", + "notes": [], + "uri": "/repositories/2/archival_objects/2", + } + }, + ), + mock.Mock( + status_code=200, + **{ + "json.return_value": [ + { + "level": "series", + "notes": [], + "uri": "/repositories/2/archival_objects/7", + } + ] + }, + ), + mock.Mock(status_code=200, **{"json.return_value": []}), + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "children": [], + "level": "fonds", + "record_uri": "/repositories/2/resources/2", + } + }, + ), + mock.Mock(status_code=200, **{"json.return_value": {"notes": []}}), + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "results": [ + { + "json": json.dumps( + { + "level": "fonds", + "notes": [], + "repository": {"ref": "/repositories/2"}, + "uri": "/repositories/2/resources/1", + } + ), + "uri": "/repositories/2/resources/1", + }, + { + "json": json.dumps( + { + "level": "fonds", + "notes": [], + "repository": {"ref": "/repositories/2"}, + "uri": "/repositories/2/resources/2", + } + ), + "uri": "/repositories/2/resources/2", + }, + ], + } + }, + ), + mock.Mock(status_code=200, **{"json.return_value": {"children": []}}), + mock.Mock(status_code=200, **{"json.return_value": {"children": []}}), + ], +) +def test_empty_dates(get, post): client = ArchivesSpaceClient(**AUTH) record = client.get_resource_component_children( "/repositories/2/archival_objects/2" @@ -585,8 +1909,62 @@ def test_empty_dates(): assert collections[0]["date_expression"] == "" -@vcr.use_cassette(os.path.join(THIS_DIR, "fixtures", "test_contentless_notes.yaml")) -def test_contentless_notes(): +@mock.patch("requests.post", side_effect=[SESSION_MOCK]) +@mock.patch( + "requests.Session.get", + side_effect=[ + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "results": [ + { + "json": json.dumps( + { + "level": "fonds", + "notes": [], + "uri": "/repositories/2/resources/1", + } + ), + "uri": "/repositories/2/resources/1", + }, + { + "json": json.dumps( + { + "level": "fonds", + "notes": [], + "uri": "/repositories/2/resources/2", + } + ), + "uri": "/repositories/2/resources/2", + }, + { + "json": json.dumps( + { + "level": "collection", + "notes": [ + { + "type": "bioghist", + "subnotes": [ + {"items": ["Second"], "title": "First"} + ], + } + ], + "uri": "/repositories/2/resources/4", + } + ), + "uri": "/repositories/2/resources/4", + }, + ], + } + }, + ), + mock.Mock(status_code=200, **{"json.return_value": {"children": []}}), + mock.Mock(status_code=200, **{"json.return_value": {"children": []}}), + mock.Mock(status_code=200, **{"json.return_value": {"children": []}}), + ], +) +def test_contentless_notes(get, post): client = ArchivesSpaceClient(**AUTH) collections = client.find_collections() assert collections[-1]["notes"][0]["type"] == "bioghist" diff --git a/tests/test_atom_client.py b/tests/test_atom_client.py index cc17edb..4734316 100644 --- a/tests/test_atom_client.py +++ b/tests/test_atom_client.py @@ -1,7 +1,7 @@ import os +from unittest import mock import pytest -import vcr from agentarchives.atom.client import AtomClient from agentarchives.atom.client import CommunicationError @@ -10,10 +10,27 @@ AUTH = {"url": "http://127.0.0.1/index.php", "key": "68405800c6612599"} -@vcr.use_cassette( - os.path.join(THIS_DIR, "fixtures/atom", "test_levels_of_description.yaml") +@mock.patch( + "requests.Session.get", + side_effect=[ + mock.Mock( + status_code=200, + **{ + "json.return_value": [ + {"name": "Collection"}, + {"name": "File"}, + {"name": "Fonds"}, + {"name": "Item"}, + {"name": "Part"}, + {"name": "Series"}, + {"name": "Subfonds"}, + {"name": "Subseries"}, + ] + }, + ) + ], ) -def test_levels_of_description(): +def test_levels_of_description(get): client = AtomClient(**AUTH) levels = client.get_levels_of_description() assert levels == [ @@ -28,10 +45,30 @@ def test_levels_of_description(): ] -@vcr.use_cassette( - os.path.join(THIS_DIR, "fixtures/atom", "test_listing_collections.yaml") +@mock.patch( + "requests.Session.get", + side_effect=[ + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "results": [ + {"slug": "top-level-fonds", "title": "Top Fonds"}, + {"slug": "test-fonds", "title": "Test fonds"}, + ], + "total": 2, + } + }, + ), + mock.Mock(status_code=200, **{"json.return_value": {}}), + mock.Mock(status_code=200, **{"json.return_value": {"children": []}}), + mock.Mock(status_code=200, **{"json.return_value": {"children": []}}), + mock.Mock(status_code=200, **{"json.return_value": {}}), + mock.Mock(status_code=200, **{"json.return_value": {"children": []}}), + mock.Mock(status_code=200, **{"json.return_value": {"children": []}}), + ], ) -def test_listing_collections(): +def test_listing_collections(get): client = AtomClient(**AUTH) collections = client.find_collections() assert len(collections) == 2 @@ -39,26 +76,80 @@ def test_listing_collections(): assert collections[0]["type"] == "resource" -@vcr.use_cassette(os.path.join(THIS_DIR, "fixtures/atom", "test_collection_list.yaml")) -def test_collection_list(): +@mock.patch( + "requests.Session.get", + side_effect=[ + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "children": [ + { + "slug": "test-subfonds", + "children": [{"slug": "test-item"}], + } + ], + } + }, + ) + ], +) +def test_collection_list(get): client = AtomClient(**AUTH) collection_ids = client.collection_list("test-fonds") assert len(collection_ids) == 2 assert collection_ids[0] == "test-subfonds" -@vcr.use_cassette(os.path.join(THIS_DIR, "fixtures/atom", "test_note.yaml")) -def test_rendering_record_containing_a_note(): +@mock.patch( + "requests.Session.get", + side_effect=[ + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "results": [{"slug": "test-fonds"}, {"slug": "top-level-fonds"}], + "total": 2, + } + }, + ), + mock.Mock( + status_code=200, **{"json.return_value": {"notes": ["Note content"]}} + ), + mock.Mock(status_code=200, **{"json.return_value": {"children": []}}), + mock.Mock(status_code=200, **{"json.return_value": {"children": []}}), + mock.Mock(status_code=200, **{"json.return_value": {}}), + mock.Mock(status_code=200, **{"json.return_value": {"children": []}}), + mock.Mock(status_code=200, **{"json.return_value": {"children": []}}), + ], +) +def test_rendering_record_containing_a_note(get): client = AtomClient(**AUTH) collections = client.find_collections() assert len(collections) == 2 assert collections[0]["notes"][0]["content"] == "Note content" -@vcr.use_cassette( - os.path.join(THIS_DIR, "fixtures/atom", "test_find_collections_search.yaml") +@mock.patch( + "requests.Session.get", + side_effect=[ + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "results": [{"slug": "test-fonds", "title": "Test fonds"}], + "total": 1, + } + }, + ), + mock.Mock( + status_code=200, **{"json.return_value": {"notes": ["Note content"]}} + ), + mock.Mock(status_code=200, **{"json.return_value": {"children": []}}), + mock.Mock(status_code=200, **{"json.return_value": {"children": []}}), + ], ) -def test_find_collections_search(): +def test_find_collections_search(get): client = AtomClient(**AUTH) collections = client.find_collections(search_pattern="Test fonds") assert len(collections) == 1 @@ -66,23 +157,41 @@ def test_find_collections_search(): assert collections[0]["type"] == "resource" -@vcr.use_cassette( - os.path.join( - THIS_DIR, "fixtures/atom", "test_find_collections_search_no_results.yaml" - ) +@mock.patch( + "requests.Session.get", + side_effect=[ + mock.Mock(status_code=200, **{"json.return_value": {"total": 0, "results": []}}) + ], ) -def test_find_collections_search_no_results(): +def test_find_collections_search_no_results(get): client = AtomClient(**AUTH) no_results = client.find_collections(search_pattern="Nonexistent") assert len(no_results) == 0 -@vcr.use_cassette( - os.path.join( - THIS_DIR, "fixtures/atom", "test_listing_collections_search_spaces.yaml" - ) +@mock.patch( + "requests.Session.get", + side_effect=[ + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "results": [ + { + "level_of_description": "Fonds", + "slug": "a-fonds-for-testing", + "title": "Resource with spaces in the identifier", + } + ], + "total": 1, + } + }, + ), + mock.Mock(status_code=200, **{"json.return_value": {}}), + mock.Mock(status_code=200, **{"json.return_value": {}}), + ], ) -def test_listing_collections_search_spaces(): +def test_listing_collections_search_spaces(get): client = AtomClient(**AUTH) collections = client.find_collections(identifier="2015044 Aa Ac") assert len(collections) == 1 @@ -90,10 +199,52 @@ def test_listing_collections_search_spaces(): assert collections[0]["levelOfDescription"] == "Fonds" -@vcr.use_cassette( - os.path.join(THIS_DIR, "fixtures/atom", "test_listing_collections_sort.yaml") +@mock.patch( + "requests.Session.get", + side_effect=[ + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "total": 2, + "results": [ + {"slug": "test-fonds", "title": "Test fonds"}, + {"slug": "top-level-fonds", "title": "Top Fonds"}, + ], + } + }, + ), + mock.Mock( + status_code=200, **{"json.return_value": {"notes": ["Note content"]}} + ), + mock.Mock(status_code=200, **{"json.return_value": {"children": []}}), + mock.Mock(status_code=200, **{"json.return_value": {"children": []}}), + mock.Mock(status_code=200, **{"json.return_value": {}}), + mock.Mock(status_code=200, **{"json.return_value": {"children": []}}), + mock.Mock(status_code=200, **{"json.return_value": {"children": []}}), + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "total": 2, + "results": [ + {"slug": "top-level-fonds", "title": "Top Fonds"}, + {"slug": "test-fonds", "title": "Test fonds"}, + ], + } + }, + ), + mock.Mock(status_code=200, **{"json.return_value": {}}), + mock.Mock(status_code=200, **{"json.return_value": {"children": []}}), + mock.Mock(status_code=200, **{"json.return_value": {"children": []}}), + mock.Mock( + status_code=200, **{"json.return_value": {"notes": ["Note content"]}} + ), + mock.Mock(status_code=200, **{"json.return_value": {"children": []}}), + mock.Mock(status_code=200, **{"json.return_value": {"children": []}}), + ], ) -def test_listing_collections_sort(): +def test_listing_collections_sort(get): client = AtomClient(**AUTH) asc = client.find_collections(sort_by="asc") assert len(asc) == 2 @@ -106,38 +257,66 @@ def test_listing_collections_sort(): assert desc[0]["type"] == "resource" -@vcr.use_cassette( - os.path.join( - THIS_DIR, - "fixtures/atom", - "test_find_component_parent_with_top_level_parent.yaml", - ) +@mock.patch( + "requests.Session.get", + side_effect=[ + mock.Mock(status_code=200, **{"json.return_value": {"parent": "test-fonds"}}), + mock.Mock( + status_code=200, **{"json.return_value": {"notes": ["Note content"]}} + ), + ], ) -def test_find_component_parent_with_top_level_parent(): +def test_find_component_parent_with_top_level_parent(get): client = AtomClient(**AUTH) resource_id = client.find_parent_id_for_component("test-subfonds") assert resource_id == "test-fonds" -@vcr.use_cassette( - os.path.join( - THIS_DIR, - "fixtures/atom", - "test_find_component_parent_with_non_top_level_parent.yaml", - ) +@mock.patch( + "requests.Session.get", + side_effect=[ + mock.Mock( + status_code=200, **{"json.return_value": {"parent": "test-subfonds"}} + ), + mock.Mock(status_code=200, **{"json.return_value": {"parent": "test-fonds"}}), + ], ) -def test_find_component_parent_with_non_top_level_parent(): +def test_find_component_parent_with_non_top_level_parent(get): client = AtomClient(**AUTH) resource_id = client.find_parent_id_for_component("test-item") assert resource_id == "test-subfonds" -@vcr.use_cassette( - os.path.join(THIS_DIR, "fixtures/atom", "test_find_resource_children.yaml") +@mock.patch( + "requests.Session.get", + side_effect=[ + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "children": [ + { + "identifier": "testsubfonds", + "level": "Subfonds", + "slug": "test-subfonds", + "title": "Test subfonds", + } + ], + "identifier": "testfonds", + "level": "Fonds", + "slug": "test-fonds", + "title": "Test fonds", + } + }, + ), + mock.Mock(status_code=200, **{"json.return_value": {}}), + mock.Mock(status_code=200, **{"json.return_value": {}}), + mock.Mock(status_code=200, **{"json.return_value": {}}), + ], ) -def test_find_resource_children(): +def test_find_resource_children(get): client = AtomClient(**AUTH) data = client.get_resource_component_and_children("test-fonds") @@ -148,28 +327,58 @@ def test_find_resource_children(): assert data["type"] == "resource" -@vcr.use_cassette( - os.path.join( - THIS_DIR, - "fixtures/atom", - "test_find_resource_children_recursion_level_two.yaml", - ) +@mock.patch( + "requests.Session.get", + side_effect=[ + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "children": [ + { + "identifier": "testsubfonds", + "level": "Subfonds", + "slug": "test-subfonds", + "title": "Test subfonds", + } + ], + "identifier": "testfonds", + "level": "Fonds", + "slug": "test-fonds", + "title": "Test fonds", + } + }, + ), + mock.Mock(status_code=200, **{"json.return_value": {}}), + mock.Mock(status_code=200, **{"json.return_value": {}}), + ], ) -def test_find_resource_children_recursion_level(): +def test_find_resource_children_recursion_level(get): client = AtomClient(**AUTH) data = client.get_resource_component_and_children("test-fonds", recurse_max_level=2) assert len(data["children"]) == 1 assert data["has_children"] is True -@vcr.use_cassette( - os.path.join( - THIS_DIR, - "fixtures/atom", - "test_find_resource_component_children_at_max_recursion_level.yaml", - ) +@mock.patch( + "requests.Session.get", + side_effect=[ + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "children": [], + "identifier": "testsubfonds", + "level": "Subfonds", + "slug": "test-subfonds", + "title": "Test subfonds", + } + }, + ), + mock.Mock(status_code=200, **{"json.return_value": {}}), + ], ) -def test_find_resource_component_children_at_max_recursion_level(): +def test_find_resource_component_children_at_max_recursion_level(get): client = AtomClient(**AUTH) record = client.get_resource_component_and_children( "test-subfonds", recurse_max_level=1 @@ -178,44 +387,131 @@ def test_find_resource_component_children_at_max_recursion_level(): assert record["has_children"] is True -@vcr.use_cassette( - os.path.join(THIS_DIR, "fixtures/atom", "test_find_collection_ids.yaml") +@mock.patch( + "requests.Session.get", + side_effect=[ + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "total": 2, + "results": [ + {"slug": "top-level-fonds", "title": "Top Fonds"}, + {"slug": "test-fonds", "title": "Test fonds"}, + ], + } + }, + ) + ], ) -def test_find_collection_ids(): +def test_find_collection_ids(get): client = AtomClient(**AUTH) ids = client.find_collection_ids() assert ids == ["top-level-fonds", "test-fonds"] -@vcr.use_cassette( - os.path.join(THIS_DIR, "fixtures/atom", "test_find_collection_ids_search.yaml") +@mock.patch( + "requests.Session.get", + side_effect=[ + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "results": [{"slug": "test-fonds", "title": "Test fonds"}], + "total": 1, + } + }, + ) + ], ) -def test_find_collection_ids_search(): +def test_find_collection_ids_search(get): client = AtomClient(**AUTH) ids = client.find_collection_ids(search_pattern="Test fonds") assert ids == ["test-fonds"] -@vcr.use_cassette( - os.path.join(THIS_DIR, "fixtures/atom", "test_count_collection_ids.yaml") +@mock.patch( + "requests.Session.get", + side_effect=[ + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "results": [ + {"slug": "top-level-fonds", "title": "Top Fonds"}, + {"slug": "test-fonds", "title": "Test fonds"}, + ], + "total": 2, + } + }, + ) + ], ) -def test_count_collection_ids(): +def test_count_collection_ids(get): client = AtomClient(**AUTH) ids = client.count_collections() assert ids == 2 -@vcr.use_cassette( - os.path.join(THIS_DIR, "fixtures/atom", "test_count_collection_ids_search.yaml") +@mock.patch( + "requests.Session.get", + side_effect=[ + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "results": [{"slug": "top-level-fonds", "title": "Top Fonds"}], + "total": 1, + } + }, + ) + ], ) -def test_count_collection_ids_search(): +def test_count_collection_ids_search(get): client = AtomClient(**AUTH) ids = client.count_collections(search_pattern="Top") assert ids == 1 -@vcr.use_cassette(os.path.join(THIS_DIR, "fixtures/atom", "test_augment_ids.yaml")) -def test_augment_ids(): +@mock.patch( + "requests.Session.get", + side_effect=[ + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "children": [ + { + "identifier": "dogchild", + "level": "Subfonds", + "slug": "child-of-top-level", + "title": "Dawg Child", + } + ], + "identifier": "toplevelfonds", + "slug": "top-level-fonds", + "title": "Top Fonds", + } + }, + ), + mock.Mock(status_code=200, **{"json.return_value": {}}), + mock.Mock(status_code=200, **{"json.return_value": {}}), + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "identifier": "testfonds", + "level": "Fonds", + "slug": "test-fonds", + "title": "Test fonds", + } + }, + ), + mock.Mock(status_code=200, **{"json.return_value": {}}), + mock.Mock(status_code=200, **{"json.return_value": {}}), + ], +) +def test_augment_ids(get): client = AtomClient(**AUTH) data = client.augment_resource_ids(["top-level-fonds", "test-fonds"]) assert len(data) == 2 @@ -225,38 +521,99 @@ def test_augment_ids(): assert data[1]["type"] == "resource" -@vcr.use_cassette( - os.path.join(THIS_DIR, "fixtures/atom", "test_identifier_exact_match.yaml") +@mock.patch( + "requests.Session.get", + side_effect=[ + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "results": [{"slug": "top-level-fonds", "title": "Top Fonds"}], + "total": 1, + } + }, + ), + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "results": [{"slug": "top-level-fonds", "title": "Top Fonds"}], + "total": 1, + } + }, + ), + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "results": [{"slug": "top-level-fonds", "title": "Top Fonds"}], + "total": 1, + } + }, + ), + mock.Mock(status_code=200, **{"json.return_value": {}}), + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "identifier": "F1", + "slug": "top-level-fonds", + "title": "Top Fonds", + } + }, + ), + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "identifier": "F1", + "slug": "top-level-fonds", + "title": "Top Fonds", + } + }, + ), + ], ) -def test_identifier_search_exact_match(): +def test_identifier_search_exact_match(get): client = AtomClient(**AUTH) assert client.find_collection_ids(identifier="F1") == ["top-level-fonds"] assert client.count_collections(identifier="F1") == 1 assert len(client.find_collections(identifier="F1")) == 1 -@vcr.use_cassette( - os.path.join(THIS_DIR, "fixtures/atom", "test_add_child_resource.yaml") +@mock.patch( + "requests.Session.post", + side_effect=[ + mock.Mock(status_code=201, **{"json.return_value": {"slug": "second-subfonds"}}) + ], ) -def test_add_child_resource(): +def test_add_child_resource(post): client = AtomClient(**AUTH) slug = client.add_child("test-fonds", title="Second subfonds", level="subfonds") assert slug == "second-subfonds" -@vcr.use_cassette( - os.path.join(THIS_DIR, "fixtures/atom", "test_add_child_resource_component.yaml") +@mock.patch( + "requests.Session.post", + side_effect=[ + mock.Mock(status_code=201, **{"json.return_value": {"slug": "test-child"}}) + ], ) -def test_add_child_resource_component(): +def test_add_child_resource_component(post): client = AtomClient(**AUTH) slug = client.add_child("second-subfonds", title="Test child", level="item") assert slug == "test-child" -@vcr.use_cassette( - os.path.join(THIS_DIR, "fixtures/atom", "test_adding_child_with_note.yaml") +@mock.patch( + "requests.Session.post", + side_effect=[ + mock.Mock( + status_code=201, **{"json.return_value": {"slug": "another-subfonds"}} + ) + ], ) -def test_adding_child_with_note(): +def test_adding_child_with_note(post): client = AtomClient(**AUTH) slug = client.add_child( "test-fonds", @@ -267,10 +624,19 @@ def test_adding_child_with_note(): assert slug == "another-subfonds" -@vcr.use_cassette( - os.path.join(THIS_DIR, "fixtures/atom", "test_posting_contentless_note.yaml") +@mock.patch( + "requests.Session.post", + side_effect=[ + mock.Mock( + status_code=201, **{"json.return_value": {"slug": "yet-another-subfonds"}} + ), + ], ) -def test_posting_contentless_note(): +@mock.patch( + "requests.Session.get", + side_effect=[mock.Mock(status_code=200, **{"json.return_value": {}})], +) +def test_posting_contentless_note(get, post): client = AtomClient(**AUTH) slug = client.add_child( "test-fonds", @@ -281,10 +647,15 @@ def test_posting_contentless_note(): assert client.get_record(slug)["notes"] == [] -@vcr.use_cassette( - os.path.join(THIS_DIR, "fixtures/atom", "test_delete_record_resource.yaml") +@mock.patch("requests.Session.delete", side_effect=[mock.Mock(status_code=204)]) +@mock.patch( + "requests.Session.get", + side_effect=[ + mock.Mock(status_code=200, **{"json.return_value": {}}), + mock.Mock(status_code=404), + ], ) -def test_delete_record_resource(): +def test_delete_record_resource(get, delete): client = AtomClient(**AUTH) slug = "another-subfonds" assert client.get_record(slug) @@ -294,10 +665,60 @@ def test_delete_record_resource(): client.get_record(slug) -@vcr.use_cassette( - os.path.join(THIS_DIR, "fixtures/atom", "test_edit_archival_object.yaml") +@mock.patch( + "requests.Session.put", + side_effect=[mock.Mock(status_code=200, **{"json.return_value": {}})], +) +@mock.patch( + "requests.Session.get", + side_effect=[ + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "dates": [{"end_date": "2015-01-01", "type": "Creation"}], + "level_of_description": "Subfonds", + "parent": "test-fonds", + "publication_status": "Published", + "title": "Second subfonds", + } + }, + ), + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "dates": [{"end_date": "2015-01-01", "type": "Creation"}], + "level_of_description": "Subfonds", + "parent": "test-fonds", + "publication_status": "Published", + "title": "Second subfonds", + } + }, + ), + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "dates": [ + { + "date": "November, 2014 to November, 2015", + "end_date": "2015-11-01", + "start_date": "2014-11-01", + "type": "Creation", + } + ], + "level_of_description": "Subfonds", + "notes": ["This is a test note"], + "parent": "test-fonds", + "publication_status": "Published", + "title": "Test edited subfonds", + } + }, + ), + ], ) -def test_edit_archival_object(): +def test_edit_archival_object(get, put): client = AtomClient(**AUTH) original = client.get_record("second-subfonds") assert original["title"] == "Second subfonds" @@ -321,16 +742,81 @@ def test_edit_archival_object(): assert updated["notes"][0]["content"] == new_record["notes"][0]["content"] -@vcr.use_cassette( - os.path.join(THIS_DIR, "fixtures/atom", "test_edit_record_empty_note.yaml") +@mock.patch( + "requests.Session.put", + side_effect=[mock.Mock(status_code=200, **{"json.return_value": {}})], ) -def test_edit_record_empty_note(): +@mock.patch( + "requests.Session.get", + side_effect=[ + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "dates": [ + { + "date": "November, 2014 to November, 2015", + "end_date": "2015-11-01", + "start_date": "2014-11-01", + "type": "Creation", + } + ], + "level_of_description": "Subfonds", + "notes": ["Gen note"], + "parent": "test-fonds", + "publication_status": "Published", + "title": "Test edited subseries with empty note", + } + }, + ), + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "dates": [ + { + "date": "November, 2014 to November, 2015", + "end_date": "2015-11-01", + "start_date": "2014-11-01", + "type": "Creation", + } + ], + "level_of_description": "Subfonds", + "notes": ["Gen note"], + "parent": "test-fonds", + "publication_status": "Published", + "title": "Test edited subseries with empty note", + } + }, + ), + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "dates": [ + { + "date": "November, 2014 to November, 2015", + "end_date": "2015-11-01", + "start_date": "2014-11-01", + "type": "Creation", + } + ], + "level_of_description": "Subfonds", + "parent": "test-fonds", + "publication_status": "Published", + "title": "Test edited subseries with empty note", + } + }, + ), + ], +) +def test_edit_record_empty_note(get, put): client = AtomClient(**AUTH) original = client.get_record("second-subfonds") assert original["notes"] new_record = { "slug": "second-subfonds", - "title": "Test edited subseries w/ empty note", + "title": "Test edited subseries with empty note", "start_date": "2014-11-01", "end_date": "2015-11-01", "date_expression": "November, 2014 to November, 2015", @@ -341,10 +827,13 @@ def test_edit_record_empty_note(): assert not updated["notes"] -@vcr.use_cassette( - os.path.join(THIS_DIR, "fixtures/atom", "test_add_digital_object.yaml") +@mock.patch( + "requests.Session.post", + side_effect=[ + mock.Mock(status_code=201, **{"json.return_value": {"slug": "kitty-jpg"}}) + ], ) -def test_add_digital_object(): +def test_add_digital_object(post): client = AtomClient(**AUTH) do = client.add_digital_object( "test-child", @@ -354,8 +843,42 @@ def test_add_digital_object(): assert do["slug"] == "kitty-jpg" -@vcr.use_cassette(os.path.join(THIS_DIR, "fixtures/atom", "test_date_expression.yaml")) -def test_date_expression(): +@mock.patch( + "requests.Session.get", + side_effect=[ + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "identifier": None, + "level": "Subfonds", + "slug": "second-subfonds", + "title": "Test edited subseries with empty note", + } + }, + ), + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "dates": [ + { + "date": "November, 2014 to November, 2015", + "end_date": "2015-11-01", + "start_date": "2014-11-01", + "type": "Creation", + } + ], + "level_of_description": "Subfonds", + "parent": "test-fonds", + "publication_status": "Published", + "title": "Test edited subseries with empty note", + } + }, + ), + ], +) +def test_date_expression(get): client = AtomClient(**AUTH) record = client.get_resource_component_and_children( "second-subfonds", recurse_max_level=1 @@ -363,8 +886,76 @@ def test_date_expression(): assert record["date_expression"] == "November, 2014 to November, 2015" -@vcr.use_cassette(os.path.join(THIS_DIR, "fixtures/atom", "test_empty_dates.yaml")) -def test_empty_dates(): +@mock.patch( + "requests.Session.get", + side_effect=[ + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "identifier": None, + "level": "Item", + "slug": "test-child", + "title": "Test child", + } + }, + ), + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "level_of_description": "Item", + "parent": "second-subfonds", + "publication_status": "Published", + "title": "Test child", + } + }, + ), + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "identifier": None, + "level": "Item", + "slug": "test-child", + "title": "Test child", + } + }, + ), + mock.Mock( + status_code=200, + **{"json.return_value": {}}, + ), + mock.Mock( + status_code=200, + **{ + "json.return_value": { + "total": 2, + "results": [ + { + "level_of_description": "Fonds", + "reference_code": "testfonds", + "slug": "test-fonds", + "title": "Test fonds", + }, + { + "reference_code": "toplevelfonds", + "slug": "top-level-fonds", + "title": "Top Fonds", + }, + ], + } + }, + ), + mock.Mock(status_code=200, **{"json.return_value": {}}), + mock.Mock(status_code=200, **{"json.return_value": {"children": []}}), + mock.Mock(status_code=200, **{"json.return_value": {"children": []}}), + mock.Mock(status_code=200, **{"json.return_value": {}}), + mock.Mock(status_code=200, **{"json.return_value": {}}), + mock.Mock(status_code=200, **{"json.return_value": {"children": []}}), + ], +) +def test_empty_dates(get): client = AtomClient(**AUTH) record = client.get_resource_component_children("test-child") assert record["dates"] == ""