MCPcopy Create free account
hub / github.com/dtormoen/tsk-tsk / test_resolve_config_merging_env

Function test_resolve_config_merging_env

src/context/tsk_config.rs:1061–1104  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1059
1060 #[test]
1061 fn test_resolve_config_merging_env() {
1062 let config = TskConfig {
1063 defaults: SharedConfig {
1064 env: vec![
1065 EnvVar {
1066 name: "DATABASE_URL".to_string(),
1067 value: "postgres://localhost/db".to_string(),
1068 },
1069 EnvVar {
1070 name: "DEBUG".to_string(),
1071 value: "false".to_string(),
1072 },
1073 ],
1074 ..Default::default()
1075 },
1076 project: HashMap::from([(
1077 "my-project".to_string(),
1078 SharedConfig {
1079 env: vec![
1080 EnvVar {
1081 name: "DEBUG".to_string(),
1082 value: "true".to_string(),
1083 },
1084 EnvVar {
1085 name: "RUST_LOG".to_string(),
1086 value: "info".to_string(),
1087 },
1088 ],
1089 ..Default::default()
1090 },
1091 )]),
1092 ..Default::default()
1093 };
1094
1095 let resolved = config.resolve_config("my-project", None, None);
1096
1097 assert_eq!(resolved.env.len(), 3);
1098 assert_eq!(resolved.env[0].name, "DATABASE_URL");
1099 assert_eq!(resolved.env[0].value, "postgres://localhost/db");
1100 assert_eq!(resolved.env[1].name, "DEBUG");
1101 assert_eq!(resolved.env[1].value, "true");
1102 assert_eq!(resolved.env[2].name, "RUST_LOG");
1103 assert_eq!(resolved.env[2].value, "info");
1104 }
1105
1106 #[test]
1107 fn test_resolve_config_merging_stack_config() {

Callers

nothing calls this directly

Calls 1

resolve_configMethod · 0.80

Tested by

no test coverage detected