# Path: eppy/results/readhtml.py
# class NotSimpleTable(Exception):
# def tdbr2EOL(td):
# def is_simpletable(table):
# def table_withcelltag_2matrix(table):
# def table2matrix(table):
# def table_withcelltag_2val_matrix(table):
# def table2val_matrix(table):
# def titletable(html_doc, tofloat=True):
# def _has_name(soup_obj):
# def lines_table(html_doc, tofloat=True):
# def _asciidigits(s):
# def _nospace(s):
# def _transpose(arr):
# def _make_ntgrid(grid):
# def named_grid_h(grid):
# def named_grid_v(grid):
# def cell2txt(td):
# 
# Path: eppy/results/fasthtml.py
# def _decodeline(line, encoding="utf-8"):
# def getnexttable(fhandle):
# def tablebyname(filehandle, header):
# def get_upto_nexttable(fhandle):
# def tablebyindex(filehandle, index):


from io import StringIO
from pathlib import Path
from eppy.results import readhtml
from eppy.results import fasthtml
import pytest
    "htmltxt, index, expected",
    [
        (
            SampleHtml().html,
            1,
            (
                "Site to Source Energy Conversion Factors",
                [
                    ["", "Site=>Source Conversion Factor"],
                    ["Electricity", 3.167],
                    ["Natural Gas", 1.084],
                    ["District Cooling", 1.056],
                    ["District Heating", 3.613],
                    ["Steam", 0.3],
                    ["Gasoline", 1.05],
                    ["Diesel", 1.05],
                    ["Coal", 1.05],
                    ["Fuel Oil #1", 1.05],
                    ["Fuel Oil #2", 1.05],
                    ["Propane", 1.05],
                    ["Other Fuel 1", 1.0],
                    ["Other Fuel 2", 1.0],
                ],
            ),
        ),  #  htmltxt, index, expected
    ],
)
def test_tablebyindex(tmp_path, htmltxt, index, expected):
    """py.test for tablebyindex"""
    fhandle = StringIO(htmltxt)

# Path: eppy/results/readhtml.py
# class NotSimpleTable(Exception):
# def tdbr2EOL(td):
# def is_simpletable(table):
# def table_withcelltag_2matrix(table):
# def table2matrix(table):
# def table_withcelltag_2val_matrix(table):
# def table2val_matrix(table):
# def titletable(html_doc, tofloat=True):
# def _has_name(soup_obj):
# def lines_table(html_doc, tofloat=True):
# def _asciidigits(s):
# def _nospace(s):
# def _transpose(arr):
# def _make_ntgrid(grid):
# def named_grid_h(grid):
# def named_grid_v(grid):
# def cell2txt(td):
# 
# Path: eppy/results/fasthtml.py
# def _decodeline(line, encoding="utf-8"):
# def getnexttable(fhandle):
# def tablebyname(filehandle, header):
# def get_upto_nexttable(fhandle):
# def tablebyindex(filehandle, index):


# Path: tests/test_fasthtml.py
from io import StringIO
from pathlib import Path
from eppy.results import readhtml
from eppy.results import fasthtml
import pytest

    "htmltxt, index, expected",
    [
        (
            SampleHtml().html,
            1,
            (
                "Site to Source Energy Conversion Factors",
                [
                    ["", "Site=>Source Conversion Factor"],
                    ["Electricity", 3.167],
                    ["Natural Gas", 1.084],
                    ["District Cooling", 1.056],
                    ["District Heating", 3.613],
                    ["Steam", 0.3],
                    ["Gasoline", 1.05],
                    ["Diesel", 1.05],
                    ["Coal", 1.05],
                    ["Fuel Oil #1", 1.05],
                    ["Fuel Oil #2", 1.05],
                    ["Propane", 1.05],
                    ["Other Fuel 1", 1.0],
                    ["Other Fuel 2", 1.0],
                ],
            ),
        ),  #  htmltxt, index, expected
    ],
)
def test_tablebyindex(tmp_path, htmltxt, index, expected):
    """py.test for tablebyindex"""
    fhandle = StringIO(htmltxt)

    result = fasthtml.tablebyindex(fhandle, index)