Exemplo n.º 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
Exemplo n.º 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())
Exemplo n.º 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
Exemplo n.º 4
0
 def test_exception(self, monkeypatch, value, source, expected):
     with pytest.raises(expected):
         MarkdownTableFormatter(source)