aboutsummaryrefslogtreecommitdiffstats
path: root/test/front/test_bsfs.py
diff options
context:
space:
mode:
authorMatthias Baumgartner <dev@igsor.net>2022-12-18 14:17:44 +0100
committerMatthias Baumgartner <dev@igsor.net>2022-12-18 14:17:44 +0100
commit12d95ed8bda18f2ef9d36190919cb838bfb5efcf (patch)
tree84202e614a9f477e9bff3a4f20456ebc8c000321 /test/front/test_bsfs.py
parent8ed8dbb4010a9a75cf6e61d185327825fe783776 (diff)
downloadbsfs-12d95ed8bda18f2ef9d36190919cb838bfb5efcf.tar.gz
bsfs-12d95ed8bda18f2ef9d36190919cb838bfb5efcf.tar.bz2
bsfs-12d95ed8bda18f2ef9d36190919cb838bfb5efcf.zip
bsfs lib and builders
Diffstat (limited to 'test/front/test_bsfs.py')
-rw-r--r--test/front/test_bsfs.py38
1 files changed, 38 insertions, 0 deletions
diff --git a/test/front/test_bsfs.py b/test/front/test_bsfs.py
new file mode 100644
index 0000000..0d7f383
--- /dev/null
+++ b/test/front/test_bsfs.py
@@ -0,0 +1,38 @@
+"""
+
+Part of the bsfs test suite.
+A copy of the license is provided with the project.
+Author: Matthias Baumgartner, 2022
+"""
+# imports
+import unittest
+
+# bsie imports
+from bsfs.graph import Graph
+from bsfs.triple_store import SparqlStore
+from bsfs.utils import errors, URI
+
+# objects to test
+from bsfs.front.bsfs import Open
+
+
+## code ##
+
+class TestBSFS(unittest.TestCase):
+ def test_open(self):
+ # valid config produces a valid graph
+ config = {'Graph': {'backend': {'SparqlStore': {}}, 'user': 'http://example.com/me'}}
+ graph = Open(config)
+ self.assertIsInstance(graph, Graph)
+ self.assertIsInstance(graph._backend, SparqlStore)
+ self.assertEqual(graph._user, URI('http://example.com/me'))
+ # invalid config raises an error
+ self.assertRaises(errors.ConfigError, Open, {})
+
+
+## main ##
+
+if __name__ == '__main__':
+ unittest.main()
+
+## EOF ##