spotframework/tests/util.py

5 lines
171 B
Python
Raw Normal View History

2021-02-06 00:33:49 +00:00
from dataclasses import fields
from unittest.mock import Mock
def create_dataclass_mock(obj):
return Mock(spec=[field.name for field in fields(obj)], __class__ = obj)