Skip to content
Snippets Groups Projects
Commit 6cdd4f20 authored by I. Nüske's avatar I. Nüske
Browse files

TST: Reenable failing test

parent 8a619c79
No related branches found
No related tags found
2 merge requests!138Release 0.14.0,!129Enable validation in table_json_conversion.convert.to_dict for use in XLSX-converter
...@@ -707,8 +707,6 @@ def _set_in_nested(mydict: dict, path: list, value: Any, prefix: list = [], skip ...@@ -707,8 +707,6 @@ def _set_in_nested(mydict: dict, path: list, value: Any, prefix: list = [], skip
return mydict return mydict
# ToDo: Fix https://gitlab.indiscale.com/caosdb/src/caosdb-advanced-user-tools/-/issues/138
# and remove pylint disable
def to_dict(xlsx: Union[str, BinaryIO], schema: Union[dict, str, TextIO], def to_dict(xlsx: Union[str, BinaryIO], schema: Union[dict, str, TextIO],
validate: Optional[bool] = None, strict: bool = False) -> dict: validate: Optional[bool] = None, strict: bool = False) -> dict:
"""Convert the xlsx contents to a dict, it must follow a schema. """Convert the xlsx contents to a dict, it must follow a schema.
...@@ -733,9 +731,5 @@ def to_dict(xlsx: Union[str, BinaryIO], schema: Union[dict, str, TextIO], ...@@ -733,9 +731,5 @@ def to_dict(xlsx: Union[str, BinaryIO], schema: Union[dict, str, TextIO],
out: dict out: dict
A dict representing the JSON with the extracted data. A dict representing the JSON with the extracted data.
""" """
if validate:
raise NotImplementedError(
"For input validation implement "
"https://gitlab.indiscale.com/caosdb/src/caosdb-advanced-user-tools/-/issues/138")
converter = XLSXConverter(xlsx, schema, strict=strict) converter = XLSXConverter(xlsx, schema, strict=strict)
return converter.to_dict() return converter.to_dict(validate=validate)
...@@ -53,9 +53,7 @@ Returns ...@@ -53,9 +53,7 @@ Returns
json: dict json: dict
The result of the conversion. The result of the conversion.
""" """
# FIXME Set default "validate" back to True, after implementation of result = convert.to_dict(xlsx=xlsx_file, schema=schema_file, validate=True)
# https://gitlab.indiscale.com/caosdb/src/caosdb-advanced-user-tools/-/issues/138
result = convert.to_dict(xlsx=xlsx_file, schema=schema_file, validate=validate)
if known_good_file: if known_good_file:
with open(known_good_file, encoding="utf-8") as myfile: with open(known_good_file, encoding="utf-8") as myfile:
expected = json.load(myfile) expected = json.load(myfile)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment