Fixed build_objective

This commit is contained in:
Anton Beloglazov 2012-10-25 15:44:31 +11:00
parent 4d0275e9a4
commit 24976cd726
2 changed files with 2 additions and 2 deletions

View File

@ -41,7 +41,7 @@ def build_objective(ls, state_vector, p):
:rtype: function
"""
def objective(*m):
return sum(l(state_vector, p, m) for l in ls)
return sum(l(state_vector, p, list(m)) for l in ls)
return objective

View File

@ -32,7 +32,7 @@ class Nlp(TestCase):
[0.3, -0.3]]
m1 = mock('m1')
m2 = mock('m2')
m = (m1, m2)
m = [m1, m2]
container = mock('function container')
expect(container).l0(state_vector, p, m).and_return(2).once()
expect(container).l1(state_vector, p, m).and_return(3).once()