ghga-validator 1.2.2__tar.gz → 1.2.4__tar.gz

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.
Files changed (36) hide show
  1. {ghga_validator-1.2.2 → ghga_validator-1.2.4}/LICENSE +1 -1
  2. ghga_validator-1.2.4/MANIFEST.in +2 -0
  3. {ghga_validator-1.2.2/src/ghga_validator.egg-info → ghga_validator-1.2.4}/PKG-INFO +18 -19
  4. {ghga_validator-1.2.2 → ghga_validator-1.2.4}/README.md +15 -16
  5. {ghga_validator-1.2.2 → ghga_validator-1.2.4}/pyproject.toml +4 -10
  6. {ghga_validator-1.2.2 → ghga_validator-1.2.4/src/ghga_validator.egg-info}/PKG-INFO +18 -19
  7. {ghga_validator-1.2.2 → ghga_validator-1.2.4}/src/ghga_validator.egg-info/SOURCES.txt +2 -10
  8. ghga_validator-1.2.2/tests/test_object_iterator.py +0 -54
  9. ghga_validator-1.2.2/tests/test_validate.py +0 -34
  10. ghga_validator-1.2.2/tests/test_validate_attribute.py +0 -34
  11. ghga_validator-1.2.2/tests/test_validate_empty.py +0 -34
  12. ghga_validator-1.2.2/tests/test_validate_empty_required.py +0 -34
  13. ghga_validator-1.2.2/tests/test_validate_inherited.py +0 -35
  14. ghga_validator-1.2.2/tests/test_validate_json_schema.py +0 -34
  15. ghga_validator-1.2.2/tests/test_validate_ref.py +0 -34
  16. ghga_validator-1.2.2/tests/test_validate_unique_id.py +0 -34
  17. {ghga_validator-1.2.2 → ghga_validator-1.2.4}/setup.cfg +0 -0
  18. {ghga_validator-1.2.2 → ghga_validator-1.2.4}/src/ghga_validator/__init__.py +0 -0
  19. {ghga_validator-1.2.2 → ghga_validator-1.2.4}/src/ghga_validator/__main__.py +0 -0
  20. {ghga_validator-1.2.2 → ghga_validator-1.2.4}/src/ghga_validator/cli.py +0 -0
  21. {ghga_validator-1.2.2 → ghga_validator-1.2.4}/src/ghga_validator/core/__init__.py +0 -0
  22. {ghga_validator-1.2.2 → ghga_validator-1.2.4}/src/ghga_validator/core/models.py +0 -0
  23. {ghga_validator-1.2.2 → ghga_validator-1.2.4}/src/ghga_validator/core/validator.py +0 -0
  24. {ghga_validator-1.2.2 → ghga_validator-1.2.4}/src/ghga_validator/my_linkml/__init__.py +0 -0
  25. {ghga_validator-1.2.2 → ghga_validator-1.2.4}/src/ghga_validator/my_linkml/object_iterator.py +0 -0
  26. {ghga_validator-1.2.2 → ghga_validator-1.2.4}/src/ghga_validator/plugins/base_plugin.py +0 -0
  27. {ghga_validator-1.2.2 → ghga_validator-1.2.4}/src/ghga_validator/plugins/jsonschema_validation.py +0 -0
  28. {ghga_validator-1.2.2 → ghga_validator-1.2.4}/src/ghga_validator/plugins/ref_validation.py +0 -0
  29. {ghga_validator-1.2.2 → ghga_validator-1.2.4}/src/ghga_validator/plugins/unique_identifier_validation.py +0 -0
  30. {ghga_validator-1.2.2 → ghga_validator-1.2.4}/src/ghga_validator/plugins/utils.py +0 -0
  31. {ghga_validator-1.2.2 → ghga_validator-1.2.4}/src/ghga_validator/schema_utils.py +0 -0
  32. {ghga_validator-1.2.2 → ghga_validator-1.2.4}/src/ghga_validator/utils.py +0 -0
  33. {ghga_validator-1.2.2 → ghga_validator-1.2.4}/src/ghga_validator.egg-info/dependency_links.txt +0 -0
  34. {ghga_validator-1.2.2 → ghga_validator-1.2.4}/src/ghga_validator.egg-info/entry_points.txt +0 -0
  35. {ghga_validator-1.2.2 → ghga_validator-1.2.4}/src/ghga_validator.egg-info/requires.txt +0 -0
  36. {ghga_validator-1.2.2 → ghga_validator-1.2.4}/src/ghga_validator.egg-info/top_level.txt +0 -0
