1
0
datagraph/test/test_datagraph.py
2024-11-28 22:31:58 +01:00

27 lines
627 B
Python

import requests_cache
import wikidata.client
import datagraph.schemeld
import datagraph.wikidata_ext
datagraph.wikidata_ext.REQUEST_SESSION = requests_cache.CachedSession('output/testing')
def test_version():
assert datagraph.__version__ is not None
def test_get_triples():
client = wikidata.client.Client()
eqv_property = client.get('P1628')
schema_root = 'https://schema.org/'
schema_prop = 'image'
triples_iter = datagraph.wikidata_ext.get_triples(
client=client,
predicate=eqv_property,
object=f'{schema_root}{schema_prop}',
)
assert triples_iter is not None