def test_set_timing(self): s = Set(debug=True) s.set_timing('indefinite', 'indefinite', 'indefinite', 'media', 'media', 'always', 'indefinite', 'indefinite') self.assertEqual(s.tostring(), '<set begin="indefinite" dur="indefinite" ' \ 'end="indefinite" max="media" min="media" ' \ 'repeatCount="indefinite" repeatDur="indefinite" restart="always" />')
def test_set_event(self): s = Set(debug=True) s.set_event('test1', 'test2', 'test3', 'test4') self.assertEqual( s.tostring(), '<set onbegin="test1" onend="test2" onload="test4" onrepeat="test3" />' )
def test_freeze(self): s = Set(debug=True) s.freeze() self.assertEqual(s.tostring(), '<set fill="freeze" />')
def test_set_timing_1s(self): s = Set(debug=True) s.set_timing('1s') result = s.tostring() self.assertEqual(result, '<set begin="1s" />')
def test_set_target(self): s = Set(debug=True) s.set_target('x', 'XML') self.assertEqual(s.tostring(), '<set attributeName="x" attributeType="XML" />')
def test_set_href(self): s = Set(href='#test', debug=True) self.assertEqual(s.tostring(), '<set xlink:href="#test" />')
def test_constructor(self): s = Set(debug=True) self.assertEqual(s.tostring(), '<set />')