'Test sum_largest.'

def test_sum_largest(self):

    expr = sum_largest(self.A, 2)
    self.A.value = [[4, 3], [2, 1]]
    self.assertItemsAlmostEqual(expr.grad[self.A].todense(), [1, 0, 1, 0])
    self.A.value = [[1, 2], [3, 0.5]]
    self.assertItemsAlmostEqual(expr.grad[self.A].todense(), [0, 1, 1, 0])
