From ce2867c237c9372040cf0475e13902208adc0f7b Mon Sep 17 00:00:00 2001 From: James Briggs <35938317+jamescalam@users.noreply.github.com> Date: Thu, 28 Dec 2023 10:19:18 +0100 Subject: [PATCH] update encoder mock --- tests/unit/test_layer.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/unit/test_layer.py b/tests/unit/test_layer.py index 3d1b6604..f94c84d0 100644 --- a/tests/unit/test_layer.py +++ b/tests/unit/test_layer.py @@ -177,7 +177,7 @@ class TestRouteLayer: route_layer = RouteLayer(encoder=openai_encoder, routes=routes) route_layer.to_json("test_output.json") assert os.path.exists("test_output.json") - with patch("semantic_router.schema.Encoder", new_callable=Mock): + with patch("semantic_router.encoders.OpenAIEncoder", new_callable=Mock): route_layer_from_file = RouteLayer.from_json("test_output.json") assert ( route_layer_from_file.index is not None @@ -189,7 +189,7 @@ class TestRouteLayer: route_layer = RouteLayer(encoder=openai_encoder, routes=routes) route_layer.to_yaml("test_output.yaml") assert os.path.exists("test_output.yaml") - with patch("semantic_router.schema.Encoder", new_callable=Mock): + with patch("semantic_router.encoders.OpenAIEncoder", new_callable=Mock): route_layer_from_file = RouteLayer.from_yaml("test_output.yaml") assert ( route_layer_from_file.index is not None @@ -202,7 +202,7 @@ class TestRouteLayer: # confirm route creation functions as expected layer_config = route_layer.to_config() assert layer_config.routes == routes - with patch("semantic_router.schema.Encoder", new_callable=Mock): + with patch("semantic_router.encoders.OpenAIEncoder", new_callable=Mock): # now load from config and confirm it's the same route_layer_from_config = RouteLayer.from_config(layer_config) assert (route_layer_from_config.index == route_layer.index).all() -- GitLab