use feignhttp::util::replace;
use std::collections::HashMap;
#[test]
fn test_one_path() {
let mut map = HashMap::new();
map.insert("name".to_string(), "abc".to_string());
assert_eq!(replace("/find/{name}", &map), "/find/abc");
}
#[test]
fn test_multipart_path() {
let mut map = HashMap::new();
map.insert("id".to_string(), "1".to_string());
map.insert("name".to_string(), "abc".to_string());
assert_eq!(replace("/{name}/{id}", &map), "/abc/1");
}
#[test]
fn test_config() {
let mut map = HashMap::new();
map.insert("timeout".to_string(), "3000".to_string());
assert_eq!(replace("{timeout}", &map), "3000");
}