aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMatthias Baumgartner <dev@igsor.net>2023-01-16 21:36:11 +0100
committerMatthias Baumgartner <dev@igsor.net>2023-01-16 21:36:11 +0100
commit4f868bcb3be2658960eace3222563cc9a819366a (patch)
treececc0f3cd966ad839d60ce603fcd63caaa286c85 /test
parent8439089807bbad92e95ad9062dc74c3d71f5d7eb (diff)
downloadbsie-4f868bcb3be2658960eace3222563cc9a819366a.tar.gz
bsie-4f868bcb3be2658960eace3222563cc9a819366a.tar.bz2
bsie-4f868bcb3be2658960eace3222563cc9a819366a.zip
info schema and feature tests
Diffstat (limited to 'test')
-rw-r--r--test/apps/test_info.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/apps/test_info.py b/test/apps/test_info.py
index f52c581..60e9ba1 100644
--- a/test/apps/test_info.py
+++ b/test/apps/test_info.py
@@ -10,6 +10,9 @@ import contextlib
import io
import unittest
+# bsie imports
+from bsie.utils import bsfs
+
# objects to test
from bsie.apps.info import main
@@ -28,6 +31,22 @@ class TestIndex(unittest.TestCase):
'http://bsfs.ai/schema/Predicate',
'http://bsfs.ai/schema/Entity#filename',
'http://bsfs.ai/schema/Entity#filesize',
+ 'http://bsfs.ai/schema/Entity/colors_spatial#0658f2234a054e1dd59a14462c89f7733e019160419c796356aa831498bd0a04'
+ })
+
+ def test_schema(self):
+ outbuf = io.StringIO()
+ with contextlib.redirect_stdout(outbuf):
+ # show schema infos
+ main(['schema'])
+ # verify output
+ schema = bsfs.schema.from_string(outbuf.getvalue())
+ self.assertSetEqual({pred.uri for pred in schema.predicates()}, {
+ 'http://bsfs.ai/schema/Entity#author',
+ 'http://bsfs.ai/schema/Predicate',
+ 'http://bsfs.ai/schema/Entity#filename',
+ 'http://bsfs.ai/schema/Entity#filesize',
+ 'http://bsfs.ai/schema/Entity/colors_spatial#0658f2234a054e1dd59a14462c89f7733e019160419c796356aa831498bd0a04'
})
def test_invalid(self):