mirror of
https://github.com/waku-org/waku-rust-bindings.git
synced 2025-02-16 16:47:33 +00:00
Add exclusive running test
This commit is contained in:
parent
25e767b699
commit
dc1a27c73c
@ -64,3 +64,17 @@ impl WakuNodeHandle<Running> {
|
||||
pub fn waku_new(config: Option<WakuNodeConfig>) -> Result<WakuNodeHandle<Initialized>> {
|
||||
node::waku_new(config).map(|_| WakuNodeHandle(Default::default()))
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::waku_new;
|
||||
|
||||
#[test]
|
||||
fn exclusive_running() {
|
||||
let handle1 = waku_new(None).unwrap();
|
||||
let handle2 = waku_new(None).unwrap();
|
||||
let stop_handle1 = handle1.start().unwrap();
|
||||
assert!(handle2.start().is_err());
|
||||
stop_handle1.stop().unwrap();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user