mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-04-28 18:06:21 +02:00
Test suite executed from CI pipeline (#433)
* Test strategy & test cases * Unit tests * Integration tests
This commit is contained in:
parent
9c7a070681
commit
2f7fddd206
101 changed files with 17811 additions and 1 deletions
|
|
@ -1,51 +0,0 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
import pulsar
|
||||
from trustgraph.clients.prompt_client import PromptClient
|
||||
from trustgraph.objects.object import Schema
|
||||
from trustgraph.objects.field import Field, FieldType
|
||||
|
||||
schema = Schema(
|
||||
name="actors",
|
||||
description="actors in this story",
|
||||
fields=[
|
||||
Field(
|
||||
name="name", type=FieldType.STRING,
|
||||
description="Name of the animal or person in the story"
|
||||
),
|
||||
Field(
|
||||
name="legs", type=FieldType.INT,
|
||||
description="Number of legs of the animal or person"
|
||||
),
|
||||
Field(
|
||||
name="notes", type=FieldType.STRING,
|
||||
description="Additional notes or observations about this animal or person"
|
||||
),
|
||||
]
|
||||
)
|
||||
|
||||
chunk = """I noticed a cat in my garden. It is a four-legged animal
|
||||
which is a mammal and can be tame or wild. I wonder if it will be friends
|
||||
with me? I think the cat's name is Fred and it has 4 legs.
|
||||
There is also a dog barking outside. The dog has 4 legs also.
|
||||
The dog comes to my call when I shout "Come here, Bernard".
|
||||
|
||||
I am also standing in the garden, my name is Steve and I have 2 legs.
|
||||
|
||||
My friend Clifford is coming to visit shortly, he has 3 legs due to
|
||||
a freak accident at birth.
|
||||
"""
|
||||
|
||||
p = PromptClient(pulsar_host="pulsar://localhost:6650")
|
||||
|
||||
resp = p.request_rows(
|
||||
schema=schema,
|
||||
chunk=chunk,
|
||||
)
|
||||
|
||||
for d in resp:
|
||||
print(f"Name: {d['name']}")
|
||||
print(f" No. of legs: {d['legs']}")
|
||||
print(f" Notes: {d['notes']}")
|
||||
print()
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue