Skip to content

Commit

Permalink
Fixed a unittest by adding .name attribute to a Mock object
Browse files Browse the repository at this point in the history
Signed-off-by: Risbud, Sumedh <[email protected]>
  • Loading branch information
srrisbud committed May 16, 2024
1 parent 05cdd6b commit 8b7c31b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/lava/magma/compiler/test_compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,11 @@ def create_mock_proc_groups() -> ty.List[ProcGroup]:
]

# Add mock PyProcModel instances to each of the Processes.
j = 1
for p, pm_type in zip(proc_list, proc_model_types):
type(p).model_class = PropertyMock(return_value=pm_type)
type(p).name = PropertyMock(return_value=f"Process{j}")
j += 1
seal(p)

proc_groups = [
Expand Down

0 comments on commit 8b7c31b

Please sign in to comment.