Adding test for check
This commit is contained in:
parent
350329b5a4
commit
44b92ec7ac
1 changed files with 13 additions and 0 deletions
|
|
@ -385,6 +385,19 @@ mod tests {
|
||||||
assert!(command2 == expected_command2, "expected command doesn't equal actual command");
|
assert!(command2 == expected_command2, "expected command doesn't equal actual command");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn check() {
|
||||||
|
// TODO Make sure the response was read correctly
|
||||||
|
let response = b"a1 OK CHECK completed\r\n".to_vec();
|
||||||
|
let mock_stream = MockStream::new(response);
|
||||||
|
let mut client = create_client_with_mock_stream(mock_stream);
|
||||||
|
match client.check() {
|
||||||
|
Err(err) => panic!("Error reading response: {}", err),
|
||||||
|
_ => {},
|
||||||
|
}
|
||||||
|
assert!(client.stream.written_buf == b"a1 CHECK\r\n".to_vec(), "Invalid close command");
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn close() {
|
fn close() {
|
||||||
// TODO Make sure the response was read correctly
|
// TODO Make sure the response was read correctly
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue