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
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())
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