WIP: 26-integration-tests #35

Draft
Mr_Steppy wants to merge 16 commits from 26-integration-tests into master
Showing only changes of commit d963d4ff88 - Show all commits

View File

@ -806,8 +806,15 @@ mod test {
#[test]
fn test_parse_server_configuration() {
let servers = parse_server_configuration("foo:bar,.:fizz/buzz", || Ok(PathBuf::from("/test")))
.expect("valid server configuration");
//setup directory structure for test
let home_dir = PathBuf::from("target/test");
const LOCAL_SERVER_DIR: &str = "fizz/buzz";
fs::create_dir_all(home_dir.join(LOCAL_SERVER_DIR)).expect("failed to create server directory");
let servers = parse_server_configuration(&format!("foo:bar,.:{LOCAL_SERVER_DIR}"), || {
Ok(home_dir.clone())
})
.expect("valid server configuration");
assert_eq!(
vec![
Server {
@ -818,7 +825,10 @@ mod test {
},
Server {
address: ServerAddress::Localhost,
server_directory_path: PathBuf::from("/test/fizz/buzz"),
server_directory_path: home_dir
.join(LOCAL_SERVER_DIR)
.canonicalize()
.expect("home dir exists"),
}
],
servers