Python Mock を使用してメソッドが呼び出されていないと主張しようとしています。残念ながら、私はこのエラーを乗り越えることができないようです:
AttributeError: MockCallable instance has no attribute 'called'
テスト用に Python 2.7.1 と Python Mock 0.1.0 を実行しています。Google のコメント:No results found for "AttributeError: MockCallable instance has no attribute 'called'".
このエラーを解決するにはどうすればよいですか?
テストは次のとおりです。
import unittest2
import main
from mock import Mock
class TestCli(unittest2.TestCase):
def setUp(self):
self.mockView = Mock()
self.mockFriendManager = Mock()
self.mockedCli = main.CLI(self.mockView, self.mockFriendManager)
[...]
def testCliDoesntGetFriendPropertiesWhenNotSelected(self):
view = Mock( { "requestResponse":2 } )
friendManager = Mock()
cli = main.CLI(view, friendManager)
cli.outputMenu()
assert not friendManager.getFriendProperties.called, 'hello'