@@ -186,7 +186,7 @@
186
186
  same "printed page" as the copyright notice for easier
187
187
  identification within third-party archives.
188
188
 
189
- Copyright 2021 - 2023 Universität Tübingen, DKFZ, EMBL, and Universität zu Köln
189
+ Copyright 2021 - 2026 Universität Tübingen, DKFZ, EMBL, and Universität zu Köln
190
190
  for the German Human Genome-Phenome Archive (GHGA)
191
191
 
192
192
  Licensed under the Apache License, Version 2.0 (the "License");
@@ -0,0 +1,2 @@
1
+ # The tests run in the monorepo; setuptools would ship only tests/test*.py, a broken suite.
2
+ prune tests
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ghga_validator
3
- Version: 1.2.2
3
+ Version: 1.2.4
4
4
  Summary: GHGA Validator - A Python library and command line utility to validate metadata
5
5
  Author-email: "German Human Genome Phenome Archive (GHGA)" <contact@ghga.de>
6
- License: Apache 2.0
6
+ License-Expression: Apache-2.0
7
7
  Project-URL: Repository, https://github.com/ghga-de/ghga
8
8
  Project-URL: Release Notes, https://github.com/ghga-de/ghga/releases
9
9
  Project-URL: Issue Tracker, https://github.com/ghga-de/ghga/issues
@@ -14,7 +14,7 @@ Classifier: Programming Language :: Python :: 3.11
14
14
  Classifier: Programming Language :: Python :: 3.12
15
15
  Classifier: Programming Language :: Python :: 3.13
16
16
  Classifier: Programming Language :: Python :: 3.14
17
- Classifier: License :: OSI Approved :: Apache Software License
17
+ Classifier: Programming Language :: Python :: 3.15
18
18
  Classifier: Environment :: Console
19
19
  Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
20
20
  Classifier: Topic :: Utilities
@@ -29,8 +29,12 @@ Requires-Dist: linkml-runtime>=1.8
29
29
  Requires-Dist: linkml-validator>=0.4.5
30
30
  Dynamic: license-file
31
31
 
