Skip to content
Snippets Groups Projects
Verified Commit d49d3023 authored by Daniel Hornung's avatar Daniel Hornung
Browse files

STY: Fixed style problems.

parent ed0e3126
No related branches found
No related tags found
2 merge requests!54REL: Release 0.5.0,!51Some small changes to the YAML documentation.
Pipeline #27063 passed
...@@ -97,7 +97,7 @@ def h5_attr_to_property(val): ...@@ -97,7 +97,7 @@ def h5_attr_to_property(val):
# TODO this can eventually be removed # TODO this can eventually be removed
if(hasattr(val, 'ndim')): if hasattr(val, 'ndim'):
if not isinstance(val, np.ndarray) and val.ndim != 0: if not isinstance(val, np.ndarray) and val.ndim != 0:
print(val, val.ndim) print(val, val.ndim)
raise Exception( raise Exception(
......
...@@ -82,13 +82,13 @@ def test_simple_record(): ...@@ -82,13 +82,13 @@ def test_simple_record():
assert my_exporter.prepare_csv_export( assert my_exporter.prepare_csv_export(
delimiter='\t', print_header=True) == "Test_Prop_1\tTest_Prop_2\nbla\tblabla" delimiter='\t', print_header=True) == "Test_Prop_1\tTest_Prop_2\nbla\tblabla"
# remove optional entry from info # remove optional entry from info
del(my_exporter.info["Test_Prop_2"]) del my_exporter.info["Test_Prop_2"]
assert my_exporter.prepare_csv_export(skip_empty_optionals=True) == "bla" assert my_exporter.prepare_csv_export(skip_empty_optionals=True) == "bla"
assert my_exporter.prepare_csv_export( assert my_exporter.prepare_csv_export(
delimiter='\t', print_header=True) == "Test_Prop_1\tTest_Prop_2\nbla\t" delimiter='\t', print_header=True) == "Test_Prop_1\tTest_Prop_2\nbla\t"
# reload info, and delete mandatory entry # reload info, and delete mandatory entry
my_exporter.collect_information() my_exporter.collect_information()
del(my_exporter.info["Test_Prop_1"]) del my_exporter.info["Test_Prop_1"]
with raises(te.TableExportError) as exc: with raises(te.TableExportError) as exc:
my_exporter.prepare_csv_export() my_exporter.prepare_csv_export()
assert "Test_Prop_1" in exc.value.msg assert "Test_Prop_1" in exc.value.msg
...@@ -184,7 +184,7 @@ def test_info_collection(): ...@@ -184,7 +184,7 @@ def test_info_collection():
assert "optional_value" not in my_exporter.info assert "optional_value" not in my_exporter.info
# now error in mandatory value # now error in mandatory value
del(export_dict["optional_value"]) del export_dict["optional_value"]
export_dict["mandatory_value"] = { export_dict["mandatory_value"] = {
"find_func": "find_function_with_error" "find_func": "find_function_with_error"
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment