Skip to content

Commit

Permalink
Improve naming to avoid pytest conventions
Browse files Browse the repository at this point in the history
  • Loading branch information
scosman committed Sep 4, 2024
1 parent 62a52bb commit 4b6d6bb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions libs/core/kiln_ai/datamodel/test_json_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from pydantic import BaseModel


class TestJsonSchema(BaseModel):
class ExampleModel(BaseModel):
x_schema: JsonObjectSchema | None = None


Expand Down Expand Up @@ -43,7 +43,7 @@ class TestJsonSchema(BaseModel):


def test_json_schema():
o = TestJsonSchema(x_schema=json_joke_schema)
o = ExampleModel(x_schema=json_joke_schema)
parsed_schema = schema_from_json_str(o.x_schema)
assert parsed_schema is not None
assert parsed_schema["type"] == "object"
Expand All @@ -54,8 +54,8 @@ def test_json_schema():

# Not json schema
with pytest.raises(ValueError):
o = TestJsonSchema(x_schema="hello")
o = ExampleModel(x_schema="hello")
with pytest.raises(ValueError):
o = TestJsonSchema(x_schema="{'asdf':{}}")
o = ExampleModel(x_schema="{'asdf':{}}")
with pytest.raises(ValueError):
o = TestJsonSchema(x_schema="{asdf")
o = ExampleModel(x_schema="{asdf")

0 comments on commit 4b6d6bb

Please sign in to comment.