mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-23 12:11:02 +02:00
Fixing tests
This commit is contained in:
parent
88dfb5246d
commit
75c8a9b01a
1 changed files with 15 additions and 15 deletions
|
|
@ -14,7 +14,7 @@ class TestDispatchSerialize:
|
||||||
|
|
||||||
def test_to_value_with_uri(self):
|
def test_to_value_with_uri(self):
|
||||||
"""Test to_value function with URI"""
|
"""Test to_value function with URI"""
|
||||||
input_data = {"v": "http://example.com/resource", "e": True}
|
input_data = {"t": "i", "i": "http://example.com/resource"}
|
||||||
|
|
||||||
result = to_value(input_data)
|
result = to_value(input_data)
|
||||||
|
|
||||||
|
|
@ -24,7 +24,7 @@ class TestDispatchSerialize:
|
||||||
|
|
||||||
def test_to_value_with_literal(self):
|
def test_to_value_with_literal(self):
|
||||||
"""Test to_value function with literal value"""
|
"""Test to_value function with literal value"""
|
||||||
input_data = {"v": "literal string", "e": False}
|
input_data = {"t": "l", "v": "literal string"}
|
||||||
|
|
||||||
result = to_value(input_data)
|
result = to_value(input_data)
|
||||||
|
|
||||||
|
|
@ -36,14 +36,14 @@ class TestDispatchSerialize:
|
||||||
"""Test to_subgraph function with multiple triples"""
|
"""Test to_subgraph function with multiple triples"""
|
||||||
input_data = [
|
input_data = [
|
||||||
{
|
{
|
||||||
"s": {"v": "subject1", "e": True},
|
"s": {"t": "i", "i": "subject1"},
|
||||||
"p": {"v": "predicate1", "e": True},
|
"p": {"t": "i", "i": "predicate1"},
|
||||||
"o": {"v": "object1", "e": False}
|
"o": {"t": "l", "v": "object1"}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"s": {"v": "subject2", "e": False},
|
"s": {"t": "l", "v": "subject2"},
|
||||||
"p": {"v": "predicate2", "e": True},
|
"p": {"t": "i", "i": "predicate2"},
|
||||||
"o": {"v": "object2", "e": True}
|
"o": {"t": "i", "i": "object2"}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
@ -78,7 +78,7 @@ class TestDispatchSerialize:
|
||||||
|
|
||||||
result = serialize_value(term)
|
result = serialize_value(term)
|
||||||
|
|
||||||
assert result == {"v": "http://example.com/test", "e": True}
|
assert result == {"t": "i", "i": "http://example.com/test"}
|
||||||
|
|
||||||
def test_serialize_value_with_literal(self):
|
def test_serialize_value_with_literal(self):
|
||||||
"""Test serialize_value function with literal value"""
|
"""Test serialize_value function with literal value"""
|
||||||
|
|
@ -86,4 +86,4 @@ class TestDispatchSerialize:
|
||||||
|
|
||||||
result = serialize_value(term)
|
result = serialize_value(term)
|
||||||
|
|
||||||
assert result == {"v": "test literal", "e": False}
|
assert result == {"t": "l", "v": "test literal"}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue