MCPcopy Create free account
hub / github.com/buttplugio/buttplug / test_client_ping

Function test_client_ping

crates/buttplug_tests/tests/test_client.rs:156–172  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

154
155#[tokio::test]
156async fn test_client_ping() {
157 let server = ButtplugServerBuilder::default()
158 .max_ping_time(200)
159 .finish()
160 .expect("Test, assuming infallible.");
161 let connector = ButtplugInProcessClientConnectorBuilder::default()
162 .server(server)
163 .finish();
164 let client = ButtplugClient::new("Test Client");
165 client
166 .connect(connector)
167 .await
168 .expect("Test, assuming infallible.");
169 assert!(client.ping().await.is_ok());
170 sleep(Duration::from_millis(800)).await;
171 assert!(client.ping().await.is_err());
172}
173
174// Tests both the stop-all-devices functionality and the low/high ends of the
175// client command range conversion.

Callers

nothing calls this directly

Calls 5

sleepFunction · 0.85
finishMethod · 0.45
max_ping_timeMethod · 0.45
serverMethod · 0.45
connectMethod · 0.45

Tested by

no test coverage detected