Adding FETCH test
This commit is contained in:
parent
6dd23c4647
commit
50a55d59c4
1 changed files with 13 additions and 0 deletions
|
|
@ -417,6 +417,19 @@ mod tests {
|
||||||
assert!(client.stream.written_buf == command.as_bytes().to_vec(), "Invalid rename command");
|
assert!(client.stream.written_buf == command.as_bytes().to_vec(), "Invalid rename command");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn fetch() {
|
||||||
|
// TODO Make sure the response was read correctly
|
||||||
|
let response = b"a1 OK FETCH completed\r\n".to_vec();
|
||||||
|
let sequence_set = "1";
|
||||||
|
let query = "BODY[]";
|
||||||
|
let command = format!("a1 FETCH {} {}\r\n", sequence_set, query);
|
||||||
|
let mock_stream = MockStream::new(response);
|
||||||
|
let mut client = create_client_with_mock_stream(mock_stream);
|
||||||
|
client.fetch(sequence_set, query).unwrap();
|
||||||
|
assert!(client.stream.written_buf == command.as_bytes().to_vec(), "Invalid fetch command");
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn subscribe() {
|
fn subscribe() {
|
||||||
// TODO Make sure the response was read correctly
|
// TODO Make sure the response was read correctly
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue