mustrd 0.1.5__py3-none-any.whl → 0.1.6__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/mustrd.py CHANGED
@@ -381,11 +381,13 @@ def run_spec(spec: Specification) -> SpecResult:
381
381
  # if type(mustrd_triple_store) == MustrdAnzo and close_connection:
382
382
  # mustrd_triple_store.clear_graph()
383
383
 
384
-
385
-
386
- def get_triple_store_graph(triple_store_graph_path: Path):
387
- secret_path = triple_store_graph_path.parent / Path(triple_store_graph_path.stem + "_secrets" + triple_store_graph_path.suffix)
388
- return Graph().parse(triple_store_graph_path).parse(secret_path)
384
+ def get_triple_store_graph(triple_store_graph_path: Path, secrets: str):
385
+ if secrets:
386
+ return Graph().parse(triple_store_graph_path).parse(data = secrets)
387
+ else:
388
+ secret_path = triple_store_graph_path.parent / Path(triple_store_graph_path.stem + "_secrets" + triple_store_graph_path.suffix)
389
+ return Graph().parse(triple_store_graph_path).parse(source = secret_path)
390
+
389
391
 
390
392
  def get_triple_stores(triple_store_graph: Graph) -> list[dict]:
391
393
  triple_stores = []
@@ -61,10 +61,12 @@ class TestConfig:
61
61
  class MustrdTestPlugin:
62
62
  md_path: str
63
63
  test_configs: Dict[str, TestConfig]
64
+ secrets: str
64
65
 
65
- def __init__(self, md_path, test_configs):
66
+ def __init__(self, md_path, test_configs, secrets):
66
67
  self.md_path = md_path
67
68
  self.test_configs = test_configs
69
+ self.secrets = secrets
68
70
 
69
71
  # Hook called at collection time: reads the configuration of the tests, and generate pytests from it
70
72
  def pytest_generate_tests(self, metafunc):
@@ -122,10 +124,10 @@ class MustrdTestPlugin:
122
124
  def get_triple_stores_from_file(self, test_config):
123
125
  if test_config.triplestore_spec_path:
124
126
  try:
