move jsonrpc test to dev deps for oled

This commit is contained in:
glyph 2021-11-05 13:36:06 +02:00
parent 7f815075d2
commit d482ef39c4
2 changed files with 13 additions and 12 deletions

View File

@ -29,7 +29,6 @@ maintenance = { status = "actively-developed" }
[dependencies]
jsonrpc-core = "11.0.0"
jsonrpc-http-server = "11.0.0"
jsonrpc-test = "11.0.0"
linux-embedded-hal = "0.2.2"
embedded-graphics = "0.4.7"
tinybmp = "0.1.0"
@ -40,3 +39,6 @@ log = "0.4.0"
env_logger = "0.6.1"
snafu = "0.4.1"
nix="0.11"
[dev-dependencies]
jsonrpc-test = "11.0.0"

View File

@ -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!(