def test_vertical_table(self): # pylint: disable=R0201 """Test for reading a vertical html table""" filepath = p.join(io.DATA_DIR, "vertical_table.html") records = io.read_html(filepath, vertical=True) nt.assert_equal("See IBM products", next(records)["Products"]) records = io.read_html(filepath, vertical=True, table=2) with nt.assert_raises(StopIteration): next(records)
def test_excel_html_export(self): # pylint: disable=R0201 """Test for reading an html table exported from excel""" filepath = p.join(io.DATA_DIR, 'test.htm') records = io.read_html( filepath, sanitize=True, first_row_as_header=True) expected = { 'sparse_data': 'Iñtërnâtiônàližætiøn', 'some_date': '05/04/82', 'some_value': '234', 'unicode_test': 'Ādam'} nt.assert_equal(expected, next(records))
def test_excel_html_export(self): # pylint: disable=R0201 """Test for reading an html table exported from excel""" filepath = p.join(io.DATA_DIR, "test.htm") records = io.read_html(filepath, sanitize=True, first_row_as_header=True) expected = { "sparse_data": "Iñtërnâtiônàližætiøn", "some_date": "05/04/82", "some_value": "234", "unicode_test": "Ādam", } nt.assert_equal(expected, next(records))