Exemplo n.º 1
0
    def test_table_settings_errors(self):
        with pytest.raises(ValueError):
            tf = table.TableFinder(self.pdf, {"strategy": "x"})
            td.get_edges()

        with pytest.raises(ValueError):
            tf = table.TableFinder(self.pdf, {"vertical_strategy": "x"})
            td.get_edges()

        with pytest.raises(ValueError):
            tf = table.TableFinder(self.pdf, {
                "vertical_strategy": "explicit",
                "explicit_vertical_lines": [],
            })
Exemplo n.º 2
0
 def test_explicit_desc_decimalization(self):
     """
     See issue #290
     """
     tf = table.TableFinder(
         self.pdf.pages[0], {
             "vertical_strategy": "explicit",
             "explicit_vertical_lines": [100, 200, 300],
             "horizontal_strategy": "explicit",
             "explicit_horizontal_lines": [100, 200, 300],
         })
     assert tf.tables[0].extract()
Exemplo n.º 3
0
    def test_table_settings_errors(self):
        with pytest.raises(ValueError):
            tf = table.TableFinder(self.pdf.pages[0], {"strategy": "x"})
            tf.get_edges()

        with pytest.raises(ValueError):
            tf = table.TableFinder(self.pdf.pages[0], {"vertical_strategy": "x"})
            tf.get_edges()

        with pytest.raises(ValueError):
            tf = table.TableFinder(
                self.pdf.pages[0],
                {
                    "vertical_strategy": "explicit",
                    "explicit_vertical_lines": [],
                },
            )

        with pytest.raises(ValueError):
            tf = table.TableFinder(self.pdf.pages[0], {"join_tolerance": -1})
            tf.get_edges()