Skip to content

Commit

Permalink
updated check_input_parameters_type
Browse files Browse the repository at this point in the history
  • Loading branch information
saltykox committed Apr 5, 2022
1 parent 45cb25d commit 7930a38
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions ote_sdk/ote_sdk/utils/argument_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ def validate(*args, **kwargs):
# Checking input parameters type
for parameter_name in expected_types_map:
parameter = input_parameters_values_map.get(parameter_name)
if parameter is None:
if parameter_name not in input_parameters_values_map:
default_value = expected_types_map.get(parameter_name).default
# pylint: disable=protected-access
if default_value != inspect._empty: # type: ignore
Expand Down Expand Up @@ -268,7 +268,9 @@ def check_file_extension(
def check_that_null_character_absents_in_string(parameter: str, parameter_name: str):
"""Function raises ValueError exception if null character: '\0' is specified in path to file"""
if "\0" in parameter:
raise ValueError(f"null char \\0 is specified in {parameter_name}: {parameter}")
raise ValueError(
rf"null char \\0 is specified in {parameter_name}: {parameter}"
)


def check_that_file_exists(file_path: str, file_path_name: str):
Expand All @@ -295,7 +297,7 @@ def check_that_all_characters_printable(parameter, parameter_name, allow_crlf=Fa
)
if not all_characters_printable:
raise ValueError(
fr"parameter {parameter_name} has not printable symbols: {parameter}"
rf"parameter {parameter_name} has not printable symbols: {parameter}"
)


Expand Down

0 comments on commit 7930a38

Please sign in to comment.