Beispiel #1
0
 def test_selection(self):
     itm = p.Selection(
         span=[(36, 139)],
         gorn=[p.GornAddress([0, 1, 1]),
               p.GornAddress([2, 1])],
         text=
         'federal thrift regulators ordered it to suspend dividend payments on its two classes of preferred stock'
     )
     xml = x._Selection_xml(itm)
     self.assertEqual(itm, x._read_Selection(xml))
Beispiel #2
0
 def test_selection(self):
     expected = p.Selection(
         span=[(36, 139)],
         gorn=[p.GornAddress([0, 1, 1]),
               p.GornAddress([2, 1])],
         text=
         'federal thrift regulators ordered it to suspend dividend payments on its two classes of preferred stock'
     )
     txt = ex_selection
     self.assertParse(p._selection, expected, txt)
Beispiel #3
0
 def test_attribution_sel(self):
     expected_sel = p.Selection(span=[(9, 35)],
                                gorn=[
                                    p.GornAddress([0, 0]),
                                    p.GornAddress([0, 1, 0]),
                                    p.GornAddress([0, 1, 2]),
                                    p.GornAddress([0, 2])
                                ],
                                text='CenTrust Savings Bank said')
     expected = p.Attribution('Ot', 'Comm', 'Null', 'Null', expected_sel)
     txt = ex_attribution2
     self.assertParse(p._attributionFeatures, expected, txt)
Beispiel #4
0
    def test_attribution(self):
        itm = p.Attribution('Ot', 'Comm', 'Null', 'Null')
        xml = x._Attribution_xml(itm)
        self.assertEqual(itm, x._read_Attribution(xml))

        itm_sel = p.Selection(span=[(9, 35)],
                              gorn=[
                                  p.GornAddress([0, 0]),
                                  p.GornAddress([0, 1, 0]),
                                  p.GornAddress([0, 1, 2]),
                                  p.GornAddress([0, 2])
                              ],
                              text='CenTrust Savings Bank said')
        itm = p.Attribution('Ot', 'Comm', 'Null', 'Null', itm_sel)
        xml = x._Attribution_xml(itm)
        self.assertEqual(itm, x._read_Attribution(xml))
Beispiel #5
0
 def test_sup(self):
     expected_sel = p.Selection(span=[(1730, 1799)],
                                gorn=[p.GornAddress([11, 2, 3])],
                                text='blop blop split shares')
     expected = p.Sup(expected_sel)
     txt = ex_sup1
     self.assertParse(p._sup('sup1'), expected, txt)
Beispiel #6
0
def _read_GornAddressList(attr):
    return [
        ty.GornAddress([int(y) for y in x.split(',')]) for x in attr.split(';')
    ]
Beispiel #7
0
 def test_gorn(self):
     itm = p.GornAddress([4, 3, 2])
     xml = x._GornAddress_xml(itm)
     self.assertEqual([itm], x._read_GornAddressList(xml))
Beispiel #8
0
 def test_gorn(self):
     expected = p.GornAddress([0, 1, 5, 3])
     txt = ','.join(str(x) for x in expected.parts)
     self.assertParse(p._gorn, expected, txt)