summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorbold <bold@cryptoguru.com>2019-12-26 16:06:18 +0100
committerWez Furlong <wez@wezfurlong.org>2020-01-03 22:02:46 -0800
commitb7532e93a4a31b96fff2348e292f10aec89014cd (patch)
tree89a63f98c5cf46876f52ec8306542a33b8834a61 /tests
parentdcedc9056d2a0681027b795393fca111b5cd03aa (diff)
downloadssh2-rs-b7532e93a4a31b96fff2348e292f10aec89014cd.zip
export block directions
Diffstat (limited to 'tests')
-rw-r--r--tests/all/session.rs13
1 files changed, 11 insertions, 2 deletions
diff --git a/tests/all/session.rs b/tests/all/session.rs
index 484610f..86587b4 100644
--- a/tests/all/session.rs
+++ b/tests/all/session.rs
@@ -1,10 +1,10 @@
use std::env;
use std::fs::File;
-use std::io::prelude::*;
+use std::io::{self, prelude::*};
use std::path::Path;
use tempdir::TempDir;
-use ssh2::{HashType, KeyboardInteractivePrompt, MethodType, Prompt, Session};
+use ssh2::{HashType, KeyboardInteractivePrompt, MethodType, Prompt, Session, BlockDirections};
#[test]
fn session_is_send() {
@@ -177,3 +177,12 @@ fn scp_send() {
.unwrap();
assert_eq!(actual, b"foobar");
}
+
+#[test]
+fn block_directions() {
+ let mut sess = ::authed_session();
+ sess.set_blocking(false);
+ let actual = sess.handshake().map_err(|e| io::Error::from(e).kind());
+ assert_eq!(actual, Err(io::ErrorKind::WouldBlock));
+ assert_eq!(sess.block_directions(), BlockDirections::Inbound);
+}