From 8820f82b419ab1786b7ac9df0f39828a8bbeca29 Mon Sep 17 00:00:00 2001 From: Manuel Schmid Date: Mon, 20 May 2024 17:29:11 +0200 Subject: [PATCH] fix: update unit tests --- tests/test_utils.py | 41 ++++++++++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 13 deletions(-) diff --git a/tests/test_utils.py b/tests/test_utils.py index 0698dcc8..9f81005b 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -8,12 +8,16 @@ class TestUtils(unittest.TestCase): test_cases = [ { "input": ("some prompt, very cool, , cool ", [], 5), - "output": [("hey-lora.safetensors", 0.4), ("you-lora.safetensors", 0.2)], + "output": ( + [('hey-lora.safetensors', 0.4), ('you-lora.safetensors', 0.2)], 'some prompt, very cool, cool'), }, # Test can not exceed limit { "input": ("some prompt, very cool, , cool ", [], 1), - "output": [("hey-lora.safetensors", 0.4)], + "output": ( + [('hey-lora.safetensors', 0.4)], + 'some prompt, very cool, cool' + ), }, # test Loras from UI take precedence over prompt { @@ -22,22 +26,33 @@ class TestUtils(unittest.TestCase): [("hey-lora.safetensors", 0.4)], 5, ), - "output": [ - ("hey-lora.safetensors", 0.4), - ("l1.safetensors", 0.4), - ("l2.safetensors", -0.2), - ("l3.safetensors", 0.3), - ("l4.safetensors", 0.5), - ], + "output": ( + [ + ('hey-lora.safetensors', 0.4), + ('l1.safetensors', 0.4), + ('l2.safetensors', -0.2), + ('l3.safetensors', 0.3), + ('l4.safetensors', 0.5) + ], + 'some prompt, very cool' + ) }, - # Test lora specification not separated by comma are ignored, only latest specified is used { "input": ("some prompt, very cool, ", [], 3), - "output": [("you-lora.safetensors", 0.2)], + "output": ( + [ + ('hey-lora.safetensors', 0.4), + ('you-lora.safetensors', 0.2) + ], + 'some prompt, very cool, ' + ), }, { - "input": (", , and ", [], 6), - "output": [] + "input": (", , , and ", [], 6), + "output": ( + [], + ', , , and ' + ) } ]