mustrd 0.2.6__py3-none-any.whl → 0.2.6.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mustrd/README.adoc +33 -0
- mustrd/mustrd.py +24 -0
- mustrd/mustrdTestPlugin.py +4 -2
- {mustrd-0.2.6.dist-info → mustrd-0.2.6.2.dist-info}/METADATA +2 -2
- {mustrd-0.2.6.dist-info → mustrd-0.2.6.2.dist-info}/RECORD +8 -7
- {mustrd-0.2.6.dist-info → mustrd-0.2.6.2.dist-info}/LICENSE +0 -0
- {mustrd-0.2.6.dist-info → mustrd-0.2.6.2.dist-info}/WHEEL +0 -0
- {mustrd-0.2.6.dist-info → mustrd-0.2.6.2.dist-info}/entry_points.txt +0 -0
mustrd/README.adoc
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
= Developer helper
|
2
|
+
// tag::body[]
|
3
|
+
|
4
|
+
== Try it out
|
5
|
+
|
6
|
+
Ensure you have python3 installed, before you begin.
|
7
|
+
To install the necessary dependencies, run the following command from the project root.
|
8
|
+
|
9
|
+
`pip3 install -r requirements.txt`
|
10
|
+
|
11
|
+
Run the following command to execute the accompanying tests specifications.
|
12
|
+
|
13
|
+
`python3 src/run.py -v -p "test/test-specs" -g "test/data" -w "test/data" -t "test/data"`
|
14
|
+
|
15
|
+
You will see some warnings. Do not worry, some tests specifications are invalid and intentionally skipped.
|
16
|
+
|
17
|
+
For a brief explanation of the meaning of these options use the help option.
|
18
|
+
|
19
|
+
`python3 src/run.py --help`
|
20
|
+
|
21
|
+
== Run the tests
|
22
|
+
|
23
|
+
Run `pytest` from the project root.
|
24
|
+
|
25
|
+
== Additional Notes for Developers
|
26
|
+
Mustrd remains very much under development. It is anticipated that additional functionality and triplestore support will be added over time. The project uses https://python-poetry.org/docs/[Poetry] to manage dependencies so it will be necessary to have this installed to contribute towards the project. The link contains instructions on how to install and use this.
|
27
|
+
As the project is actually built from the requirements.txt file at the project root, it is necessary to export dependencies from poetry to this file before committing and pushing changes to the repository, using the following command.
|
28
|
+
|
29
|
+
`poetry export -f requirements.txt --without-hashes > requirements.txt`
|
30
|
+
|
31
|
+
|
32
|
+
|
33
|
+
// end::body[]
|
mustrd/mustrd.py
CHANGED
@@ -636,6 +636,30 @@ def get_then_update(spec_uri: URIRef, spec_graph: Graph) -> Graph:
|
|
636
636
|
|
637
637
|
return expected_results
|
638
638
|
|
639
|
+
def write_result_diff_to_log(res):
|
640
|
+
if isinstance(res, UpdateSpecFailure) or isinstance(res, ConstructSpecFailure):
|
641
|
+
log.info(f"{Fore.RED}Failed {res.spec_uri} {res.triple_store}")
|
642
|
+
log.info(f"{Fore.BLUE} In Expected Not In Actual:")
|
643
|
+
log.info(res.graph_comparison.in_expected_not_in_actual.serialize(format="ttl"))
|
644
|
+
log.info(f"{Fore.RED} in_actual_not_in_expected")
|
645
|
+
log.info(res.graph_comparison.in_actual_not_in_expected.serialize(format="ttl"))
|
646
|
+
log.info(f"{Fore.GREEN} in_both")
|
647
|
+
log.info(res.graph_comparison.in_both.serialize(format="ttl"))
|
648
|
+
|
649
|
+
if isinstance(res, SelectSpecFailure):
|
650
|
+
log.info(f"{Fore.RED}Failed {res.spec_uri} {res.triple_store}")
|
651
|
+
log.info(res.message)
|
652
|
+
log.info(res.table_comparison.to_markdown())
|
653
|
+
if isinstance(res, SpecPassedWithWarning):
|
654
|
+
log.info(f"{Fore.YELLOW}Passed with warning {res.spec_uri} {res.triple_store}")
|
655
|
+
log.info(res.warning)
|
656
|
+
if isinstance(res, TripleStoreConnectionError) or isinstance(res, SparqlExecutionError) or \
|
657
|
+
isinstance(res, SparqlParseFailure):
|
658
|
+
log.info(f"{Fore.RED}Failed {res.spec_uri} {res.triple_store}")
|
659
|
+
log.info(res.exception)
|
660
|
+
if isinstance(res, SpecSkipped):
|
661
|
+
log.info(f"{Fore.YELLOW}Skipped {res.spec_uri} {res.triple_store}")
|
662
|
+
log.info(res.message)
|
639
663
|
|
640
664
|
def calculate_row_difference(df1: pandas.DataFrame,
|
641
665
|
df2: pandas.DataFrame) -> pandas.DataFrame:
|
mustrd/mustrdTestPlugin.py
CHANGED
@@ -32,7 +32,7 @@ from pytest import Session
|
|
32
32
|
|
33
33
|
from mustrd.TestResult import ResultList, TestResult, get_result_list
|
34
34
|
from mustrd.utils import get_mustrd_root
|
35
|
-
from mustrd.mustrd import get_triple_store_graph, get_triple_stores
|
35
|
+
from mustrd.mustrd import write_result_diff_to_log, get_triple_store_graph, get_triple_stores
|
36
36
|
from mustrd.mustrd import Specification, SpecSkipped, validate_specs, get_specs, SpecPassed, run_spec
|
37
37
|
from mustrd.namespace import MUST, TRIPLESTORE, MUSTRDTEST
|
38
38
|
from typing import Union
|
@@ -331,4 +331,6 @@ def run_test_spec(test_spec):
|
|
331
331
|
if result_type == SpecSkipped:
|
332
332
|
# FIXME: Better exception management
|
333
333
|
pytest.skip("Unsupported configuration")
|
334
|
-
|
334
|
+
if result_type != SpecPassed:
|
335
|
+
write_result_diff_to_log(result)
|
336
|
+
return result_type == SpecPassed
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: mustrd
|
3
|
-
Version: 0.2.6
|
3
|
+
Version: 0.2.6.2
|
4
4
|
Summary: A Spec By Example framework for RDF and SPARQL, Inspired by Cucumber.
|
5
5
|
Home-page: https://github.com/Semantic-partners/mustrd
|
6
6
|
License: MIT
|
@@ -42,7 +42,7 @@ Description-Content-Type: text/markdown
|
|
42
42
|
# mustrd
|
43
43
|
|
44
44
|
|
45
|
-
[<img src="https://github.com/Semantic-partners/mustrd/raw/python-coverage-comment-action-data/badge.svg" alt="coverage badge">](https://github.com/Semantic-partners/mustrd/tree/python-coverage-comment-action-data)
|
45
|
+
[<img src="https://github.com/Semantic-partners/mustrd/raw/python-coverage-comment-action-data/badge.svg?sanitize=true" alt="coverage badge">](https://github.com/Semantic-partners/mustrd/tree/python-coverage-comment-action-data)
|
46
46
|
|
47
47
|
### Why?
|
48
48
|
|
@@ -1,3 +1,4 @@
|
|
1
|
+
mustrd/README.adoc,sha256=E5KuShPEl2U6NmRzEAwZtAhBoyJsOvjGS1CM2UsbSQ4,1394
|
1
2
|
mustrd/README.md,sha256=CR08uZ4eNELHBdDRXAVKkRZ4hgQB9OXA7tFRy4ER-LI,1364
|
2
3
|
mustrd/TestResult.py,sha256=K4yth-rYrK6Pl7SFiTAZkUStBIzHlgq0oxSSpq5F34M,4849
|
3
4
|
mustrd/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -10,11 +11,11 @@ mustrd/model/ontology.ttl,sha256=AK27qyT8GW_SwJDwTFvtfxndBPEfYT6Y1jiW26Hyjg0,168
|
|
10
11
|
mustrd/model/test-resources/resources.ttl,sha256=1Dsp1nuNxauj9bxeX-HShQsiO-CVy5Irwm2y2x0cdjI,1498
|
11
12
|
mustrd/model/triplestoreOntology.ttl,sha256=jK9zJOInlJ8uXzbAsQarBBrZgGrMrMXbrsuXGMbp020,6025
|
12
13
|
mustrd/model/triplestoreshapes.ttl,sha256=VqdItpI9qFQSj4leZuwbIoAjWJehhR8bao0EPvtGMR0,1835
|
13
|
-
mustrd/mustrd.py,sha256=
|
14
|
+
mustrd/mustrd.py,sha256=tknuyMRvk0To9EEPPE3VmtUvix7TkQEy5_jTOdtmP0Q,35310
|
14
15
|
mustrd/mustrdAnzo.py,sha256=AfXKcU17_PQwoG1RfUVYgctcXMJPrfZdmEXzVi7E3HM,12155
|
15
16
|
mustrd/mustrdGraphDb.py,sha256=ySYYGvKUgXIS8QLLS7FEcppLlSb0qZ3lLlYzPf_Sr3Y,5474
|
16
17
|
mustrd/mustrdRdfLib.py,sha256=CvrzEl1-lEPugYVe3y_Ip8JMzUxv6IeWauLOa_WA-XI,2073
|
17
|
-
mustrd/mustrdTestPlugin.py,sha256=
|
18
|
+
mustrd/mustrdTestPlugin.py,sha256=YFUzFGMY6Aw71IjLh-J5CwfSWfQ5rOw_oq1Bufg4Bjw,15013
|
18
19
|
mustrd/namespace.py,sha256=xGfH-nRP3t_I4rmoGJPqlSGbI0G5HUMlUeAl7l_yW-s,3622
|
19
20
|
mustrd/run.py,sha256=5xZUgKPMBQ-03cWROAnwtbOs2Nb0Vat6n8Fi6EyfS-k,4257
|
20
21
|
mustrd/spec_component.py,sha256=7BmMjJMy0ACbVBAEZpe5ZprnDZYs6h5f7-fI38l3jAk,31483
|
@@ -24,8 +25,8 @@ mustrd/templates/md_ResultList_template.jinja,sha256=_8joJ7vtw_qoqxv3HhUtBgRfhOe
|
|
24
25
|
mustrd/templates/md_stats_template.jinja,sha256=96W62cMWu9UGLNv65ZQ8RYLjkxKHhJy-FlUtXgud6XY,155
|
25
26
|
mustrd/test/test_mustrd.py,sha256=ku4-UQ2railFo6z9apaIkPFOk980XSwCPBEHjhwWZUE,126
|
26
27
|
mustrd/utils.py,sha256=OGdLvw7GvjrFgTJo0J97Xwdh-_ZgSmapmOistrEchO0,1387
|
27
|
-
mustrd-0.2.6.dist-info/LICENSE,sha256=r8nmh5fUct9h2w8_RDl13EIscvmwCLoarPr1kg35MnA,1078
|
28
|
-
mustrd-0.2.6.dist-info/METADATA,sha256=
|
29
|
-
mustrd-0.2.6.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
30
|
-
mustrd-0.2.6.dist-info/entry_points.txt,sha256=v7V7sN0_L1aB4Ug_9io5axlQSeJ1C0tNrQWwdXdV58s,50
|
31
|
-
mustrd-0.2.6.dist-info/RECORD,,
|
28
|
+
mustrd-0.2.6.2.dist-info/LICENSE,sha256=r8nmh5fUct9h2w8_RDl13EIscvmwCLoarPr1kg35MnA,1078
|
29
|
+
mustrd-0.2.6.2.dist-info/METADATA,sha256=mNAB4a0bJ8GD8ADEK3VVtsdyYJRHXUkHDBbhoi_mTQU,4252
|
30
|
+
mustrd-0.2.6.2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
31
|
+
mustrd-0.2.6.2.dist-info/entry_points.txt,sha256=v7V7sN0_L1aB4Ug_9io5axlQSeJ1C0tNrQWwdXdV58s,50
|
32
|
+
mustrd-0.2.6.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|