def test_default_styling_tag(self, sample_dfxp_without_region_and_style): caption_set = DFXPReader().read(sample_dfxp_without_region_and_style) result = DFXPWriter().write(caption_set) default_style = _recreate_style(DFXP_DEFAULT_STYLE, None) default_style['xml:id'] = DFXP_DEFAULT_STYLE_ID soup = BeautifulSoup(result, 'lxml-xml') style = soup.find('style', {'xml:id': DFXP_DEFAULT_STYLE_ID}) assert style assert style.attrs == default_style
def test_default_styling_tag(self): caption_set = DFXPReader().read(SAMPLE_DFXP_WITHOUT_REGION_AND_STYLE) result = DFXPWriter().write(caption_set) default_style = _recreate_style(DFXP_DEFAULT_STYLE, None) default_style[u'xml:id'] = DFXP_DEFAULT_STYLE_ID soup = BeautifulSoup(result, u'xml') style = soup.find(u'style', {u'xml:id': DFXP_DEFAULT_STYLE_ID}) self.assertTrue(style) self.assertEquals(style.attrs, default_style)
def test_default_styling_tag(self): caption_set = DFXPReader().read(SAMPLE_DFXP_WITHOUT_REGION_AND_STYLE) result = DFXPWriter().write(caption_set) default_style = _recreate_style(DFXP_DEFAULT_STYLE, None) default_style[u"xml:id"] = DFXP_DEFAULT_STYLE_ID soup = BeautifulSoup(result, u"xml") style = soup.find(u"style", {u"xml:id": DFXP_DEFAULT_STYLE_ID}) self.assertTrue(style) self.assertEquals(style.attrs, default_style)