rust_integration_services/sftp/
mod.rs1#[cfg(feature = "sftp")]
2mod sftp_auth;
3#[cfg(feature = "sftp")]
4pub mod sftp_receiver;
5#[cfg(feature = "sftp")]
6pub mod sftp_sender;
7
8#[cfg(feature = "sftp")]
9#[cfg(test)]
10mod test {
11 use crate::sftp::{sftp_receiver::SftpReceiver, sftp_sender::SftpSender};
12
13 #[tokio::test(start_paused = true)]
14 async fn sftp_receiver() {
15 let result = SftpReceiver::new("127.0.0.1:2222", "user").password("pass").remote_path("upload").receive_files_to_path("./test/file/out").await;
16 assert!(result.is_ok());
17 }
18
19 #[tokio::test(start_paused = true)]
20 async fn sftp_sender_file() {
21 let result = SftpSender::new("127.0.0.1:2222", "user").password("pass").remote_path("upload").send_file("./test/file/in/TextFile1.txt").await;
22 assert!(result.is_ok());
23 }
24
25 #[tokio::test(start_paused = true)]
26 async fn sftp_sender_bytes() {
27 let result = SftpSender::new("127.0.0.1:2222", "user").password("pass").remote_path("upload").file_name("file.txt").send_string("test").await;
28 assert!(result.is_ok());
29 }
30
31}