INNER CODE UNIT · Rust
test_build_from_json_local
splitgraph/seafowl · object_store_factory/src/lib.rs:232
fn test_build_from_json_local() {
let url = Url::parse("file:///tmp").unwrap();
let json_str = json!({
"type": "local",
"data_dir": "/tmp",
"disable_hardlinks": false
})
.to_string();
let config = ObjectStoreConfig::build_from_json(&url, &json_str).unwrap();
if let ObjectStoreConfig::Local(local_config) = config {
assert_eq!(local_config.data_dir, "/tmp");
assert!(!local_config.disable_hardlinks);
} else {
panic!("Expected ObjectStoreConfig::Local");
}
}