Code Review
/
oam.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Add cell-scale-factor to jsonschema
[oam.git]
/
code
/
network-generator
/
network_generation
/
parameter_validator.py
diff --git
a/code/network-generator/network_generation/parameter_validator.py
b/code/network-generator/network_generation/parameter_validator.py
index
2c47299
..
4c1dabe
100644
(file)
--- a/
code/network-generator/network_generation/parameter_validator.py
+++ b/
code/network-generator/network_generation/parameter_validator.py
@@
-12,13
+12,14
@@
# See the License for the specific language governing permissions and
# limitations under the License.
# See the License for the specific language governing permissions and
# limitations under the License.
-#!/usr/bin/python
+#
!/usr/bin/python
"""
Module containing a class for parameter validation
"""
import json
import os
import os.path
"""
Module containing a class for parameter validation
"""
import json
import os
import os.path
+from typing import Any
import jsonschema
import jsonschema
@@
-39,9
+40,8
@@
class ParameterValidator:
__is_valid: bool = False
# constructor
__is_valid: bool = False
# constructor
- def __init__(self, args
)
:
+ def __init__(self, args
: list[str]) -> None
:
self.args = args
self.args = args
-
if len(self.args) > 1:
self.__config_file = args[1]
if len(self.args) > 1:
self.__config_file = args[1]
@@
-83,15
+83,17
@@
class ParameterValidator:
def error_message(self) -> str:
"""
def error_message(self) -> str:
"""
- Getter for the error message after validation process or an
empty sting,
- when configuration is valid.
+ Getter for the error message after validation process or an
+
empty sting,
when configuration is valid.
:return Error message as string.
"""
return self.__error_message
# private
:return Error message as string.
"""
return self.__error_message
# private
- def __is_json_valid(self, json_data, json_schema) -> bool:
+ def __is_json_valid(
+ self, json_data: dict[str, Any], json_schema: dict[str, Any]
+ ) -> bool:
"""
Method validating json against a schema
"""
"""
Method validating json against a schema
"""