From 647a2bce5ea4f87892ce5f025e9d10115734cf6f Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Tue, 12 Oct 2021 19:57:20 -0700 Subject: rust: partial test coverage of schema changes --- rust/tests/test_api_server_http.rs | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) (limited to 'rust/tests') diff --git a/rust/tests/test_api_server_http.rs b/rust/tests/test_api_server_http.rs index adab5745..8f691e0d 100644 --- a/rust/tests/test_api_server_http.rs +++ b/rust/tests/test_api_server_http.rs @@ -265,6 +265,26 @@ fn test_lookups() { None, ); + helpers::check_http_response( + request::get( + "http://localhost:9411/v0/container/lookup?issne=1234-3333", + headers.clone(), + &router, + ), + status::Ok, + Some("Journal of Trivial Results"), + ); + + helpers::check_http_response( + request::get( + "http://localhost:9411/v0/container/lookup?issn=1234-3333", + headers.clone(), + &router, + ), + status::Ok, + Some("Journal of Trivial Results"), + ); + helpers::check_http_response( request::get( "http://localhost:9411/v0/creator/lookup?orcid=0000-0003-2088-7465", @@ -463,6 +483,16 @@ fn test_lookups() { status::Ok, Some("bigger example"), ); + + helpers::check_http_response( + request::get( + "http://localhost:9411/v0/release/lookup?hdl=20.500.23456/ABC/DUMMY", + headers.clone(), + &router, + ), + status::Ok, + Some("bigger example"), + ); } #[test] @@ -532,7 +562,7 @@ fn test_post_container() { editgroup_id ), headers, - r#"{"name": "test journal"}"#, + r#"{"name": "test journal", "publication_status": "active"}"#, &router, ), status::Created, @@ -670,7 +700,7 @@ fn test_post_fileset() { ), headers.clone(), r#"{"manifest": [ - {"path": "new_file.txt", "size": 12345, "sha1": "e9dd75237c94b209dc3ccd52722de6931a310ba3" }, + {"path": "new_file.txt", "size": 12345, "sha1": "e9dd75237c94b209dc3ccd52722de6931a310ba3", "mimetype": "text/plain" }, {"path": "output/bogus.hdf5", "size": 43210, "sha1": "e9dd75237c94b209dc3ccd52722de6931a310ba3", "extra": {"some": "other value"} } ], "urls": [ -- cgit v1.2.3