'Test string representations.'

def test_to_str(self):

    obj = Minimize(self.a)
    prob = Problem(obj)
    self.assertEqual(repr(prob), ('Problem(%s,    %s)' % (repr(obj), repr([]))))
    constraints = [((self.x * 2) == self.x), (self.x == 0)]
    prob = Problem(obj, constraints)
    self.assertEqual(repr(prob), ('Problem(%s,    %s)' % (repr(obj), repr(constraints))))
    result = ('minimize    %(name)s\nsubject    to    %(name)s    ==    0\n                                            0    <=    %(name)s' % {'name': self.a.name()})
    prob = Problem(Minimize(self.a), [(self.a == 0), (self.a >= 0)])
    self.assertEqual(str(prob), result)
