|
6 | 6 | import pytest |
7 | 7 |
|
8 | 8 | from oneiro.pipelines.embedding import ( |
9 | | - PIPELINE_BASE_MODEL_MAP, |
10 | 9 | EmbeddingConfig, |
11 | 10 | EmbeddingIncompatibleError, |
12 | 11 | EmbeddingSource, |
13 | | - is_embedding_compatible, |
14 | 12 | parse_embedding_config, |
15 | 13 | parse_embeddings_from_config, |
16 | 14 | ) |
| 15 | +from oneiro.pipelines.lora import PIPELINE_BASE_MODEL_MAP, is_resource_compatible |
17 | 16 |
|
18 | 17 |
|
19 | 18 | class TestEmbeddingConfig: |
@@ -341,47 +340,47 @@ def test_no_embeddings(self): |
341 | 340 |
|
342 | 341 |
|
343 | 342 | class TestIsEmbeddingCompatible: |
344 | | - """Tests for is_embedding_compatible function.""" |
| 343 | + """Tests for is_resource_compatible function.""" |
345 | 344 |
|
346 | 345 | def test_flux1_compatible(self): |
347 | 346 | """Flux.1 embeddings compatible with flux1 pipeline.""" |
348 | | - assert is_embedding_compatible("flux1", "Flux.1 Dev") |
349 | | - assert is_embedding_compatible("flux1", "Flux.1 Schnell") |
350 | | - assert is_embedding_compatible("flux1", "Flux.1 D") |
| 347 | + assert is_resource_compatible("flux1", "Flux.1 Dev") |
| 348 | + assert is_resource_compatible("flux1", "Flux.1 Schnell") |
| 349 | + assert is_resource_compatible("flux1", "Flux.1 D") |
351 | 350 |
|
352 | 351 | def test_flux2_compatible(self): |
353 | 352 | """Flux.2 embeddings compatible with flux2 pipeline.""" |
354 | | - assert is_embedding_compatible("flux2", "Flux.2") |
| 353 | + assert is_resource_compatible("flux2", "Flux.2") |
355 | 354 |
|
356 | 355 | def test_flux1_flux2_incompatible(self): |
357 | 356 | """Flux.1 and Flux.2 embeddings are NOT cross-compatible.""" |
358 | | - assert not is_embedding_compatible("flux1", "Flux.2") |
359 | | - assert not is_embedding_compatible("flux2", "Flux.1 Dev") |
| 357 | + assert not is_resource_compatible("flux1", "Flux.2") |
| 358 | + assert not is_resource_compatible("flux2", "Flux.1 Dev") |
360 | 359 |
|
361 | 360 | def test_sdxl_compatible(self): |
362 | 361 | """SDXL embeddings compatible with sdxl pipeline.""" |
363 | | - assert is_embedding_compatible("sdxl", "SDXL 1.0") |
364 | | - assert is_embedding_compatible("sdxl", "Pony") |
365 | | - assert is_embedding_compatible("sdxl", "Illustrious") |
| 362 | + assert is_resource_compatible("sdxl", "SDXL 1.0") |
| 363 | + assert is_resource_compatible("sdxl", "Pony") |
| 364 | + assert is_resource_compatible("sdxl", "Illustrious") |
366 | 365 |
|
367 | 366 | def test_incompatible_base_model(self): |
368 | 367 | """Incompatible base model returns False.""" |
369 | | - assert not is_embedding_compatible("flux2", "SDXL 1.0") |
370 | | - assert not is_embedding_compatible("sdxl", "Flux.1 Dev") |
371 | | - assert not is_embedding_compatible("flux2", "SD 1.5") |
| 368 | + assert not is_resource_compatible("flux2", "SDXL 1.0") |
| 369 | + assert not is_resource_compatible("sdxl", "Flux.1 Dev") |
| 370 | + assert not is_resource_compatible("flux2", "SD 1.5") |
372 | 371 |
|
373 | 372 | def test_none_base_model_is_compatible(self): |
374 | 373 | """None base model assumed compatible.""" |
375 | | - assert is_embedding_compatible("flux2", None) |
| 374 | + assert is_resource_compatible("flux2", None) |
376 | 375 |
|
377 | 376 | def test_unknown_pipeline_is_compatible(self): |
378 | 377 | """Unknown pipeline type assumed compatible.""" |
379 | | - assert is_embedding_compatible("unknown", "SDXL 1.0") |
| 378 | + assert is_resource_compatible("unknown", "SDXL 1.0") |
380 | 379 |
|
381 | 380 | def test_case_insensitive(self): |
382 | 381 | """Comparison is case-insensitive.""" |
383 | | - assert is_embedding_compatible("flux1", "flux.1 dev") |
384 | | - assert is_embedding_compatible("flux1", "FLUX.1 DEV") |
| 382 | + assert is_resource_compatible("flux1", "flux.1 dev") |
| 383 | + assert is_resource_compatible("flux1", "FLUX.1 DEV") |
385 | 384 |
|
386 | 385 |
|
387 | 386 | class TestEmbeddingIncompatibleError: |
|
0 commit comments