openapi-core/openapi_core/testing/factories.py

12 lines
261 B
Python
Raw Normal View History

2020-01-17 14:20:20 +00:00
class FactoryClassMock(object):
_instances = {}
def __new__(cls, obj):
if obj not in cls._instances:
cls._instances[obj] = object.__new__(cls)
return cls._instances[obj]
def __init__(self, obj):
self.obj = obj