diff options
author | Matthias Baumgartner <dev@igsor.net> | 2023-03-05 19:25:17 +0100 |
---|---|---|
committer | Matthias Baumgartner <dev@igsor.net> | 2023-03-05 19:25:17 +0100 |
commit | e4845c627e97a6d125bf33d9e7a4a8d373d7fc4a (patch) | |
tree | 634198c34aae3c0306ce30ac7452abd7b53a14e8 /test/apps | |
parent | 9b490d19dcebc0fc24cb2ab89a783f1f7d6147f7 (diff) | |
parent | 3ae93a405724ca6b5ddeb0b458fcc95685f83f09 (diff) | |
download | bsfs-e4845c627e97a6d125bf33d9e7a4a8d373d7fc4a.tar.gz bsfs-e4845c627e97a6d125bf33d9e7a4a8d373d7fc4a.tar.bz2 bsfs-e4845c627e97a6d125bf33d9e7a4a8d373d7fc4a.zip |
Merge branch 'mb/diogenes' into develop
Diffstat (limited to 'test/apps')
-rw-r--r-- | test/apps/schema-1.nt | 4 | ||||
-rw-r--r-- | test/apps/schema-2.nt | 4 | ||||
-rw-r--r-- | test/apps/test_init.py | 5 | ||||
-rw-r--r-- | test/apps/test_main.py | 37 | ||||
-rw-r--r-- | test/apps/test_migrate.py | 5 |
5 files changed, 41 insertions, 14 deletions
diff --git a/test/apps/schema-1.nt b/test/apps/schema-1.nt index e57146d..4daf0ad 100644 --- a/test/apps/schema-1.nt +++ b/test/apps/schema-1.nt @@ -3,8 +3,8 @@ prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix xsd: <http://www.w3.org/2001/XMLSchema#> # common bsfs prefixes -prefix bsfs: <http://bsfs.ai/schema/> -prefix bse: <http://bsfs.ai/schema/Entity#> +prefix bsfs: <http://schema.bsfs.io/core/> +prefix bse: <http://schema.bsfs.io/core/Node/Entity#> # essential nodes bsfs:Entity rdfs:subClassOf bsfs:Node . diff --git a/test/apps/schema-2.nt b/test/apps/schema-2.nt index 4c5468f..4eb2467 100644 --- a/test/apps/schema-2.nt +++ b/test/apps/schema-2.nt @@ -3,8 +3,8 @@ prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix xsd: <http://www.w3.org/2001/XMLSchema#> # common bsfs prefixes -prefix bsfs: <http://bsfs.ai/schema/> -prefix bse: <http://bsfs.ai/schema/Entity#> +prefix bsfs: <http://schema.bsfs.io/core/> +prefix bse: <http://schema.bsfs.io/core/Node/Entity#> # essential nodes bsfs:Entity rdfs:subClassOf bsfs:Node . diff --git a/test/apps/test_init.py b/test/apps/test_init.py index bae6a68..59e10eb 100644 --- a/test/apps/test_init.py +++ b/test/apps/test_init.py @@ -1,9 +1,4 @@ -""" -Part of the bsfs test suite. -A copy of the license is provided with the project. -Author: Matthias Baumgartner, 2022 -""" # imports import contextlib import io diff --git a/test/apps/test_main.py b/test/apps/test_main.py new file mode 100644 index 0000000..d61372f --- /dev/null +++ b/test/apps/test_main.py @@ -0,0 +1,37 @@ + +# imports +import contextlib +import io +import json +import unittest + +# objects to test +from bsfs.apps import main + + +## code ## + +class TestMain(unittest.TestCase): + def test_main(self): + # must at least pass an app + with contextlib.redirect_stderr(io.StringIO()): + self.assertRaises(SystemExit, main, []) + # app takes over + with contextlib.redirect_stderr(io.StringIO()): + self.assertRaises(SystemExit, main, ['init']) + outbuf = io.StringIO() + with contextlib.redirect_stdout(outbuf): + main(['init', 'sparql']) + self.assertEqual(json.loads(outbuf.getvalue()), { + 'Graph': { + 'user': 'http://example.com/me', + 'backend': { + 'SparqlStore': {}}}}) + + +## main ## + +if __name__ == '__main__': + unittest.main() + +## EOF ## diff --git a/test/apps/test_migrate.py b/test/apps/test_migrate.py index 230c032..618cb37 100644 --- a/test/apps/test_migrate.py +++ b/test/apps/test_migrate.py @@ -1,9 +1,4 @@ -""" -Part of the bsfs test suite. -A copy of the license is provided with the project. -Author: Matthias Baumgartner, 2022 -""" # imports import contextlib import io |