Skip to content

Commit

Permalink
Mocks - handle CLIENT SETINFO calls.
Browse files Browse the repository at this point in the history
  • Loading branch information
shachlanAmazon committed Sep 7, 2023
1 parent 0152cb1 commit 729cff0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions babushka-core/tests/utilities/mocks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,15 @@ async fn receive_and_respond_to_next_message(
};

let message = from_utf8(&buffer[..size]).unwrap().to_string();
let setinfo_count = message.matches("SETINFO").count();
if setinfo_count > 0 {
let mut buffer = Vec::new();
for _ in 0..setinfo_count {
super::encode_value(&Value::Okay, &mut buffer).unwrap();
}
socket.write_all(&buffer).await.unwrap();
return true;
}

if let Some(response) = constant_responses.get(&message) {
let mut buffer = Vec::new();
Expand Down

0 comments on commit 729cff0

Please sign in to comment.