5
Mock
및/또는 MagicMock
의 속성에 액세스했다고 주장 할 수 있습니까? 예를 들어 모의 인스턴스의 Assert 속성에 액세스했습니다.
from unittest.mock import MagicMock
def foo(x):
a = x.value
m = MagicMock()
foo(m)
m.attr_accessed('value') # method that does not exist but I wish did; should return True
foo
이 m.value
액세스를 시도한 것을 확인하는 실제 방법은 무엇입니까