Skip to content

Commit

Permalink
update output formatting in test
Browse files Browse the repository at this point in the history
  • Loading branch information
rgbkrk committed Sep 25, 2024
1 parent cd3317e commit 2c5ab63
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions tests/test_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def test_generate_function_schema_with_model_argument():
"x": {"type": "integer"},
"y": {"type": "string"},
"z": {"default": False, "type": "boolean"},
"model": {"allOf": [{"$ref": "#/$defs/SimpleModel"}], "default": None},
"model": {"$ref": "#/$defs/SimpleModel", "default": None},
},
"required": ["x", "y"],
"$defs": {
Expand All @@ -197,6 +197,7 @@ def test_generate_function_schema_with_model_argument():
}
},
},
"strict": None,
}
assert schema.model_dump() == expected_schema

Expand All @@ -212,8 +213,8 @@ def test_generate_function_schema_with_model_and_nested_model_arguments():
"x": {"type": "integer"},
"y": {"type": "string"},
"z": {"default": False, "type": "boolean"},
"model": {"allOf": [{"$ref": "#/$defs/SimpleModel"}], "default": None},
"nested_model": {"allOf": [{"$ref": "#/$defs/NestedModel"}], "default": None},
"model": {"$ref": "#/$defs/SimpleModel", "default": None},
"nested_model": {"$ref": "#/$defs/NestedModel", "default": None},
},
"required": ["x", "y"],
"$defs": {
Expand Down Expand Up @@ -249,6 +250,7 @@ def test_generate_function_schema_with_model_and_nested_model_arguments():
},
},
},
"strict": None,
}
assert schema.model_dump() == expected_schema

Expand All @@ -268,6 +270,7 @@ def test_generate_function_schema_with_uuid_argument():
},
"required": ["x", "y"],
},
"strict": None,
}
assert schema.model_dump() == expected_schema

Expand Down Expand Up @@ -383,7 +386,6 @@ async def test_function_registry_call_edge_cases():
async def test_function_registry_call_tool():
registry = FunctionRegistry()
registry.register(simple_func, SimpleModel)

registry.register(simple_func_with_model_arg)

tools = registry.tools
Expand Down Expand Up @@ -416,7 +418,7 @@ async def test_function_registry_call_tool():
"x": {"type": "integer"},
"y": {"type": "string"},
"z": {"default": False, "type": "boolean"},
"model": {"allOf": [{"$ref": "#/$defs/SimpleModel"}], "default": None},
"model": {"$ref": "#/$defs/SimpleModel", "default": None},
},
"required": ["x", "y"],
"$defs": {
Expand Down

0 comments on commit 2c5ab63

Please sign in to comment.