예제 #1
0
    def test_default_region_p_tags(self):
        w = DFXPWriter()
        result = w.write(self.captions)

        soup = BeautifulSoup(result, u'xml')
        for p in soup.find_all(u'p'):
            self.assertEquals(p.attrs.get(u'region'), DFXP_DEFAULT_REGION_ID)
예제 #2
0
    def test_default_styling_p_tags(self):
        w = DFXPWriter()
        result = w.write(self.captions)

        soup = BeautifulSoup(result, u'xml')
        for p in soup.find_all(u'p'):
            self.assertEquals(p.attrs.get(u'style'), 'p')
예제 #3
0
    def test_default_region_p_tags(self):
        w = DFXPWriter()
        result = w.write(self.captions)

        soup = BeautifulSoup(result, u'xml')
        for p in soup.find_all(u'p'):
            self.assertEquals(p.attrs.get(u'region'), DFXP_DEFAULT_REGION_ID)
예제 #4
0
    def test_default_styling_p_tags(self):
        w = DFXPWriter()
        result = w.write(self.captions)

        soup = BeautifulSoup(result, u'xml')
        for p in soup.find_all(u'p'):
            self.assertEquals(p.attrs.get(u'style'), 'p')
예제 #5
0
    def test_default_styling_tag(self):
        w = DFXPWriter()
        result = w.write(self.captions_without_style_and_region)

        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)
예제 #6
0
    def test_default_styling_tag(self):
        w = DFXPWriter()
        result = w.write(self.captions_without_style_and_region)

        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)
예제 #7
0
    def test_default_region_tag(self):
        w = DFXPWriter()
        result = w.write(self.captions)

        default_region = w._recreate_style(DFXP_DEFAULT_REGION, None)
        default_region[u'xml:id'] = DFXP_DEFAULT_REGION_ID

        soup = BeautifulSoup(result, u'xml')
        region = soup.find(u'region', {u'xml:id': DFXP_DEFAULT_REGION_ID})

        self.assertTrue(region)
        self.assertEquals(region.attrs, default_region)
예제 #8
0
    def test_default_region_tag(self):
        w = DFXPWriter()
        result = w.write(self.captions)

        default_region = w._recreate_style(DFXP_DEFAULT_REGION, None)
        default_region[u'xml:id'] = DFXP_DEFAULT_REGION_ID

        soup = BeautifulSoup(result, u'xml')
        region = soup.find(u'region', {u'xml:id': DFXP_DEFAULT_REGION_ID})

        self.assertTrue(region)
        self.assertEquals(region.attrs, default_region)
예제 #9
0
    def test_default_region_tag(self):
        w = DFXPWriter()
        result = w.write(self.captions)

        soup = BeautifulSoup(result, u'xml')
        region = soup.find(u'region', {u'xml:id': DFXP_DEFAULT_REGION_ID})

        default_region = _convert_layout_to_attributes(DFXP_DEFAULT_REGION)
        default_region[u'xml:id'] = DFXP_DEFAULT_REGION_ID

        self.assertTrue(region)
        self.assertEquals(region.attrs[u'xml:id'], DFXP_DEFAULT_REGION_ID)
        self.assertEqual(region.attrs, default_region)
예제 #10
0
    def test_default_region_tag(self):
        w = DFXPWriter()
        result = w.write(self.captions)

        soup = BeautifulSoup(result, u'xml')
        region = soup.find(u'region', {u'xml:id': DFXP_DEFAULT_REGION_ID})

        default_region = _convert_layout_to_attributes(DFXP_DEFAULT_REGION)
        default_region[u'xml:id'] = DFXP_DEFAULT_REGION_ID

        self.assertTrue(region)
        self.assertEquals(region.attrs[u'xml:id'], DFXP_DEFAULT_REGION_ID)
        self.assertEqual(region.attrs, default_region)