Beispiel #1
0
    def test_normal_HtmlTableFileLoader_null_tag(self, monkeypatch, value,
                                                 source, expected):
        monkeypatch.setattr(HtmlTableFormatter, "table_id",
                            self.null_tag_property)

        loader = ptr.HtmlTableFileLoader(source)
        loader.table_name = value
        formatter = HtmlTableFormatter(value)
        formatter.accept(loader)

        assert formatter._make_table_name() == expected
Beispiel #2
0
    def test_exception_HtmlTableTextLoader(self, monkeypatch, value, source,
                                           expected):
        monkeypatch.setattr(HtmlTableFormatter, "table_id",
                            self.valid_tag_property)

        loader = ptr.HtmlTableTextLoader(source)
        loader.table_name = value
        formatter = HtmlTableFormatter(source)
        formatter.accept(loader)

        with pytest.raises(expected):
            print(formatter._make_table_name())
Beispiel #3
0
    def test_normal_HtmlTableTextLoader_null_tag(self, monkeypatch, value,
                                                 expected):
        monkeypatch.setattr(HtmlTableFormatter, "table_id",
                            self.null_tag_property)

        source = """
        <title>nulltag</title>
        <table></table>
        """
        loader = ptr.HtmlTableTextLoader(source)
        loader.table_name = value
        formatter = HtmlTableFormatter(source)
        formatter.accept(loader)

        assert formatter._make_table_name() == expected