Reattached document service.

This commit is contained in:
2025-04-22 08:31:25 -04:00
parent 0ab0b59f4c
commit 38af08eb14
3 changed files with 30 additions and 2 deletions

View File

@ -155,4 +155,19 @@ mod clients {
assert_eq!(result.get_id(), expected.get_id());
assert_eq!(result.get_msg_type(), expected.get_msg_type());
}
#[test]
fn document_return() {
let queue = Queue::new();
let (queue_tx, queue_rx) = channel();
queue.add(queue_tx, [MsgType::DocumentRequest].to_vec());
let chan = Client::start(queue.clone());
let chan_rx = chan.send(Message::new(MsgType::DocumentRequest));
let msg = queue_rx.recv_timeout(TIMEOUT).unwrap();
let expected = msg.reply(MsgType::Document);
queue.send(expected.clone()).unwrap();
let result = chan_rx.recv_timeout(TIMEOUT).unwrap();
assert_eq!(result.get_id(), expected.get_id());
assert_eq!(result.get_msg_type(), expected.get_msg_type());
}
}