Skip to content

Commit

Permalink
fix mwf tests (#818)
Browse files Browse the repository at this point in the history
  • Loading branch information
seanpearsonuk authored Sep 2, 2022
1 parent 1b3bac2 commit ea97e82
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
18 changes: 14 additions & 4 deletions src/ansys/fluent/core/meshing/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,14 @@ def __dir__(self):

class Task(PyCallableStateObject):
def __init__(self, meshing, name):
self._workflow = meshing._workflow
self._meshing = meshing._meshing
self._task = self._workflow.TaskObject[name]
self._cmd = None
self.__dict__.update(
dict(
_workflow=meshing._workflow,
_meshing=meshing._meshing,
_task=meshing._workflow.TaskObject[name],
_cmd=None,
)
)

@property
def CommandArguments(self):
Expand All @@ -62,6 +66,12 @@ def _command(self):
def __getattr__(self, attr):
return getattr(self._task, attr)

def __setattr__(self, attr, value):
if attr in self.__dict__:
self.__dict__[attr] = value
else:
setattr(self._task, attr, value)

def __dir__(self):
return sorted(
set(list(self.__dict__.keys()) + dir(type(self)) + dir(self._task))
Expand Down
2 changes: 1 addition & 1 deletion tests/util/meshing_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def assign_task_arguments(
task.Arguments = kwargs
if check_state:
# the state that we have set must be a subset of the total state
assert kwargs.items() <= task.Arguments.items()
assert kwargs.items() <= task.Arguments().items()


def check_task_execute_preconditions(task) -> None:
Expand Down

0 comments on commit ea97e82

Please sign in to comment.