aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPjotr Prins2020-11-07 10:21:48 +0000
committerPjotr Prins2020-11-07 10:21:48 +0000
commit8a02280c4bd05a7f8df598a75a1ea2d3caaddd7d (patch)
treef145ff22304589c4c7161da3cad01d90aeeba749
parent9709eca5c76aabe823ba34d976c5d11a9d150b76 (diff)
downloadbh20-seq-resource-8a02280c4bd05a7f8df598a75a1ea2d3caaddd7d.tar.gz
bh20-seq-resource-8a02280c4bd05a7f8df598a75a1ea2d3caaddd7d.tar.lz
bh20-seq-resource-8a02280c4bd05a7f8df598a75a1ea2d3caaddd7d.zip
Tests: add runner and frame for SPARQL
-rw-r--r--.guix-test2
-rw-r--r--test/data/regression/TN_UT2.rdf64
-rw-r--r--test/runner.py17
-rw-r--r--test/test_shex.py8
-rw-r--r--test/test_sparql.py11
5 files changed, 64 insertions, 38 deletions
diff --git a/.guix-test b/.guix-test
index 362fe8b..b8e92a0 100644
--- a/.guix-test
+++ b/.guix-test
@@ -8,4 +8,4 @@ export GUILE_LOAD_COMPILED_PATH=$GUIX_PROFILE/share/guile/site/3.0/
ls $GUILE_LOAD_PATH
-env GUIX_PACKAGE_PATH=~/iwrk/opensource/guix/guix-bioinformatics/ $GUIX_PROFILE/bin/guix environment -C guix --ad-hoc git python python-flask python-pyyaml python-pycurl python-magic nss-certs python-pyshex python-pyyaml openssl python-pyshex python-pyshexc minimap2 python-schema-salad python-arvados-python-client -- python3 test/test_shex.py
+env GUIX_PACKAGE_PATH=~/iwrk/opensource/guix/guix-bioinformatics/ $GUIX_PROFILE/bin/guix environment -C guix --ad-hoc git python python-flask python-pyyaml python-pycurl python-magic nss-certs python-pyshex python-pyyaml openssl python-pyshex python-pyshexc minimap2 python-schema-salad python-arvados-python-client -- python3 test/runner.py
diff --git a/test/data/regression/TN_UT2.rdf b/test/data/regression/TN_UT2.rdf
index 84353a5..28b7a2d 100644
--- a/test/data/regression/TN_UT2.rdf
+++ b/test/data/regression/TN_UT2.rdf
@@ -1,33 +1,33 @@
-_:N850430bbc537473e8fbab09c300daf2b <https://creativecommons.org/ns#License> <https://creativecommons.org/licenses/by/4.0/> .
-_:Ncab40e8bd4b84431aa6782f7e7480ef3 <http://www.ebi.ac.uk/efo/EFO_0000532> <http://purl.obolibrary.org/obo/NCBITaxon_9606> .
-_:N3c28bc8014134d77823451de114c6085 <http://purl.obolibrary.org/obo/NCIT_C42781> "Mariah Taylor" .
-_:Ncab40e8bd4b84431aa6782f7e7480ef3 <http://semanticscience.org/resource/SIO_000115> "TN_UT2" .
-<file:///export/local/home/wrk/iwrk/opensource/code/vg/bh20-seq-resource/test/data/input/placeholder> <http://biohackathon.org/bh20-seq-schema#MainSchema/license> _:N850430bbc537473e8fbab09c300daf2b .
-_:N3c28bc8014134d77823451de114c6085 <http://purl.obolibrary.org/obo/NCIT_C42781> "TN_UT2" .
-_:N850430bbc537473e8fbab09c300daf2b <https://creativecommons.org/ns#attributionURL> <https://www.uthsc.edu/medicine/molecular-sciences/faculty-directory/jonsson.php> .
-_:N3c28bc8014134d77823451de114c6085 <http://semanticscience.org/resource/SIO_000172> "UTHSC, Memphis, Tennessee 38163, USA" .
-_:Nebe62f68542a47d0936e953195cf25d7 <http://purl.obolibrary.org/obo/OBI_0001479> <http://purl.obolibrary.org/obo/NCIT_C155831> .
-_:N3c28bc8014134d77823451de114c6085 <http://semanticscience.org/resource/SIO_000116> "Colleen B. Jonsson" .
-_:N78bfdbe9d12745e99164d619cb125277 <http://edamontology.org/data_1875> <http://purl.obolibrary.org/obo/NCBITaxon_2697049> .
-_:Nbf9e7b47381b4965926a47bf5b34e489 <http://semanticscience.org/resource/SIO_001167> "Oxford Nanopore MiniIon RNA long reads" .
-<file:///export/local/home/wrk/iwrk/opensource/code/vg/bh20-seq-resource/test/data/input/placeholder> <http://biohackathon.org/bh20-seq-schema#MainSchema/host> _:Ncab40e8bd4b84431aa6782f7e7480ef3 .
-_:Nbf9e7b47381b4965926a47bf5b34e489 <http://www.ebi.ac.uk/efo/EFO_0002699> "https://bio.tools/BWA#!" .
-_:Nebe62f68542a47d0936e953195cf25d7 <http://semanticscience.org/resource/SIO_000115> "TN_UT2" .
-<file:///export/local/home/wrk/iwrk/opensource/code/vg/bh20-seq-resource/test/data/input/placeholder> <http://biohackathon.org/bh20-seq-schema#MainSchema/sample> _:Nebe62f68542a47d0936e953195cf25d7 .
-_:N850430bbc537473e8fbab09c300daf2b <https://creativecommons.org/ns#attributionName> "Mariah Taylor, Colleen Jonsson" .
-_:N78bfdbe9d12745e99164d619cb125277 <http://semanticscience.org/resource/SIO_010055> "SARS-CoV-2/human/USA/TN_UT2/2020" .
-_:N3c28bc8014134d77823451de114c6085 <http://purl.obolibrary.org/obo/NCIT_C42781> "Colleen Jonsson" .
-_:N3c28bc8014134d77823451de114c6085 <http://semanticscience.org/resource/SIO_000115> <https://orcid.org/0000-0002-2640-7672> .
-_:Nebe62f68542a47d0936e953195cf25d7 <http://ncicb.nci.nih.gov/xml/owl/EVS/Thesaurus.owl#C25164> "2020-04-26" .
-_:Nebe62f68542a47d0936e953195cf25d7 <http://purl.obolibrary.org/obo/GAZ_00000448> <http://www.wikidata.org/entity/Q3289517> .
-_:N850430bbc537473e8fbab09c300daf2b <http://purl.org/metadata/dublin_core_elements#Title> "TN_UT2 - Pegram, Tennessee, USA" .
-_:Nbf9e7b47381b4965926a47bf5b34e489 <http://purl.obolibrary.org/obo/OBI_0600047> <http://www.ebi.ac.uk/efo/EFO_0008632> .
-_:N3c28bc8014134d77823451de114c6085 <http://semanticscience.org/resource/SIO_000116> "Mariah Taylor" .
-_:N3c28bc8014134d77823451de114c6085 <http://www.ebi.ac.uk/efo/EFO_0001741> "TN_UT2" .
-_:N3c28bc8014134d77823451de114c6085 <http://semanticscience.org/resource/SIO_000116> "Pjotr Prins" .
-<file:///export/local/home/wrk/iwrk/opensource/code/vg/bh20-seq-resource/test/data/input/placeholder> <http://biohackathon.org/bh20-seq-schema#MainSchema/submitter> _:N3c28bc8014134d77823451de114c6085 .
-_:N3c28bc8014134d77823451de114c6085 <http://semanticscience.org/resource/SIO_000115> <https://orcid.org/0000-0002-8021-9162> .
-<file:///export/local/home/wrk/iwrk/opensource/code/vg/bh20-seq-resource/test/data/input/placeholder> <http://biohackathon.org/bh20-seq-schema#MainSchema/virus> _:N78bfdbe9d12745e99164d619cb125277 .
-_:N3c28bc8014134d77823451de114c6085 <http://purl.obolibrary.org/obo/NCIT_C37984> "Regional Biocontainment Laboratory, Memphis, TN" .
-<file:///export/local/home/wrk/iwrk/opensource/code/vg/bh20-seq-resource/test/data/input/placeholder> <http://biohackathon.org/bh20-seq-schema#MainSchema/technology> _:Nbf9e7b47381b4965926a47bf5b34e489 .
+_:N76e90938195c463c9dd2af9dadcf3d56 <http://semanticscience.org/resource/SIO_000115> <https://orcid.org/0000-0002-8021-9162> .
+_:N14a259ceba1446a389be1076f7090540 <http://www.ebi.ac.uk/efo/EFO_0000532> <http://purl.obolibrary.org/obo/NCBITaxon_9606> .
+<file:///export/local/home/wrk/iwrk/opensource/code/vg/bh20-seq-resource/test/data/input/placeholder> <http://biohackathon.org/bh20-seq-schema#MainSchema/host> _:N14a259ceba1446a389be1076f7090540 .
+<file:///export/local/home/wrk/iwrk/opensource/code/vg/bh20-seq-resource/test/data/input/placeholder> <http://biohackathon.org/bh20-seq-schema#MainSchema/license> _:N1421ab28904c425faf6c308f77800e08 .
+_:N76e90938195c463c9dd2af9dadcf3d56 <http://purl.obolibrary.org/obo/NCIT_C42781> "Colleen Jonsson" .
+<file:///export/local/home/wrk/iwrk/opensource/code/vg/bh20-seq-resource/test/data/input/placeholder> <http://biohackathon.org/bh20-seq-schema#MainSchema/sample> _:Na3153e61734c4cd1b7c4a11bb64b76cc .
+_:N1421ab28904c425faf6c308f77800e08 <https://creativecommons.org/ns#attributionURL> <https://www.uthsc.edu/medicine/molecular-sciences/faculty-directory/jonsson.php> .
+_:N17d644aee0054862ab8beb6cdf5cb4d6 <http://www.ebi.ac.uk/efo/EFO_0002699> "https://bio.tools/BWA#!" .
+_:N76e90938195c463c9dd2af9dadcf3d56 <http://purl.obolibrary.org/obo/NCIT_C42781> "TN_UT2" .
+_:N69368ab7984c4659bcfa493bdca2d5f1 <http://semanticscience.org/resource/SIO_010055> "SARS-CoV-2/human/USA/TN_UT2/2020" .
+_:Na3153e61734c4cd1b7c4a11bb64b76cc <http://purl.obolibrary.org/obo/OBI_0001479> <http://purl.obolibrary.org/obo/NCIT_C155831> .
+_:N76e90938195c463c9dd2af9dadcf3d56 <http://semanticscience.org/resource/SIO_000116> "Colleen B. Jonsson" .
+_:N76e90938195c463c9dd2af9dadcf3d56 <http://semanticscience.org/resource/SIO_000115> <https://orcid.org/0000-0002-2640-7672> .
+<file:///export/local/home/wrk/iwrk/opensource/code/vg/bh20-seq-resource/test/data/input/placeholder> <http://biohackathon.org/bh20-seq-schema#MainSchema/submitter> _:N76e90938195c463c9dd2af9dadcf3d56 .
+_:N1421ab28904c425faf6c308f77800e08 <http://purl.org/metadata/dublin_core_elements#Title> "TN_UT2 - Pegram, Tennessee, USA" .
+_:N1421ab28904c425faf6c308f77800e08 <https://creativecommons.org/ns#attributionName> "Mariah Taylor, Colleen Jonsson" .
+_:N76e90938195c463c9dd2af9dadcf3d56 <http://purl.obolibrary.org/obo/NCIT_C42781> "Mariah Taylor" .
+_:N76e90938195c463c9dd2af9dadcf3d56 <http://semanticscience.org/resource/SIO_000116> "Mariah Taylor" .
+_:N76e90938195c463c9dd2af9dadcf3d56 <http://purl.obolibrary.org/obo/NCIT_C37984> "Regional Biocontainment Laboratory, Memphis, TN" .
+_:N14a259ceba1446a389be1076f7090540 <http://semanticscience.org/resource/SIO_000115> "TN_UT2" .
+_:Na3153e61734c4cd1b7c4a11bb64b76cc <http://purl.obolibrary.org/obo/GAZ_00000448> <http://www.wikidata.org/entity/Q3289517> .
+<file:///export/local/home/wrk/iwrk/opensource/code/vg/bh20-seq-resource/test/data/input/placeholder> <http://biohackathon.org/bh20-seq-schema#MainSchema/technology> _:N17d644aee0054862ab8beb6cdf5cb4d6 .
+_:N1421ab28904c425faf6c308f77800e08 <https://creativecommons.org/ns#License> <https://creativecommons.org/licenses/by/4.0/> .
+_:N76e90938195c463c9dd2af9dadcf3d56 <http://semanticscience.org/resource/SIO_000116> "Pjotr Prins" .
+_:N76e90938195c463c9dd2af9dadcf3d56 <http://semanticscience.org/resource/SIO_000172> "UTHSC, Memphis, Tennessee 38163, USA" .
+_:N17d644aee0054862ab8beb6cdf5cb4d6 <http://semanticscience.org/resource/SIO_001167> "Oxford Nanopore MiniIon RNA long reads" .
+_:N69368ab7984c4659bcfa493bdca2d5f1 <http://edamontology.org/data_1875> <http://purl.obolibrary.org/obo/NCBITaxon_2697049> .
+_:Na3153e61734c4cd1b7c4a11bb64b76cc <http://semanticscience.org/resource/SIO_000115> "TN_UT2" .
+_:N76e90938195c463c9dd2af9dadcf3d56 <http://www.ebi.ac.uk/efo/EFO_0001741> "TN_UT2" .
+<file:///export/local/home/wrk/iwrk/opensource/code/vg/bh20-seq-resource/test/data/input/placeholder> <http://biohackathon.org/bh20-seq-schema#MainSchema/virus> _:N69368ab7984c4659bcfa493bdca2d5f1 .
+_:N17d644aee0054862ab8beb6cdf5cb4d6 <http://purl.obolibrary.org/obo/OBI_0600047> <http://www.ebi.ac.uk/efo/EFO_0008632> .
+_:Na3153e61734c4cd1b7c4a11bb64b76cc <http://ncicb.nci.nih.gov/xml/owl/EVS/Thesaurus.owl#C25164> "2020-04-26" .
diff --git a/test/runner.py b/test/runner.py
new file mode 100644
index 0000000..3cfe042
--- /dev/null
+++ b/test/runner.py
@@ -0,0 +1,17 @@
+# Run tests. python3 test/runner.py
+
+import unittest
+
+# initialize the test suite
+loader = unittest.TestLoader()
+suite = unittest.TestSuite()
+
+import test_shex
+import test_sparql
+
+suite.addTests(loader.loadTestsFromModule(test_shex))
+suite.addTests(loader.loadTestsFromModule(test_sparql))
+
+# initialize a runner, pass it your suite and run it
+runner = unittest.TextTestRunner(verbosity=3)
+result = runner.run(suite)
diff --git a/test/test_shex.py b/test/test_shex.py
index e5d97cc..728bfdc 100644
--- a/test/test_shex.py
+++ b/test/test_shex.py
@@ -1,14 +1,12 @@
+# Run with python3 test/test_shex.py
+
import schema_salad.schema
import schema_salad.ref_resolver
import schema_salad.jsonld_context
-# import pkg_resources
-import logging
-# import traceback
-# from rdflib import Graph, Namespace
from pyshex.evaluate import evaluate
import unittest
-class TestStringMethods(unittest.TestCase):
+class TestShexMethods(unittest.TestCase):
def test_schema(self):
with open("bh20sequploader/bh20seq-schema.yml") as schema_resource:
diff --git a/test/test_sparql.py b/test/test_sparql.py
new file mode 100644
index 0000000..00bb3ed
--- /dev/null
+++ b/test/test_sparql.py
@@ -0,0 +1,11 @@
+# Run with python3 test/test_sparql.py
+
+import unittest
+
+class TestSPARQL(unittest.TestCase):
+
+ def test_sparql(self):
+ pass
+
+if __name__ == '__main__':
+ unittest.main()