summaryrefslogtreecommitdiffstats
path: root/rust/tests/test_old_python_tests.rs
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-12-31 17:12:51 -0800
committerBryan Newbold <bnewbold@robocracy.org>2018-12-31 17:12:51 -0800
commitcca7f97b0a8ffc65eb5bda2c8e8c93eb3c99605b (patch)
tree8bd2cd0488c9465e6a9da8cd8ab719c8edfdd58a /rust/tests/test_old_python_tests.rs
parentf19288ca809d87a286336e04f8e6b46ddbef300c (diff)
downloadfatcat-cca7f97b0a8ffc65eb5bda2c8e8c93eb3c99605b.tar.gz
fatcat-cca7f97b0a8ffc65eb5bda2c8e8c93eb3c99605b.zip
crude admin auth in tests
Diffstat (limited to 'rust/tests/test_old_python_tests.rs')
-rw-r--r--rust/tests/test_old_python_tests.rs28
1 files changed, 18 insertions, 10 deletions
diff --git a/rust/tests/test_old_python_tests.rs b/rust/tests/test_old_python_tests.rs
index b67bb747..1f91c7db 100644
--- a/rust/tests/test_old_python_tests.rs
+++ b/rust/tests/test_old_python_tests.rs
@@ -17,8 +17,8 @@ use helpers::setup_client;
//#[test]
fn test_api_rich_create() {
- let (client, mut server) = setup_client();
- let client = client.with_context(Context::new());
+ let (client, context, mut server) = setup_client();
+ let client = client.with_context(context);
let admin_id = "aaaaaaaaaaaabkvkaaaaaaaaae".to_string();
@@ -191,8 +191,8 @@ fn test_api_rich_create() {
*/
//#[test]
fn test_merge_works() {
- let (client, mut server) = setup_client();
- let client = client.with_context(Context::new());
+ let (client, context, mut server) = setup_client();
+ let client = client.with_context(context);
let admin_id = "aaaaaaaaaaaabkvkaaaaaaaaae".to_string();
@@ -280,13 +280,21 @@ fn test_merge_works() {
client.merge_works(work_a_id, work_b_id)
*/
// check results
- let work_a = match client.get_work(work_a_id.clone(), None, None).wait().unwrap() {
- GetWorkResponse::FoundEntity(e) => e,
- _ => unreachable!(),
+ let work_a = match client
+ .get_work(work_a_id.clone(), None, None)
+ .wait()
+ .unwrap()
+ {
+ GetWorkResponse::FoundEntity(e) => e,
+ _ => unreachable!(),
};
- let _work_b = match client.get_work(work_b_id.clone(), None, None).wait().unwrap() {
- GetWorkResponse::FoundEntity(e) => e,
- _ => unreachable!(),
+ let _work_b = match client
+ .get_work(work_b_id.clone(), None, None)
+ .wait()
+ .unwrap()
+ {
+ GetWorkResponse::FoundEntity(e) => e,
+ _ => unreachable!(),
};
// TODO: assert_eq!(work_a.revision.unwrap(), work_b.revision.unwrap());
assert_eq!(work_a.redirect, None);