125
- triple_stores = get_triple_stores(get_triple_store_graph(Path(test_config.triplestore_spec_path)))
126
- except Exception:
127
+ triple_stores = get_triple_stores(get_triple_store_graph(Path(test_config.triplestore_spec_path), self.secrets))
128
+ except Exception as e:
127
129
  print(f"""No triple store configuration found at {test_config.triplestore_spec_path}.
128
- Fall back: only embedded rdflib will be executed""")
130
+ Fall back: only embedded rdflib will be executed""", e)
129
131
  triple_stores = [{'type': MUST.RdfLib}]
130
132
  else:
131
133
  print("No triple store configuration required: using embedded rdflib")
mustrd/plugin.py CHANGED
@@ -36,7 +36,7 @@ def pytest_addoption(parser):
36
36
  "--md",
37
37
  action="store",
38
38
  dest="mdpath",
39
- metavar="path",
39
+ metavar="pathToMdSummary",
40
40
  default=None,
41
41
  help="create md summary file at that path.",
42
42
  )
@@ -44,11 +44,20 @@ def pytest_addoption(parser):
44
44
  "--config",
45
45
  action="store",
46
46
  dest="configpath",
47
- metavar="path",
47
+ metavar="pathToTestConfig",
48
48
  default=None,
49
49
  required=True,
50
50
  help="Ttl file containing the list of test to construct.",
51
51
  )
52
+ group.addoption(
53
+ "--secrets",
54
+ action="store",
55
+ dest="secrets",
56
+ metavar="Secrets",
57
+ default=None,
58
+ required=False,
59
+ help="Give the secrets by command line in order to be able to store secrets safely in CI tools",
60
+ )
52
61
  return
53
62
 
54
63
 
@@ -70,7 +79,7 @@ def pytest_configure(config) -> None:
70
79
  triplestore_spec_path=triplestore_spec_path,
71
80
  filter_on_tripleStore=filter_on_tripleStore)
72
81
 
73
- config.pluginmanager.register(MustrdTestPlugin(config.getoption("mdpath"), test_configs))
82
+ config.pluginmanager.register(MustrdTestPlugin(config.getoption("mdpath"), test_configs, config.getoption("secrets")))
74
83
 
75
84
 
76
85
  def get_config_param(config_graph, config_subject, config_param, convert_function):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mustrd
3
- Version: 0.1.5
3
+ Version: 0.1.6
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
@@ -3,13 +3,13 @@ mustrd/logger_setup.py,sha256=AXTXiiyQ4E_SyqNaKlLsZlkkKr_YJfJZ0N4PEoN7d7E,1630
3
3
  mustrd/model/mustrdShapes.ttl,sha256=BR-9fAwGpQt6glfPpDB0Xx3vFXMt_UTQwi469o6aWUo,9709
4
4
  mustrd/model/ontology.ttl,sha256=6xhmOF02gjP4nlOh6rnF5EWCaxWOdexQFn8YndGebck,17226
5
5
  mustrd/model/test-resources/resources.ttl,sha256=7z1P4qJwuqRdmHzKd_mhnUIs-aQoSQxas7yDCwKYarc,1558
6
- mustrd/mustrd.py,sha256=sVlgbHOMyCPqvdW6a-_8QhjnoGD8OeENDJXIoUk5zgM,33971
6
+ mustrd/mustrd.py,sha256=kAudCpk7NLoS2Y555l5Q2jhKbxR-D_sSPLa0Z3yP42w,34109
7
7
  mustrd/mustrdAnzo.py,sha256=bQ-IHCnsEK7paJ31GgS9IH3hGd4o_5zeNrpn0Sb8WIk,11822
8
8
  mustrd/mustrdGraphDb.py,sha256=KNXXYyZjYm_IZaeuuxlPBP-XyX9hZ5UvrdxshKnZhwo,5599
9
9
  mustrd/mustrdRdfLib.py,sha256=LeS-uArlxQwsM-7lrJyp8O8m-6VgxsR1BlpxsOCNePs,2129
10
- mustrd/mustrdTestPlugin.py,sha256=BKpzvbyUxj3zrzXjOzCvMHw2je0UyBR6INTbQBpeDcQ,9021
10
+ mustrd/mustrdTestPlugin.py,sha256=RZ7Ma6d_DVzU1G4VQm1fuIO1skN7HsuW4rz6GN19FWg,9102
11
11
  mustrd/namespace.py,sha256=pCvLXkD_n_tS23oIizO52ylVwXGC1xFP8cHx4Mml0Ro,3326
12
- mustrd/plugin.py,sha256=cERUX7KFCoq9dF1AgWuVpnTCoBlpRcKMN5D5M-W3fME,3450
12
+ mustrd/plugin.py,sha256=jVeH-cnB2bZiNGiRXoZMR7fkqMRBEvOdmD1Q4tBkVOE,3785
13
13
  mustrd/README.adoc,sha256=DwXeoMy2yMgAoLvyjZHp3HQW8NBIn8wCSaNo1ixHvFo,11803
14
14
  mustrd/run.py,sha256=Ez00qZrl0Qb7P374miD8hEVucRKt_PYWdr4aorigltg,4366
15
15
  mustrd/spec_component.py,sha256=l2CP8dszFENDkUsMIC065KNMeU8tNPPMMfCyQ4a1gHc,32487
@@ -19,8 +19,8 @@ mustrd/templates/md_ResultList_template.jinja,sha256=RrTaPN1obsTEpG5BjQp7BV9iBFz
19
19
  mustrd/templates/md_stats_template.jinja,sha256=DlNfH9eoEFVHQmvp6QNbQv36cqRLyBkqG1ITOHb_Yu8,157
20
20
  mustrd/TestResult.py,sha256=q5BnvRxhfCEEY062rHasnA61AeKR4oXXs5z8lASvx1o,4986
21
21
  mustrd/utils.py,sha256=fuvdLE20MdkJtY5atBiU8-u7sVcq1mzIYF0gTcw1UMk,1424
22
- mustrd-0.1.5.dist-info/entry_points.txt,sha256=AlSt0VltDOA7QmCskqlKGwtAQl4TKkpwGyaZXx7bWYc,40
23
- mustrd-0.1.5.dist-info/LICENSE,sha256=OwjAcbL4HsENdMen1iYR23HH7OEn899oCt100xUo0Zo,1099
24
- mustrd-0.1.5.dist-info/METADATA,sha256=ZtTwdJcCTQi2UWcUDSIAvSEinSX47yt0rbRsDj7LnVk,4130
25
- mustrd-0.1.5.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
26
- mustrd-0.1.5.dist-info/RECORD,,
22
+ mustrd-0.1.6.dist-info/entry_points.txt,sha256=AlSt0VltDOA7QmCskqlKGwtAQl4TKkpwGyaZXx7bWYc,40
23
+ mustrd-0.1.6.dist-info/LICENSE,sha256=OwjAcbL4HsENdMen1iYR23HH7OEn899oCt100xUo0Zo,1099
24
+ mustrd-0.1.6.dist-info/METADATA,sha256=ZtSFhvOBuQJMAOnL80bomHDy7cZG54ckHPIBZIMa8so,4130
25
+ mustrd-0.1.6.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
26
+ mustrd-0.1.6.dist-info/RECORD,,
File without changes