예제 #1
0
 def test_html_untyped(self):
     with tmpfile(".html") as path:
         df = UntypedDf(sample_data())
         df.to_html(path)
         df2 = UntypedDf.read_html(path)
         assert list(df2.index.names) == [None]
         assert set(df2.columns) == {"abc", "123", "xyz"}
예제 #2
0
 def test_html_empty(self):
     with tmpfile(".html") as path:
         path.write_text("<html></html>", encoding="utf8")
         with pytest.raises(NoValueError):
             UntypedDf.read_html(path)
예제 #3
0
 def test_html_invalid(self):
     with tmpfile(".html") as path:
         path.write_text("", encoding="utf8")
         with pytest.raises(XMLSyntaxError):
             UntypedDf.read_html(path)