Skip to content

Commit

Permalink
Update mod.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
omallassi committed Apr 17, 2024
1 parent 2cb2a8a commit e8d4bd8
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions adr_config_local_impl/src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,13 +236,18 @@ mod tests {
use std::fs::{self};
use std::path::Path;
use uuid::*;
extern crate slog;
extern crate slog_term;
use slog::*;

#[test]
fn test_set_config_log_level() {
let uuid = Uuid::new_v4();
let name = format!("adrust-tools-4-tests-{}", uuid);
let config = name.as_str();

info!(super::get_logger(), "test_set_config_log_level will use [{}]", config);

super::set_config_from_name(config, "log_level", "7").unwrap();
let cfg = super::get_config_from_name(config);

Expand All @@ -257,6 +262,8 @@ mod tests {
let name = format!("adrust-tools-4-tests-{}", uuid);
let config = name.as_str();

info!(super::get_logger(), "test_set_config_use_id will use [{}]", config);

super::set_config_from_name(config, "use_id_prefix", "false").unwrap();
let cfg = super::get_config_from_name(config);

Expand All @@ -271,6 +278,8 @@ mod tests {
let name = format!("adrust-tools-4-tests-{}", uuid);
let config = name.as_str();

info!(super::get_logger(), "test_set_config_id_width will use [{}]", config);

super::set_config_from_name(config, "id_prefix_width", "10").unwrap();
let cfg = super::get_config_from_name(config);

Expand Down Expand Up @@ -305,6 +314,8 @@ mod tests {
let name = format!("adrust-tools-4-tests-{}", uuid);
let config = name.as_str();

info!(super::get_logger(), "test_set_config_adr_root will use [{}]", config);

match super::set_config_from_name(config, "adr_root_dir", "/tmp/adr-samples-4-tests") {
Ok(e) => e,
Err(why) => {
Expand All @@ -328,6 +339,8 @@ mod tests {
let name = format!("adrust-tools-4-tests-{}", uuid);
let config = name.as_str();

info!(super::get_logger(), "test_set_config_adr_template_file will use [{}]", config);

match super::set_config_from_name(config, "adr_template_file", "new-template.adoc") {
Ok(e) => e,
Err(why) => {
Expand All @@ -346,6 +359,8 @@ mod tests {
let name = format!("adrust-tools-4-tests-{}", uuid);
let config = name.as_str();

info!(super::get_logger(), "test_set_config_adr_src_dir will use [{}]", config);

match super::set_config_from_name(config, "adr_src_dir", "/tmp/does-not-exists/src") {
Ok(e) => e,
Err(why) => {
Expand Down Expand Up @@ -374,6 +389,8 @@ mod tests {

let config = "adrust-tool-unit";

info!(super::get_logger(), "test_init will use [{}]", config);

match super::set_config_from_name(
config,
super::ADR_ROOT_DIR,
Expand Down

0 comments on commit e8d4bd8

Please sign in to comment.