def test_set_value(self): a = Animate(debug=True) a.set_value('0;1;2', 'linear', '0', '0 0 0 0', 0, 0, 0) self.assertEqual(a.tostring(), '<animate by="0" calcMode="linear" from="0" ' \ 'keySplines="0 0 0 0" keyTimes="0" to="0" '\ 'values="0;1;2" />')
def test_set_value(self): a = Animate(debug=True) a.set_value('0;1;2', 'linear', '0', '0 0 0 0', 0, 0, 0) self.assertEqual(a.tostring(), '<animate by="0" calcMode="linear" from="0" ' \ 'keySplines="0 0 0 0" keyTimes="0" to="0" '\ 'values="0;1;2" />')
def test_values_int(self): s = Animate(values=(3,), debug=True) self.assertEqual(s.tostring(), '<animate values="3" />')
def test_values_list(self): s = Animate(values=[1, 2, 3], debug=True) self.assertEqual(s.tostring(), '<animate values="1;2;3" />')
def test_freeze(self): a = Animate(debug=True) a.freeze() self.assertEqual(a.tostring(), '<animate fill="freeze" />')
def test_constructor(self): a = Animate('x', debug=True) self.assertEqual(a.tostring(), '<animate attributeName="x" />')
def test_values_int(self): s = Animate(values=(3, ), debug=True) self.assertEqual(s.tostring(), '<animate values="3" />')
def test_values_list(self): s = Animate(values=[1, 2, 3], debug=True) self.assertEqual(s.tostring(), '<animate values="1;2;3" />')
def test_freeze(self): a = Animate(debug=True) a.freeze() self.assertEqual(a.tostring(), '<animate fill="freeze" />')
def test_constructor(self): a = Animate('x', debug=True) self.assertEqual(a.tostring(), '<animate attributeName="x" />')
def test_values_colors(self): s = Animate(values='#000000;#0000ff;#00ff00;#ff0000', debug=True) self.assertEqual(s.tostring(), '<animate values="#000000;#0000ff;#00ff00;#ff0000" />')