-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow population of SparqlResult pydantic models by name
- Loading branch information
1 parent
504335c
commit 84b515f
Showing
2 changed files
with
24 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from cimsparql.sparql_result_json import SparqlResultHead, SparqlResultValue | ||
|
||
|
||
def test_populate_sparql_result_head_by_name(): | ||
sparql_head_1 = SparqlResultHead(variables=["a", "b"], links=["l1", "l2"]) | ||
|
||
sparql_head_2 = SparqlResultHead(vars=["a", "b"], links=["l1", "l2"]) | ||
assert sparql_head_1 == sparql_head_2 | ||
|
||
|
||
def test_populate_sparql_result_value_by_name(): | ||
sparql_value_1 = SparqlResultValue(value_type="literal", value="value") | ||
|
||
sparql_value_2 = SparqlResultValue(type="literal", value="value") | ||
assert sparql_value_1 == sparql_value_2 |