From 7911336f70db44a93c2b1c96c2fba7281e3c5ce7 Mon Sep 17 00:00:00 2001 From: "Philip (a-0)" <@ph:a-0.me> Date: Sun, 7 Jan 2024 22:08:47 +0100 Subject: [PATCH] Removed pointless test which did not terminate --- ubisync/src/comm/mod.rs | 49 +---------------------------------------- 1 file changed, 1 insertion(+), 48 deletions(-) diff --git a/ubisync/src/comm/mod.rs b/ubisync/src/comm/mod.rs index 5b668f4..27c18c8 100644 --- a/ubisync/src/comm/mod.rs +++ b/ubisync/src/comm/mod.rs @@ -196,57 +196,10 @@ impl CommHandle { } #[cfg(test)] -mod tests { - use std::time::Duration; - - use i2p::net::I2pListener; +mod tests {use i2p::net::I2pListener; use i2p::sam::StreamForward; use i2p::sam_options::SAMOptions; 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] pub fn from_privkey() {