aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2021-10-12 19:57:20 -0700
committerBryan Newbold <bnewbold@robocracy.org>2021-10-13 16:21:30 -0700
commit647a2bce5ea4f87892ce5f025e9d10115734cf6f (patch)
tree3d76bf0572dc9018c09316b3a18f0ad6f3a4f070
parent54cb27a58b7753e141769fa3392a8b22e88897f4 (diff)
downloadfatcat-647a2bce5ea4f87892ce5f025e9d10115734cf6f.tar.gz
fatcat-647a2bce5ea4f87892ce5f025e9d10115734cf6f.zip
rust: partial test coverage of schema changes
-rw-r--r--rust/tests/test_api_server_http.rs34
1 files changed, 32 insertions, 2 deletions
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
@@ -267,6 +267,26 @@ fn test_lookups() {
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",
headers.clone(),
&router,
@@ -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": [