Skip to content

Commit

Permalink
Fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
maxcapodi78 committed Dec 19, 2024
1 parent acc410b commit 0747690
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 26 deletions.
10 changes: 6 additions & 4 deletions src/ansys/aedt/core/modules/boundary/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ def _get_args(self, props=None):
def _initialize_bynary_tree(self):
if self._child_object:
BinaryTreeNode.__init__(self, self._name, self._child_object, False)
return True
return False

@pyaedt_function_handler()
def delete(self):
Expand Down Expand Up @@ -324,7 +326,7 @@ def type(self, value):
def name(self):
"""Boundary Name."""
if self._child_object:
self._name = self.properties["Name"]
self._name = str(self.properties["Name"])
return self._name

@name.setter
Expand Down Expand Up @@ -523,10 +525,12 @@ def create(self):
)
elif bound_type == "SBRTxRxSettings":
self._app.oboundary.SetSBRTxRxSettings(self._get_args())
return True
elif bound_type == "EndConnection":
self._app.oboundary.AssignEndConnection(self._get_args())
elif bound_type == "Hybrid":
self._app.oboundary.AssignHybridRegion(self._get_args())
return True
elif bound_type == "FluxTangential":
self._app.oboundary.AssignFluxTangential(self._get_args())
elif bound_type == "Plane Incident Wave":
Expand All @@ -536,9 +540,7 @@ def create(self):
else:
return False

self._initialize_bynary_tree()

return True
return self._initialize_bynary_tree()

@pyaedt_function_handler()
def update(self):
Expand Down
5 changes: 2 additions & 3 deletions src/ansys/aedt/core/modules/boundary/hfss_boundary.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def props(self):
def name(self):
"""Boundary Name."""
if self._child_object:
self._name = self.properties["Name"]
self._name = str(self.properties["Name"])
return self._name

@name.setter
Expand Down Expand Up @@ -138,8 +138,7 @@ def create(self):
self._app.oradfield.AddAntennaOverlay(self._get_args())
elif self.type == "FieldSourceGroup":
self._app.oradfield.AddRadFieldSourceGroup(self._get_args())
self._initialize_bynary_tree()
return True
return self._initialize_bynary_tree()

@pyaedt_function_handler()
def update(self):
Expand Down
5 changes: 2 additions & 3 deletions src/ansys/aedt/core/modules/boundary/layout_boundary.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def props(self):
def name(self):
"""Boundary Name."""
if self._child_object:
self._name = self.properties["Name"]
self._name = str(self.properties["Name"])
return self._name

@name.setter
Expand Down Expand Up @@ -218,8 +218,7 @@ def create(self):
self.excitation_name = a[0].split(":")[0]
except (GrpcApiError, IndexError):
self.excitation_name = self._name
self._initialize_bynary_tree()
return True
return self._initialize_bynary_tree()

@pyaedt_function_handler()
def update(self):
Expand Down
5 changes: 2 additions & 3 deletions src/ansys/aedt/core/modules/boundary/maxwell_boundary.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def props(self):
def name(self):
"""Boundary Name."""
if self._child_object:
self._name = self.properties["Name"]
self._name = str(self.properties["Name"])
return self._name

@name.setter
Expand Down Expand Up @@ -177,8 +177,7 @@ def create(self):
self._app.o_maxwell_parameters.AssignLayoutForce(self._get_args())
else:
return False
self._initialize_bynary_tree()
return True
return self._initialize_bynary_tree()

@pyaedt_function_handler()
def update(self):
Expand Down
7 changes: 4 additions & 3 deletions src/ansys/aedt/core/modules/mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def name(self):
"""
if self._child_object:
self._name = self.properties["Name"]
self._name = str(self.properties["Name"])
return self._name

@name.setter
Expand Down Expand Up @@ -259,8 +259,7 @@ def create(self):
self._mesh.omeshmodule.AssignCylindricalGapOp(self._get_args())
else:
return False
self._initialize_bynary_tree()
return True
return self._initialize_bynary_tree()

@pyaedt_function_handler()
def update(self, key_name=None, value=None):
Expand Down Expand Up @@ -409,6 +408,8 @@ def delete(self):
def _initialize_bynary_tree(self):
if self._child_object:
BinaryTreeNode.__init__(self, self._name, self._child_object, False)
return True
return False


class Mesh(object):
Expand Down
19 changes: 9 additions & 10 deletions src/ansys/aedt/core/modules/solve_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ def _child_object(self):
def _initialize_bynary_tree(self):
if self._child_object:
BinaryTreeNode.__init__(self, self._name, self._child_object, False)
return True
return False

@property
def sweeps(self):
Expand Down Expand Up @@ -556,8 +558,8 @@ def create(self):
Returns
-------
dict
Dictionary of arguments.
bool
Result of operation.
References
----------
Expand All @@ -567,8 +569,7 @@ def create(self):
arg = ["NAME:" + self._name]
_dict2arg(self.props, arg)
self.omodule.InsertSetup(soltype, arg)
self._initialize_bynary_tree()
return arg
return self._initialize_bynary_tree()

@pyaedt_function_handler(update_dictionary="properties")
def update(self, properties=None):
Expand Down Expand Up @@ -1155,8 +1156,8 @@ def create(self):
Returns
-------
dict
Dictionary of the arguments.
bool
Result of operation.
References
----------
Expand All @@ -1171,8 +1172,7 @@ def create(self):
arg = ["NAME:SimSetup"]
_dict2arg(self.props, arg)
self._setup(soltype, arg)
self._initialize_bynary_tree()
return arg
return self._initialize_bynary_tree()

@pyaedt_function_handler()
def _setup(self, soltype, arg, newsetup=True):
Expand Down Expand Up @@ -1913,8 +1913,7 @@ def create(self):
arg = ["NAME:" + self.name]
_dict2arg(self.props, arg)
self.omodule.Add(arg)
self._initialize_bynary_tree()
return True
return self._initialize_bynary_tree()

@pyaedt_function_handler(update_dictionary="properties")
def update(self, properties=None):
Expand Down
1 change: 1 addition & 0 deletions tests/system/general/test_01_configuration_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ def hfss3dl_b(add_app):
class TestClass:
def test_01_hfss_export(self, aedtapp, add_app):
aedtapp.mesh.assign_length_mesh("sub")
aedtapp.boundaries[-1].props
conf_file = aedtapp.configurations.export_config()
assert aedtapp.configurations.validate(conf_file)
filename = aedtapp.design_name
Expand Down

0 comments on commit 0747690

Please sign in to comment.