Basically I'm trying to do this:
class SeaLion(object):
def __iter__(self):
return self
def next(self):
...
def train():
sea_lion = SeaLion(...)
for tooth in sea_lion:
.. do something
Then in my test file I have:
class TestTrain(TestCase):
@patch('module.SeaLion')
def test_train(self, mock_SeaLion):
mock_SeaLion.return_value = [1,2,3]
...
Basically I want sea_lion in the train function to be a list instead of an instance of that class.
With the above code sea_lion is MagicMock(name='SeaLion()')