'Test that we write the correct XML on export.'

def test_export_to_xml_empty_end_time(self):

    self.descriptor.youtube_id_0_75 = 'izygArpw-Qo'
    self.descriptor.youtube_id_1_0 = 'p2Q6BrNhdh8'
    self.descriptor.youtube_id_1_25 = '1EeWXzPdhSA'
    self.descriptor.youtube_id_1_5 = 'rABDYkeK0x8'
    self.descriptor.show_captions = False
    self.descriptor.start_time = datetime.timedelta(seconds=5.0)
    self.descriptor.end_time = datetime.timedelta(seconds=0.0)
    self.descriptor.track = 'http://www.example.com/track'
    self.descriptor.download_track = True
    self.descriptor.html5_sources = ['http://www.example.com/source.mp4', 'http://www.example.com/source.ogg']
    self.descriptor.download_video = True
    xml = self.descriptor.definition_to_xml(None)
    parser = etree.XMLParser(remove_blank_text=True)
    xml_string = '                                    <video    url_name="SampleProblem"    start_time="0:00:05"    youtube="0.75:izygArpw-Qo,1.00:p2Q6BrNhdh8,1.25:1EeWXzPdhSA,1.50:rABDYkeK0x8"    show_captions="false"    download_video="true"    download_track="true">\n                                            <source    src="http://www.example.com/source.mp4"/>\n                                            <source    src="http://www.example.com/source.ogg"/>\n                                            <track    src="http://www.example.com/track"/>\n                                    </video>\n                                '
    expected = etree.XML(xml_string, parser=parser)
    self.assertXmlEqual(expected, xml)
