tests: update model rename test

This commit is contained in:
psychedelicious 2024-04-03 12:57:59 +11:00
parent 7ff2371c07
commit 216b34ac44

View File

@ -87,9 +87,11 @@ def test_rename(
key = mm2_installer.install_path(embedding_file) key = mm2_installer.install_path(embedding_file)
model_record = store.get_model(key) model_record = store.get_model(key)
assert model_record.path.endswith("sd-1/embedding/test_embedding.safetensors") assert model_record.path.endswith("sd-1/embedding/test_embedding.safetensors")
store.update_model(key, ModelRecordChanges(name="new_name.safetensors", base=BaseModelType("sd-2"))) store.update_model(key, ModelRecordChanges(name="new model name", base=BaseModelType("sd-2")))
new_model_record = mm2_installer.sync_model_path(key) new_model_record = mm2_installer.sync_model_path(key)
assert new_model_record.path.endswith("sd-2/embedding/new_name.safetensors") # Renaming the model record shouldn't rename the file
assert new_model_record.name == "new model name"
assert new_model_record.path.endswith("sd-2/embedding/test_embedding.safetensors")
@pytest.mark.parametrize( @pytest.mark.parametrize(