forked from PeachCloud/peach-workspace
move jsonrpc test to dev deps for oled
This commit is contained in:
@ -13,8 +13,6 @@ use embedded_graphics::prelude::*;
|
||||
use hal::I2cdev;
|
||||
use jsonrpc_core::{types::error::Error, IoHandler, Params, Value};
|
||||
use jsonrpc_http_server::{AccessControlAllowOrigin, DomainsValidation, ServerBuilder};
|
||||
#[allow(unused_imports)]
|
||||
use jsonrpc_test as test;
|
||||
use linux_embedded_hal as hal;
|
||||
use log::{debug, error, info};
|
||||
use serde::Deserialize;
|
||||
@ -247,6 +245,7 @@ mod tests {
|
||||
|
||||
use hal::i2cdev::linux::LinuxI2CError;
|
||||
use jsonrpc_core::ErrorCode;
|
||||
use jsonrpc_test as test_rpc;
|
||||
//use nix::Error as NixError;
|
||||
use std::io::Error as IoError;
|
||||
use std::io::ErrorKind;
|
||||
@ -259,7 +258,7 @@ mod tests {
|
||||
io.add_method("rpc_success_response", |_| {
|
||||
Ok(Value::String("success".into()))
|
||||
});
|
||||
test::Rpc::from(io)
|
||||
test_rpc::Rpc::from(io)
|
||||
};
|
||||
|
||||
assert_eq!(rpc.request("rpc_success_response", &()), r#""success""#);
|
||||
@ -271,7 +270,7 @@ mod tests {
|
||||
let rpc = {
|
||||
let mut io = IoHandler::new();
|
||||
io.add_method("rpc_internal_error", |_| Err(Error::internal_error()));
|
||||
test::Rpc::from(io)
|
||||
test_rpc::Rpc::from(io)
|
||||
};
|
||||
|
||||
assert_eq!(
|
||||
@ -293,7 +292,7 @@ mod tests {
|
||||
let source = LinuxI2CError::Io(io_err);
|
||||
Err(Error::from(OledError::I2CError { source }))
|
||||
});
|
||||
test::Rpc::from(io)
|
||||
test_rpc::Rpc::from(io)
|
||||
};
|
||||
|
||||
assert_eq!(
|
||||
@ -316,7 +315,7 @@ mod tests {
|
||||
let source = LinuxI2CError::Nix(nix_err);
|
||||
Err(Error::from(OledError::I2CError { source }))
|
||||
});
|
||||
test::Rpc::from(io)
|
||||
test_rpc::Rpc::from(io)
|
||||
};
|
||||
|
||||
assert_eq!(
|
||||
@ -341,7 +340,7 @@ mod tests {
|
||||
value: 321,
|
||||
}))
|
||||
});
|
||||
test::Rpc::from(io)
|
||||
test_rpc::Rpc::from(io)
|
||||
};
|
||||
|
||||
assert_eq!(
|
||||
@ -363,7 +362,7 @@ mod tests {
|
||||
font: "24x32".to_string(),
|
||||
}))
|
||||
});
|
||||
test::Rpc::from(io)
|
||||
test_rpc::Rpc::from(io)
|
||||
};
|
||||
|
||||
assert_eq!(
|
||||
@ -383,7 +382,7 @@ mod tests {
|
||||
io.add_method("rpc_invalid_string", |_| {
|
||||
Err(Error::from(OledError::InvalidString { len: 22 }))
|
||||
});
|
||||
test::Rpc::from(io)
|
||||
test_rpc::Rpc::from(io)
|
||||
};
|
||||
|
||||
assert_eq!(
|
||||
@ -410,7 +409,7 @@ mod tests {
|
||||
};
|
||||
Err(Error::from(OledError::MissingParameter { e }))
|
||||
});
|
||||
test::Rpc::from(io)
|
||||
test_rpc::Rpc::from(io)
|
||||
};
|
||||
|
||||
assert_eq!(
|
||||
@ -436,7 +435,7 @@ mod tests {
|
||||
};
|
||||
Err(Error::from(OledError::ParseError { e }))
|
||||
});
|
||||
test::Rpc::from(io)
|
||||
test_rpc::Rpc::from(io)
|
||||
};
|
||||
|
||||
assert_eq!(
|
||||
|
Reference in New Issue
Block a user