From 3f4802ddc74bbb9ce18e9daaa7eec55954a225cd Mon Sep 17 00:00:00 2001 From: Meng Zhang Date: Tue, 14 Jan 2025 11:17:37 -0800 Subject: [PATCH] test: add assertions for new model path migration in registry tests --- crates/tabby-common/src/registry.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/tabby-common/src/registry.rs b/crates/tabby-common/src/registry.rs index 0965889ff3cc..1ea0a5e0efc2 100644 --- a/crates/tabby-common/src/registry.rs +++ b/crates/tabby-common/src/registry.rs @@ -200,6 +200,7 @@ mod tests { let dir = registry.get_model_dir("StarCoder-1B"); let old_model_path = dir.join(LEGACY_GGML_MODEL_PATH.as_str()); + let new_model_path = dir.join("ggml").join("model-00001-of-00001.gguf"); tokio::fs::create_dir_all(old_model_path.parent().unwrap()) .await .unwrap(); @@ -210,11 +211,13 @@ mod tests { .await .unwrap(); + assert!(!new_model_path.exists()); registry.migrate_legacy_model_path("StarCoder-1B").unwrap(); assert!(registry .get_model_entry_path("StarCoder-1B") .unwrap() .exists()); assert!(!old_model_path.exists()); + assert!(new_model_path.exists()); } }