mirror of
https://github.com/thegeneralist01/archivr
synced 2026-07-22 03:05:32 +02:00
fix: complete web UI smoke path
This commit is contained in:
parent
47e6f0e53f
commit
7a3d23624a
2 changed files with 14 additions and 0 deletions
|
|
@ -270,6 +270,9 @@ fn determine_source(path: &str) -> Source {
|
||||||
return Source::Snapchat;
|
return Source::Snapchat;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if Path::new(path).exists() {
|
||||||
|
return Source::Local;
|
||||||
|
}
|
||||||
Source::Other
|
Source::Other
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1196,6 +1199,16 @@ mod tests {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_existing_local_path_source() {
|
||||||
|
let path = env::current_dir().unwrap().join("Cargo.toml");
|
||||||
|
assert_eq!(
|
||||||
|
determine_source(path.to_str().unwrap()),
|
||||||
|
Source::Local,
|
||||||
|
"existing filesystem paths should be archived as local files"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_initialize_store_directories() {
|
fn test_initialize_store_directories() {
|
||||||
let store_path = env::temp_dir().join(format!(
|
let store_path = env::temp_dir().join(format!(
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ pub fn load_registry(path: &Path) -> Result<ServerRegistry> {
|
||||||
Ok(registry)
|
Ok(registry)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
pub fn save_registry(path: &Path, registry: &ServerRegistry) -> Result<()> {
|
pub fn save_registry(path: &Path, registry: &ServerRegistry) -> Result<()> {
|
||||||
validate_registry(registry)?;
|
validate_registry(registry)?;
|
||||||
let contents = toml::to_string_pretty(registry)?;
|
let contents = toml::to_string_pretty(registry)?;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue