Gave control to documents service.
This commit is contained in:
10
src/lib.rs
10
src/lib.rs
@ -73,7 +73,7 @@ mod mtt_replies {
|
||||
let reply = MTTReply::new(msg);
|
||||
match reply.get_error() {
|
||||
Some(err) => match err {
|
||||
ErrorType::DocumentNotFound => {},
|
||||
ErrorType::DocumentNotFound => {}
|
||||
},
|
||||
None => unreachable!("should return an error type"),
|
||||
}
|
||||
@ -94,7 +94,7 @@ mod mtt_replies {
|
||||
let reply = MTTReply::new(msg);
|
||||
match reply.get_error() {
|
||||
Some(err) => match err {
|
||||
ErrorType::DocumentNotFound => {},
|
||||
ErrorType::DocumentNotFound => {}
|
||||
},
|
||||
None => unreachable!("should return an error type"),
|
||||
}
|
||||
@ -131,7 +131,10 @@ impl MoreThanText {
|
||||
reply.get_data("sess_id").unwrap().to_uuid().unwrap()
|
||||
}
|
||||
|
||||
pub fn get_document<S>(&self, sess_id: Uuid, action: ActionType, doc_name: S) -> MTTReply where S: Into<String> {
|
||||
pub fn get_document<S>(&self, sess_id: Uuid, action: ActionType, doc_name: S) -> MTTReply
|
||||
where
|
||||
S: Into<String>,
|
||||
{
|
||||
let mut msg = Message::new(MsgType::DocumentRequest);
|
||||
msg.add_data("sess_id", sess_id);
|
||||
msg.add_data("name", doc_name.into());
|
||||
@ -180,6 +183,5 @@ mod mtt {
|
||||
let id = mtt.validate_session(Some(Uuid::new_v4()));
|
||||
let output = mtt.get_document(id, ActionType::Get, "root".to_string());
|
||||
assert!(output.get_error().is_none());
|
||||
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user