aboutsummaryrefslogtreecommitdiffstats
path: root/test/apps/test_info.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/apps/test_info.py')
-rw-r--r--test/apps/test_info.py21
1 files changed, 20 insertions, 1 deletions
diff --git a/test/apps/test_info.py b/test/apps/test_info.py
index 6f4d98f..60e9ba1 100644
--- a/test/apps/test_info.py
+++ b/test/apps/test_info.py
@@ -4,12 +4,15 @@ Part of the bsie test suite.
A copy of the license is provided with the project.
Author: Matthias Baumgartner, 2022
"""
-# imports
+# standard imports
import argparse
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):