Skip to content
Snippets Groups Projects
Unverified Commit 915d4c85 authored by Nikos Kontakis's avatar Nikos Kontakis
Browse files

Add resources deserializer test

parent 335ad80a
No related branches found
No related tags found
No related merge requests found
......@@ -299,6 +299,8 @@ impl ResourcesBuilder {
#[cfg(test)]
#[allow(non_snake_case)]
mod tests {
use crate::NetworkConfig;
use super::*;
macro_rules! impl_resources_quantity_unit_test {
......@@ -401,6 +403,18 @@ mod tests {
assert_eq!(resources.limit_memory().unwrap().as_str(), "2G");
}
#[test]
fn resources_config_toml_import_should_succeeds_and_returns_a_resources_config() {
let load_from_toml =
NetworkConfig::load_from_toml("./testing/snapshots/0001-big-network.toml").unwrap();
let resources = load_from_toml.relaychain().default_resources().unwrap();
assert_eq!(resources.request_memory().unwrap().as_str(), "500M");
assert_eq!(resources.request_cpu().unwrap().as_str(), "100000");
assert_eq!(resources.limit_cpu().unwrap().as_str(), "10Gi");
assert_eq!(resources.limit_memory().unwrap().as_str(), "4000M");
}
#[test]
fn resources_config_builder_should_fails_and_returns_an_error_if_couldnt_parse_request_memory()
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment