Wrangle lifetimes and implement empty read_all test

This commit is contained in:
Lucien Greathouse 2018-06-05 23:36:50 -07:00
parent 27d5bd3d6f
commit c85e5c8a78
3 changed files with 29 additions and 19 deletions

View file

@ -13,7 +13,7 @@ use std::path::PathBuf;
use librojo::{
session::Session,
project::Project,
web::{Server, WebConfig, ServerInfoResponse},
web::{Server, WebConfig, ServerInfoResponse, ReadAllResponse},
};
#[test]
@ -39,4 +39,13 @@ fn empty() {
assert_eq!(response.protocol_version, 2);
assert_eq!(response.partitions, HashMap::new());
}
{
let body = server.get_string("/api/read_all");
let response = serde_json::from_str::<ReadAllResponse>(&body).unwrap();
assert_eq!(response.server_id, "0");
assert_eq!(response.message_cursor, -1);
assert_eq!(response.instances.as_ref(), &HashMap::new());
}
}