示例#1
0
    def test_normal_MarkdownTableFileLoader_null_tag(self, monkeypatch, value,
                                                     source, expected):
        monkeypatch.setattr(MarkdownTableFormatter, "table_id",
                            self.null_tag_property)

        loader = ptr.MarkdownTableFileLoader(source)
        loader.table_name = value
        formatter = MarkdownTableFormatter(value)
        formatter.accept(loader)

        assert formatter._make_table_name() == expected
示例#2
0
    def test_exception_MarkdownTableTextLoader(self, monkeypatch, value,
                                               source, expected):
        monkeypatch.setattr(MarkdownTableFormatter, "table_id",
                            self.valid_tag_property)

        loader = ptr.MarkdownTableTextLoader(source)
        loader.table_name = value
        formatter = MarkdownTableFormatter(source)
        formatter.accept(loader)

        with pytest.raises(expected):
            print(formatter._make_table_name())
示例#3
0
    def test_normal_MarkdownTableTextLoader_valid_tag(self, monkeypatch, value,
                                                      expected):
        monkeypatch.setattr(MarkdownTableFormatter, "table_id",
                            self.valid_tag_property)

        source = "<table></table>"
        loader = ptr.MarkdownTableTextLoader(source)
        loader.table_name = value
        formatter = MarkdownTableFormatter(source)
        formatter.accept(loader)

        assert formatter._make_table_name() == expected