def test_init_calls_super_init_with_all_args(self): with patch.object(BaseLdfSimulation, '__init__') as mock_base_init: cluster = sentinel.cluster data = sentinel.data output = sentinel.output R = sentinel.R N = sentinel.N sim = KascadeLdfSimulation(cluster, data, output, R, N=N) mock_base_init.assert_called_once_with(cluster, data, output, R, N=N)
def setUp(self): cluster = Mock() data = MagicMock() output = '/simulations' R = sentinel.R N = MagicMock() self.simulation = KascadeLdfSimulation(cluster, data, output, R, N) # make progressbar(list) do nothing (i.e., return list) self.progressbar_patcher = patch('progressbar.ProgressBar') self.progressbar_mock = self.progressbar_patcher.start() self.progressbar_mock.return_value.side_effect = lambda x: x