32
+ <!-- rumdl-disable MD013 -->
32
33
  [![PyPI version shields.io](https://img.shields.io/pypi/v/ghga-validator.svg)](https://pypi.org/project/ghga-validator/)
33
34
  [![PyPI pyversions](https://img.shields.io/pypi/pyversions/ghga-validator.svg)](https://pypi.org/project/ghga-validator/)
35
+ [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
36
+ [![Checked with mypy](https://www.mypy-lang.org/static/mypy_badge.svg)](https://mypy-lang.org/)
37
+ <!-- rumdl-enable MD013 -->
34
38
 
35
39
  # Ghga Validator
36
40
 
@@ -40,20 +44,20 @@ GHGA Validator - A Python library and command line utility to validate metadata
40
44
 
41
45
  <!-- Please provide a short overview of the features of this service.-->
42
46
 
43
- ghga-validator is a Python library and command line utility to validate metadata
44
- w.r.t. its compliance to the [GHGA Metadata
45
- Model](https://github.com/ghga-de/ghga-metadata-schema). It takes metadata encoded in JSON of YAML format and produces a validation report in JSON format.
46
-
47
+ ghga-validator is a Python library and command line utility to validate metadata w.r.t. its compliance to the [GHGA Metadata Model](https://github.com/ghga-de/ghga-metadata-schema).
48
+ It takes metadata encoded in JSON of YAML format and produces a validation report in JSON format.
47
49
 
48
50
  ## Installation
51
+
49
52
  We recommend installing the latest version of ghga-validator using pip:
50
- ```
53
+
54
+ ```text
51
55
  pip install -U ghga-validator
52
56
  ```
53
57
 
54
58
  ## Usage
55
59
 
56
- ```
60
+ ```text
57
61
  Usage: ghga-validator [OPTIONS]
58
62
 
59
63
  GHGA Validator
@@ -80,15 +84,10 @@ Options:
80
84
 
81
85
  ## Development
82
86
 
83
- This package is a member of the [GHGA monorepo](https://github.com/ghga-de/ghga) and is
84
- developed from the repository root rather than on its own. The repository ships a
85
- devcontainer with the whole toolchain: open it in VS Code and run
86
- `Remote-Containers: Reopen in Container`, or set the environment up directly with
87
- `just sync`.
87
+ This package is a member of the [GHGA monorepo](https://github.com/ghga-de/ghga) and is developed from the repository root rather than on its own.
88
+ The repository ships a devcontainer with the whole toolchain: open it in VS Code and run `Remote-Containers: Reopen in Container`, or set the environment up directly with `just sync`.
88
89
 
89
- The usual tasks, run from the repository root (see
90
- [ADR-0015](https://github.com/ghga-de/ghga/blob/main/docs/adr/0015-task-runner.md) for the
91
- full recipe list):
90
+ The usual tasks, run from the repository root (see [ADR-0034](https://github.com/ghga-de/ghga/blob/main/docs/adrs/adr-0034-task-runner.md) for the full recipe list):
92
91
 
93
92
  ```bash
94
93
  just sync # install every member plus the shared dev toolchain
@@ -97,5 +96,5 @@ just lint # ruff check + format check across the workspac
97
96
  ```
98
97
 
99
98
  ## License
100
- This repository is free to use and modify according to the
101
- [Apache 2.0 License](https://github.com/ghga-de/ghga/blob/main/tools/ghga-validator/LICENSE).
99
+
100
+ This repository is free to use and modify according to the [Apache 2.0 License](https://github.com/ghga-de/ghga/blob/main/tools/ghga-validator/LICENSE).
@@ -1,5 +1,9 @@
1
+ <!-- rumdl-disable MD013 -->
1
2
  [![PyPI version shields.io](https://img.shields.io/pypi/v/ghga-validator.svg)](https://pypi.org/project/ghga-validator/)
2
3
  [![PyPI pyversions](https://img.shields.io/pypi/pyversions/ghga-validator.svg)](https://pypi.org/project/ghga-validator/)
4
+ [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
5
+ [![Checked with mypy](https://www.mypy-lang.org/static/mypy_badge.svg)](https://mypy-lang.org/)
6
+ <!-- rumdl-enable MD013 -->
3
7
 
4
8
  # Ghga Validator
5
9
 
@@ -9,20 +13,20 @@ GHGA Validator - A Python library and command line utility to validate metadata
9
13
 
10
14
  <!-- Please provide a short overview of the features of this service.-->
11
15
 
12
- ghga-validator is a Python library and command line utility to validate metadata
13
- w.r.t. its compliance to the [GHGA Metadata
14
- Model](https://github.com/ghga-de/ghga-metadata-schema). It takes metadata encoded in JSON of YAML format and produces a validation report in JSON format.
15
-
16
+ ghga-validator is a Python library and command line utility to validate metadata w.r.t. its compliance to the [GHGA Metadata Model](https://github.com/ghga-de/ghga-metadata-schema).
17
+ It takes metadata encoded in JSON of YAML format and produces a validation report in JSON format.
16
18
 
17
19
  ## Installation
20
+
18
21
  We recommend installing the latest version of ghga-validator using pip:
19
- ```
22
+
23
+ ```text
20
24
  pip install -U ghga-validator
21
25
  ```
22
26
 
23
27
  ## Usage
24
28
 
25
- ```
29
+ ```text
26
30
  Usage: ghga-validator [OPTIONS]
27
31
 
28
32
  GHGA Validator
@@ -49,15 +53,10 @@ Options:
49
53
 
50
54
  ## Development
51
55
 
52
- This package is a member of the [GHGA monorepo](https://github.com/ghga-de/ghga) and is
53
- developed from the repository root rather than on its own. The repository ships a
54
- devcontainer with the whole toolchain: open it in VS Code and run
55
- `Remote-Containers: Reopen in Container`, or set the environment up directly with
56
- `just sync`.
56
+ This package is a member of the [GHGA monorepo](https://github.com/ghga-de/ghga) and is developed from the repository root rather than on its own.
57
+ The repository ships a devcontainer with the whole toolchain: open it in VS Code and run `Remote-Containers: Reopen in Container`, or set the environment up directly with `just sync`.
57
58
 
58
- The usual tasks, run from the repository root (see
59
- [ADR-0015](https://github.com/ghga-de/ghga/blob/main/docs/adr/0015-task-runner.md) for the
60
- full recipe list):
59
+ The usual tasks, run from the repository root (see [ADR-0034](https://github.com/ghga-de/ghga/blob/main/docs/adrs/adr-0034-task-runner.md) for the full recipe list):
61
60
 
62
61
  ```bash
63
62
  just sync # install every member plus the shared dev toolchain
@@ -66,5 +65,5 @@ just lint # ruff check + format check across the workspac
66
65
  ```
67
66
 
68
67
  ## License
69
- This repository is free to use and modify according to the
70
- [Apache 2.0 License](https://github.com/ghga-de/ghga/blob/main/tools/ghga-validator/LICENSE).
68
+
69
+ This repository is free to use and modify according to the [Apache 2.0 License](https://github.com/ghga-de/ghga/blob/main/tools/ghga-validator/LICENSE).
@@ -18,7 +18,7 @@ classifiers = [
18
18
  "Programming Language :: Python :: 3.12",
19
19
  "Programming Language :: Python :: 3.13",
20
20
  "Programming Language :: Python :: 3.14",
21
- "License :: OSI Approved :: Apache Software License",
21
+ "Programming Language :: Python :: 3.15",
22
22
  "Environment :: Console",
23
23
  "Topic :: Scientific/Engineering :: Bio-Informatics",
24
24
  "Topic :: Utilities",
@@ -26,8 +26,9 @@ classifiers = [
26
26
  ]
27
27
  name = "ghga_validator"
28
28
  # 1.2.1 is spent on TestPyPI: a pypi-publish.yaml rehearsal uploaded it there.
29
- version = "1.2.2"
29
+ version = "1.2.4"
30
30
  description = "GHGA Validator - A Python library and command line utility to validate metadata"
31
+ license = "Apache-2.0"
31
32
  dependencies = [
32
33
  "typer >= 0.9.0",
33
34
  "pydantic >=2, <3",
@@ -36,9 +37,6 @@ dependencies = [
36
37
  "linkml-validator>=0.4.5",
37
38
  ]
38
39
 
39
- [project.license]
40
- text = "Apache 2.0"
41
-
42
40
  [project.urls]
43
41
  Repository = "https://github.com/ghga-de/ghga"
44
42
  "Release Notes" = "https://github.com/ghga-de/ghga/releases"
@@ -52,10 +50,6 @@ where = [
52
50
  "src",
53
51
  ]
54
52
 
55
- [tool.pytest.ini_options]
56
- minversion = "7.1"
57
- asyncio_mode = "strict"
58
-
59
53
  [tool.coverage.paths]
60
54
  source = [
61
55
  "src",
@@ -63,7 +57,7 @@ source = [
63
57
  "**/lib/python*/site-packages",
64
58
  ]
65
59
 
66
- # Capability markers (ADR-0014): public CLI, no internal deps -> PyPI release lane.
60
+ # Capability markers (ADR-0033): public CLI, no internal deps -> PyPI release lane.
67
61
  [tool.ghga]
68
62
  release = "pypi"
69
63
  pypi = true
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ghga_validator
3
- Version: 1.2.2
3
+ Version: 1.2.4
4
4
  Summary: GHGA Validator - A Python library and command line utility to validate metadata
5
5
  Author-email: "German Human Genome Phenome Archive (GHGA)" <contact@ghga.de>
6
- License: Apache 2.0
6
+ License-Expression: Apache-2.0
7
7
  Project-URL: Repository, https://github.com/ghga-de/ghga
8
8
  Project-URL: Release Notes, https://github.com/ghga-de/ghga/releases
9
9
  Project-URL: Issue Tracker, https://github.com/ghga-de/ghga/issues
@@ -14,7 +14,7 @@ Classifier: Programming Language :: Python :: 3.11
14
14
  Classifier: Programming Language :: Python :: 3.12
15
15
  Classifier: Programming Language :: Python :: 3.13
16
16
  Classifier: Programming Language :: Python :: 3.14
17
- Classifier: License :: OSI Approved :: Apache Software License
17
+ Classifier: Programming Language :: Python :: 3.15
18
18
  Classifier: Environment :: Console
19
19
  Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
20
20
  Classifier: Topic :: Utilities
@@ -29,8 +29,12 @@ Requires-Dist: linkml-runtime>=1.8
29
29
  Requires-Dist: linkml-validator>=0.4.5
30
30
  Dynamic: license-file
31
31
 
32
+ <!-- rumdl-disable MD013 -->
32
33
  [![PyPI version shields.io](https://img.shields.io/pypi/v/ghga-validator.svg)](https://pypi.org/project/ghga-validator/)
33
34
  [![PyPI pyversions](https://img.shields.io/pypi/pyversions/ghga-validator.svg)](https://pypi.org/project/ghga-validator/)
35
+ [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
36
+ [![Checked with mypy](https://www.mypy-lang.org/static/mypy_badge.svg)](https://mypy-lang.org/)
37
+ <!-- rumdl-enable MD013 -->
34
38
 
35
39
  # Ghga Validator
36
40
 
@@ -40,20 +44,20 @@ GHGA Validator - A Python library and command line utility to validate metadata
40
44
 
41
45
  <!-- Please provide a short overview of the features of this service.-->
42
46
 
43
- ghga-validator is a Python library and command line utility to validate metadata
44
- w.r.t. its compliance to the [GHGA Metadata
45
- Model](https://github.com/ghga-de/ghga-metadata-schema). It takes metadata encoded in JSON of YAML format and produces a validation report in JSON format.
46
-
47
+ ghga-validator is a Python library and command line utility to validate metadata w.r.t. its compliance to the [GHGA Metadata Model](https://github.com/ghga-de/ghga-metadata-schema).
48
+ It takes metadata encoded in JSON of YAML format and produces a validation report in JSON format.
47
49
 
48
50
  ## Installation
51
+
49
52
  We recommend installing the latest version of ghga-validator using pip:
50
- ```
53
+
54
+ ```text
51
55
  pip install -U ghga-validator
52
56
  ```
53
57
 
54
58
  ## Usage
55
59
 
56
- ```
60
+ ```text
57
61
  Usage: ghga-validator [OPTIONS]
58
62
 
59
63
  GHGA Validator
@@ -80,15 +84,10 @@ Options:
80
84
 
81
85
  ## Development
82
86
 
83
- This package is a member of the [GHGA monorepo](https://github.com/ghga-de/ghga) and is
84
- developed from the repository root rather than on its own. The repository ships a
85
- devcontainer with the whole toolchain: open it in VS Code and run
86
- `Remote-Containers: Reopen in Container`, or set the environment up directly with
87
- `just sync`.
87
+ This package is a member of the [GHGA monorepo](https://github.com/ghga-de/ghga) and is developed from the repository root rather than on its own.
88
+ The repository ships a devcontainer with the whole toolchain: open it in VS Code and run `Remote-Containers: Reopen in Container`, or set the environment up directly with `just sync`.
88
89
 
89
- The usual tasks, run from the repository root (see
90
- [ADR-0015](https://github.com/ghga-de/ghga/blob/main/docs/adr/0015-task-runner.md) for the
91
- full recipe list):
90
+ The usual tasks, run from the repository root (see [ADR-0034](https://github.com/ghga-de/ghga/blob/main/docs/adrs/adr-0034-task-runner.md) for the full recipe list):
92
91
 
93
92
  ```bash
94
93
  just sync # install every member plus the shared dev toolchain
@@ -97,5 +96,5 @@ just lint # ruff check + format check across the workspac
97
96
  ```
98
97
 
99
98
  ## License
100
- This repository is free to use and modify according to the
101
- [Apache 2.0 License](https://github.com/ghga-de/ghga/blob/main/tools/ghga-validator/LICENSE).
99
+
100
+ This repository is free to use and modify according to the [Apache 2.0 License](https://github.com/ghga-de/ghga/blob/main/tools/ghga-validator/LICENSE).
@@ -1,4 +1,5 @@
1
1
  LICENSE
2
+ MANIFEST.in
2
3
  README.md
3
4
  pyproject.toml
4
5
  src/ghga_validator/__init__.py
@@ -21,13 +22,4 @@ src/ghga_validator/plugins/base_plugin.py
21
22
  src/ghga_validator/plugins/jsonschema_validation.py
22
23
  src/ghga_validator/plugins/ref_validation.py
23
24
  src/ghga_validator/plugins/unique_identifier_validation.py
24
- src/ghga_validator/plugins/utils.py
25
- tests/test_object_iterator.py
26
- tests/test_validate.py
27
- tests/test_validate_attribute.py
28
- tests/test_validate_empty.py
29
- tests/test_validate_empty_required.py
30
- tests/test_validate_inherited.py
31
- tests/test_validate_json_schema.py
32
- tests/test_validate_ref.py
33
- tests/test_validate_unique_id.py
25
+ src/ghga_validator/plugins/utils.py
@@ -1,54 +0,0 @@
1
- # Copyright 2021 - 2023 Universität Tübingen, DKFZ, EMBL, and Universität zu Köln
2
- # for the German Human Genome-Phenome Archive (GHGA)
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
-
16
- """Test object validator"""
17
-
18
- import yaml
19
- from linkml_runtime.utils.schemaview import SchemaView
20
-
21
- from ghga_validator.my_linkml.object_iterator import ObjectIterator
22
-
23
- from .fixtures.utils import BASE_DIR
24
-
25
-
26
- def test_object_iterator():
27
- """Test object iterator"""
28
- file = BASE_DIR / "data" / "example_data_minimal_model.json"
29
-
30
- with open(file, encoding="utf8") as json_file:
31
- data_json = yaml.safe_load(json_file)
32
-
33
- # Example with the object embedded in the parent object
34
- schema = BASE_DIR / "schemas" / "minimal_model_parent.yaml"
35
- target_class = "ParentSubmission"
36
-
37
- list1 = [
38
- elem for elem in ObjectIterator(SchemaView(schema), data_json, target_class)
39
- ]
40
-
41
- # Example with the same object on the top level of JSON
42
- data_json2 = data_json["submissions"][0]
43
- schema = BASE_DIR / "schemas" / "minimal_model.yaml"
44
- target_class = "Submission"
45
-
46
- list2 = [
47
- elem for elem in ObjectIterator(SchemaView(schema), data_json2, target_class)
48
- ]
49
-
50
- assert len(list2) == 2
51
-
52
- assert len(list1) == len(list2)
53
- assert list1[0][0:2] == list2[0][0:2]
54
- assert list1[0][3] != list2[0][3]
@@ -1,34 +0,0 @@
1
- # Copyright 2021 - 2023 Universität Tübingen, DKFZ, EMBL, and Universität zu Köln
2
- # for the German Human Genome-Phenome Archive (GHGA)
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
-
16
- """Test data validation (using all validation plugins)"""
17
-
18
- import os
19
-
20
- from ghga_validator.cli import validate_json_file
21
-
22
- from .fixtures.utils import BASE_DIR
23
-
24
-
25
- def test_validate_slots():
26
- """Test data validation (using all validation plugins)"""
27
- schema = BASE_DIR / "schemas" / "advance_model.yaml"
28
- file = BASE_DIR / "data" / "example_data.json"
29
- report = BASE_DIR / "tmp.json"
30
- target_class = "Submission"
31
-
32
- assert validate_json_file(file, schema, report, str(target_class)) is True
33
- if os.path.exists(report):
34
- os.remove(report)
@@ -1,34 +0,0 @@
1
- # Copyright 2021 - 2023 Universität Tübingen, DKFZ, EMBL, and Universität zu Köln
2
- # for the German Human Genome-Phenome Archive (GHGA)
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
-
16
- """Test data validation when slots in linkml schema are defined with attributes"""
17
-
18
- import os
19
-
20
- from ghga_validator.cli import validate_json_file
21
-
22
- from .fixtures.utils import BASE_DIR
23
-
24
-
25
- def test_validate_attribute():
26
- """Test data validation when slots in linkml schema are defined with attributes"""
27
- schema = BASE_DIR / "schemas" / "advance_model_attr.yaml"
28
- file = BASE_DIR / "data" / "example_data.json"
29
- report = BASE_DIR / "tmp.json"
30
- target_class = "Submission"
31
-
32
- assert validate_json_file(file, schema, report, str(target_class)) is True
33
- if os.path.exists(report):
34
- os.remove(report)
@@ -1,34 +0,0 @@
1
- # Copyright 2021 - 2023 Universität Tübingen, DKFZ, EMBL, and Universität zu Köln
2
- # for the German Human Genome-Phenome Archive (GHGA)
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
-
16
- """Test validating empty data"""
17
-
18
- import os
19
-
20
- from ghga_validator.cli import validate_json_file
21
-
22
- from .fixtures.utils import BASE_DIR
23
-
24
-
25
- def test_validate_empty():
26
- """Test validating empty data"""
27
- schema = BASE_DIR / "schemas" / "minimal_model_required_false.yaml"
28
- file = BASE_DIR / "data" / "example_data_empty.json"
29
- report = BASE_DIR / "tmp.json"
30
- target_class = "Submission"
31
-
32
- assert validate_json_file(file, schema, report, str(target_class)) is True
33
- if os.path.exists(report):
34
- os.remove(report)
@@ -1,34 +0,0 @@
1
- # Copyright 2021 - 2023 Universität Tübingen, DKFZ, EMBL, and Universität zu Köln
2
- # for the German Human Genome-Phenome Archive (GHGA)
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
-
16
- """Test validating empty data when there are required fields defined in schema"""
17
-
18
- import os
19
-
20
- from ghga_validator.cli import validate_json_file
21
-
22
- from .fixtures.utils import BASE_DIR
23
-
24
-
25
- def test_validate_empty_required():
26
- """Test validating empty data when there are required fields defined in schema"""
27
- schema = BASE_DIR / "schemas" / "minimal_model.yaml"
28
- file = BASE_DIR / "data" / "example_data_empty.json"
29
- report = BASE_DIR / "tmp.json"
30
- target_class = "Submission"
31
-
32
- assert validate_json_file(file, schema, report, str(target_class)) is False
33
- if os.path.exists(report):
34
- os.remove(report)
@@ -1,35 +0,0 @@
1
- # Copyright 2021 - 2023 Universität Tübingen, DKFZ, EMBL, and Universität zu Köln
2
- # for the German Human Genome-Phenome Archive (GHGA)
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
-
16
- """Test data validation when inherited classes are used"""
17
-
18
- import os
19
-
20
- from ghga_validator.cli import validate_json_file
21
-
22
- from .fixtures.utils import BASE_DIR
23
-
24
-
25
- def test_validate_inherited():
26
- """Test data validation when inherited classes are used"""
27
- schema = BASE_DIR / "schemas" / "model_with_inherited_classes.yaml"
28
- file = BASE_DIR / "data" / "example_data_with_inherited_classes.json"
29
- report = BASE_DIR / "tmp.json"
30
- target_class = "Submission"
31
-
32
- assert validate_json_file(file, schema, report, str(target_class)) is True
33
-
34
- if os.path.exists(report):
35
- os.remove(report)
@@ -1,34 +0,0 @@
1
- # Copyright 2021 - 2023 Universität Tübingen, DKFZ, EMBL, and Universität zu Köln
2
- # for the German Human Genome-Phenome Archive (GHGA)
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
-
16
- """Test structural validation using JSON schema"""
17
-
18
- import os
19
-
20
- from ghga_validator.cli import validate_json_file
21
-
22
- from .fixtures.utils import BASE_DIR
23
-
24
-
25
- def test_validate_json_file_schema():
26
- """Test GHGAJsonSchemaValidationPlugin"""
27
- schema = BASE_DIR / "schemas" / "advance_model.yaml"
28
- file = BASE_DIR / "data" / "example_data_wrong_json_schema.json"
29
- report = BASE_DIR / "tmp.json"
30
- target_class = "Submission"
31
-
32
- assert validate_json_file(file, schema, report, str(target_class)) is False
33
- if os.path.exists(report):
34
- os.remove(report)
@@ -1,34 +0,0 @@
1
- # Copyright 2021 - 2023 Universität Tübingen, DKFZ, EMBL, and Universität zu Köln
2
- # for the German Human Genome-Phenome Archive (GHGA)
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
-
16
- """Test reference validation"""
17
-
18
- import os
19
-
20
- from ghga_validator.cli import validate_json_file
21
-
22
- from .fixtures.utils import BASE_DIR
23
-
24
-
25
- def test_validate_ref():
26
- """Test RefValidationPlugin"""
27
- schema = BASE_DIR / "schemas" / "advance_model.yaml"
28
- file = BASE_DIR / "data" / "example_data_wrong_ref.json"
29
- report = BASE_DIR / "tmp.json"
30
- target_class = "Submission"
31
-
32
- assert validate_json_file(file, schema, report, str(target_class)) is False
33
- if os.path.exists(report):
34
- os.remove(report)
@@ -1,34 +0,0 @@
1
- # Copyright 2021 - 2023 Universität Tübingen, DKFZ, EMBL, and Universität zu Köln
2
- # for the German Human Genome-Phenome Archive (GHGA)
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
-
16
- """Test Validation of identifier uniqueness"""
17
-
18
- import os
19
-
20
- from ghga_validator.cli import validate_json_file
21
-
22
- from .fixtures.utils import BASE_DIR
23
-
24
-
25
- def test_validate_unique_id():
26
- """Test UniqueIdentifierValidationPlugin"""
27
- schema = BASE_DIR / "schemas" / "advance_model.yaml"
28
- file = BASE_DIR / "data" / "example_data_not_unique_id.json"
29
- report = BASE_DIR / "tmp.json"
30
- target_class = "Submission"
31
-
32
- assert validate_json_file(file, schema, report, str(target_class)) is False
33
- if os.path.exists(report):
34
- os.remove(report)
File without changes