forked from RDFLib/rdflib
-
Notifications
You must be signed in to change notification settings - Fork 1
/
test_store.py
31 lines (25 loc) · 946 Bytes
/
test_store.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from rdflib import Graph
from rdflib.store import NodePickler, Store
from rdflib.namespace import NamespaceManager
def test_namespaces() -> None:
"""
This tests that Store.namespaces is an empty generator.
"""
store = Store()
assert list(store.namespaces()) == []
def test_namespaces_via_manager() -> None:
"""
This tests that NamespaceManager.namespaces works correctly with an
abstract Store.
"""
namespace_manager = NamespaceManager(Graph(store=Store()))
assert list(namespace_manager.namespaces()) == []
def test_propery_node_pickler() -> None:
"""
The ``node_pickler`` property of a `rdflib.store.Store` works correctly.
"""
store = Store()
assert isinstance(store.node_pickler, NodePickler)
# Tested twice as the property is a singleton and will do something
# different on the first invocation and second.
assert isinstance(store.node_pickler, NodePickler)