Removed pointless test which did not terminate

This commit is contained in:
Philip (a-0) 2024-01-07 22:08:47 +01:00
parent 84784599a7
commit 7911336f70

View file

@ -196,57 +196,10 @@ impl CommHandle {
} }
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {use i2p::net::I2pListener;
use std::time::Duration;
use i2p::net::I2pListener;
use i2p::sam::StreamForward; use i2p::sam::StreamForward;
use i2p::sam_options::SAMOptions; use i2p::sam_options::SAMOptions;
use i2p::Session; use i2p::Session;
use ubisync_lib::messages::{Message, self};
use ubisync_lib::types::ElementId;
use crate::state::{CommState, State};
use crate::Config;
use super::CommHandle;
#[tokio::test(flavor = "multi_thread")]
pub async fn msg() {
let ch = CommHandle::new(
CommState::new(State::new().await.unwrap()),
&Config::default(),
)
.unwrap();
ch.run().await;
println!("My address: {:?}", ch.i2p_b32_address());
ch.send(
&ch.i2p_address().unwrap(),
Message::new(messages::MessageContent::Hello {
peer_name: "a".to_string(),
}),
)
.await
.expect("Could not send hello");
for i in 0..10 {
let result = ch
.send(
&ch.i2p_address().unwrap(),
Message::new(messages::MessageContent::CreateElement {
id: ElementId::new(),
content: ubisync_lib::types::ElementContent::Text(format!(
"hello world no. {}",
i
)),
}),
)
.await;
tokio::time::sleep(Duration::from_millis(300)).await;
println!("Result of sending: {:?}", result);
}
ch.stop().await;
}
#[test] #[test]
pub fn from_privkey() { pub fn from_privkey() {