File tree Expand file tree Collapse file tree 2 files changed +9
-7
lines changed
Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ def __init__(self, msg=""):
2020 if not hasattr (self , "__notes__" ): #if the system is python < 3.11 we custom our own notes property
2121 self .__notes__ = []
2222 self .__notes__ .append (error_note )
23-
23+
2424
2525class DPFServerNullObject (Exception ):
2626 """Error raised when the DPF server cannot find an object."""
Original file line number Diff line number Diff line change 2121# SOFTWARE.
2222
2323import pytest
24- import sys
24+
2525import ansys .dpf .core as dpf
2626from ansys .dpf .core import errors , operators as ops
2727
28+
2829def test_server_exception_from_operator ():
2930 ds = dpf .DataSources (r"dummy/file.rst" )
3031 op = ops .result .displacement (data_sources = ds )
3132 with pytest .raises (errors .DPFServerException ) as exception_note :
3233 op .eval ()
33-
34+
3435 exception = exception_note .value
35- assert hasattr (exception , ' __notes__' ), "The exception does not contain any note"
36+ assert hasattr (exception , " __notes__" ), "The exception does not contain any note"
3637 assert exception .__notes__
3738
39+
3840def test_server_exception_from_workflow ():
3941 op = dpf .operators .result .displacement (data_sources = dpf .DataSources ("toto.rst" ))
40-
42+
4143 wf = dpf .Workflow ()
4244 wf .add_operator (op )
4345 wf .set_output_name ("out" , op .outputs .fields_container )
44-
46+
4547 with pytest .raises (errors .DPFServerException ) as exception_note :
4648 wf .get_output ("out" , output_type = dpf .FieldsContainer )
4749
4850 exception = exception_note .value
49- assert hasattr (exception , ' __notes__' ), "The exception does not contain any note"
51+ assert hasattr (exception , " __notes__" ), "The exception does not contain any note"
5052 assert exception .__notes__
You can’t perform that action at this time.
0 commit comments