aboutsummaryrefslogtreecommitdiffstats
path: root/rust/tests
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2019-01-09 13:18:38 -0800
committerBryan Newbold <bnewbold@robocracy.org>2019-01-09 13:18:38 -0800
commit17fe81ea8d58f93f129492dc44a38df9ab8d528e (patch)
tree3d4cb71fb5d2b1c3d15c6cfcf348f09a51b13543 /rust/tests
parent0624fce632da17b3f98f0d4ff98a736f05fa287b (diff)
downloadfatcat-17fe81ea8d58f93f129492dc44a38df9ab8d528e.tar.gz
fatcat-17fe81ea8d58f93f129492dc44a38df9ab8d528e.zip
rust impl required editgroup_id
Diffstat (limited to 'rust/tests')
-rw-r--r--rust/tests/test_api_server_http.rs60
-rw-r--r--rust/tests/test_old_python_tests.rs22
2 files changed, 59 insertions, 23 deletions
diff --git a/rust/tests/test_api_server_http.rs b/rust/tests/test_api_server_http.rs
index e82037f0..7d4469af 100644
--- a/rust/tests/test_api_server_http.rs
+++ b/rust/tests/test_api_server_http.rs
@@ -538,7 +538,10 @@ fn test_post_file() {
helpers::check_http_response(
request::post(
- &format!("http://localhost:9411/v0/file?editgroup_id={}", editgroup_id),
+ &format!(
+ "http://localhost:9411/v0/file?editgroup_id={}",
+ editgroup_id
+ ),
headers.clone(),
r#"{ }"#,
&router,
@@ -605,7 +608,10 @@ fn test_post_fileset() {
helpers::check_http_response(
request::post(
- &format!("http://localhost:9411/v0/fileset?editgroup_id={}", editgroup_id),
+ &format!(
+ "http://localhost:9411/v0/fileset?editgroup_id={}",
+ editgroup_id
+ ),
headers.clone(),
r#"{ }"#,
&router,
@@ -662,7 +668,10 @@ fn test_post_webcapture() {
helpers::check_http_response(
request::post(
- &format!("http://localhost:9411/v0/webcapture?editgroup_id={}", editgroup_id),
+ &format!(
+ "http://localhost:9411/v0/webcapture?editgroup_id={}",
+ editgroup_id
+ ),
headers.clone(),
r#"{ "original_url": "https://fatcat.wiki",
"timestamp": "2018-12-28T11:11:11Z" }"#,
@@ -674,7 +683,10 @@ fn test_post_webcapture() {
helpers::check_http_response(
request::post(
- &format!("http://localhost:9411/v0/webcapture?editgroup_id={}", editgroup_id),
+ &format!(
+ "http://localhost:9411/v0/webcapture?editgroup_id={}",
+ editgroup_id
+ ),
headers.clone(),
r#"{"original_url": "https://bnewbold.net/",
"timestamp": "2018-12-28T05:06:07Z",
@@ -726,7 +738,10 @@ fn test_post_release() {
helpers::check_http_response(
request::post(
- &format!("http://localhost:9411/v0/release?editgroup_id={}", editgroup_id),
+ &format!(
+ "http://localhost:9411/v0/release?editgroup_id={}",
+ editgroup_id
+ ),
headers.clone(),
// TODO: target_release_id
r#"{"title": "secret minimal paper",
@@ -742,7 +757,10 @@ fn test_post_release() {
// No work_id supplied (auto-created)
helpers::check_http_response(
request::post(
- &format!("http://localhost:9411/v0/release?editgroup_id={}", editgroup_id),
+ &format!(
+ "http://localhost:9411/v0/release?editgroup_id={}",
+ editgroup_id
+ ),
headers.clone(),
// TODO: target_release_id
r#"{"title": "secret minimal paper the second",
@@ -756,7 +774,10 @@ fn test_post_release() {
helpers::check_http_response(
request::post(
- &format!("http://localhost:9411/v0/release?editgroup_id={}", editgroup_id),
+ &format!(
+ "http://localhost:9411/v0/release?editgroup_id={}",
+ editgroup_id
+ ),
headers.clone(),
// TODO: target_release_id
r#"{"title": "secret paper",
@@ -918,7 +939,10 @@ fn test_accept_editgroup() {
helpers::check_http_response(
request::post(
- &format!("http://localhost:9411/v0/container?editgroup_id={}", uuid2fcid(&editgroup_id)),
+ &format!(
+ "http://localhost:9411/v0/container?editgroup_id={}",
+ uuid2fcid(&editgroup_id)
+ ),
headers.clone(),
&format!(
"{{\"name\": \"test journal 1\", \"editgroup_id\": \"{}\"}}",
@@ -931,7 +955,10 @@ fn test_accept_editgroup() {
);
helpers::check_http_response(
request::post(
- &format!("http://localhost:9411/v0/container?editgroup_id={}", uuid2fcid(&editgroup_id)),
+ &format!(
+ "http://localhost:9411/v0/container?editgroup_id={}",
+ uuid2fcid(&editgroup_id)
+ ),
headers.clone(),
&format!(
"{{\"name\": \"test journal 2\", \"editgroup_id\": \"{}\"}}",
@@ -1200,7 +1227,10 @@ fn test_abstracts() {
helpers::check_http_response(
request::post(
- &format!("http://localhost:9411/v0/release?editgroup_id={}", editgroup_id),
+ &format!(
+ "http://localhost:9411/v0/release?editgroup_id={}",
+ editgroup_id
+ ),
headers.clone(),
r#"{"title": "some paper",
"doi": "10.1234/iiiiiii",
@@ -1222,7 +1252,10 @@ fn test_abstracts() {
// Same abstracts; checking that re-inserting works
helpers::check_http_response(
request::post(
- &format!("http://localhost:9411/v0/release?editgroup_id={}", editgroup_id),
+ &format!(
+ "http://localhost:9411/v0/release?editgroup_id={}",
+ editgroup_id
+ ),
headers.clone(),
r#"{"title": "some paper again",
"abstracts": [
@@ -1292,7 +1325,10 @@ fn test_contribs() {
helpers::check_http_response(
request::post(
- &format!("http://localhost:9411/v0/release?editgroup_id={}", editgroup_id),
+ &format!(
+ "http://localhost:9411/v0/release?editgroup_id={}",
+ editgroup_id
+ ),
headers.clone(),
r#"{"title": "some paper",
"doi": "10.1234/iiiiiii",
diff --git a/rust/tests/test_old_python_tests.rs b/rust/tests/test_old_python_tests.rs
index ac9d4112..e0d15484 100644
--- a/rust/tests/test_old_python_tests.rs
+++ b/rust/tests/test_old_python_tests.rs
@@ -33,7 +33,7 @@ fn test_api_rich_create() {
new_container.issnl = Some("2222-3333".to_string());
// extra=dict(a=2, i="zing"))),
let resp = client
- .create_container(new_container, Some(editgroup_id.clone()))
+ .create_container(new_container, editgroup_id.clone())
.wait()
.unwrap();
let container_id = match resp {
@@ -46,7 +46,7 @@ fn test_api_rich_create() {
new_creator.orcid = Some("0000-0002-1825-0097".to_string());
// extra=dict(a=2, i="zing"))),
let resp = client
- .create_creator(new_creator, Some(editgroup_id.clone()))
+ .create_creator(new_creator, editgroup_id.clone())
.wait()
.unwrap();
let creator_id = match resp {
@@ -57,7 +57,7 @@ fn test_api_rich_create() {
let new_work = WorkEntity::new();
// extra=dict(a=2, i="zing"))),
let resp = client
- .create_work(new_work, Some(editgroup_id.clone()))
+ .create_work(new_work, editgroup_id.clone())
.wait()
.unwrap();
let work_id = match resp {
@@ -79,7 +79,7 @@ fn test_api_rich_create() {
new_release.refs = Some(vec![rref]);
// extra=dict(a=2, i="zing"))),
let resp = client
- .create_release(new_release, Some(editgroup_id.clone()))
+ .create_release(new_release, editgroup_id.clone())
.wait()
.unwrap();
let stub_release_id = match resp {
@@ -102,7 +102,7 @@ fn test_api_rich_create() {
new_release.refs = Some(vec![rref]);
// extra=dict(f=7, b="loopy"))),
let resp = client
- .create_release(new_release, Some(editgroup_id.clone()))
+ .create_release(new_release, editgroup_id.clone())
.wait()
.unwrap();
let release_id = match resp {
@@ -116,7 +116,7 @@ fn test_api_rich_create() {
new_file.release_ids = Some(vec![release_id.clone()]);
// extra=dict(f=4, b="zing"))),
let resp = client
- .create_file(new_file, Some(editgroup_id.clone()))
+ .create_file(new_file, editgroup_id.clone())
.wait()
.unwrap();
let file_id = match resp {
@@ -203,7 +203,7 @@ fn test_merge_works() {
// Create 2x works, each with releases; work_b has two releases
let resp = client
- .create_work(WorkEntity::new(), Some(editgroup_id.clone()))
+ .create_work(WorkEntity::new(), editgroup_id.clone())
.wait()
.unwrap();
let work_a_id = match resp {
@@ -216,7 +216,7 @@ fn test_merge_works() {
new_release.work_id = Some(work_a_id.clone());
new_release.doi = Some("10.1234/A1".to_string());
let resp = client
- .create_release(new_release, Some(editgroup_id.clone()))
+ .create_release(new_release, editgroup_id.clone())
.wait()
.unwrap();
let _release_a1_id = match resp {
@@ -225,7 +225,7 @@ fn test_merge_works() {
};
let resp = client
- .create_work(WorkEntity::new(), Some(editgroup_id.clone()))
+ .create_work(WorkEntity::new(), editgroup_id.clone())
.wait()
.unwrap();
let work_b_id = match resp {
@@ -239,7 +239,7 @@ fn test_merge_works() {
new_release.work_id = Some(work_b_id.clone());
new_release.doi = Some("10.1234/B1".to_string());
let resp = client
- .create_release(new_release, Some(editgroup_id.clone()))
+ .create_release(new_release, editgroup_id.clone())
.wait()
.unwrap();
let _release_b1_id = match resp {
@@ -253,7 +253,7 @@ fn test_merge_works() {
new_release.work_id = Some(work_b_id.clone());
new_release.doi = Some("10.1234/B2".to_string());
let resp = client
- .create_release(new_release, Some(editgroup_id.clone()))
+ .create_release(new_release, editgroup_id.clone())
.wait()
.unwrap();
let _release_b2_id = match resp {