# Path: tests/sample_html.py



import pytest
import collections
import eppy.results.readhtml as readhtml
from bs4 import BeautifulSoup
from .sample_html import sample_html as SAMPLE_HTML
    thedata = (
        (
            [
                ("Site and Source Energy", [["a", "2"], ["3", "4"]]),
                ("Site to Source Energy Conversion Factors", [["b", "6"], ["7", "8"]]),
                ("Custom Monthly Report", [["c", "16"], ["17", "18"]]),
                ("Custom Monthly Report", [["d", "26"], ["27", "28"]]),
            ],
            False,
        ),  # titlerows, tofloat
        (
            [
                ("Site and Source Energy", [["a", 2], [3, 4]]),
                ("Site to Source Energy Conversion Factors", [["b", 6], [7, 8]]),
                ("Custom Monthly Report", [["c", 16], [17, 18]]),
                ("Custom Monthly Report", [["d", 26], [27, 28]]),
            ],
            True,
        ),  # titlerows, tofloat
    )
    for titlerows, tofloat in thedata:
        result = readhtml.titletable(SAMPLE_HTML, tofloat=tofloat)
        for (title1, rows1), (title2, rows2) in zip(result, titlerows):
            assert title1 == title2
            assert rows1 == rows2
        assert result == titlerows


def test_has_name():
    """py.test for has_name"""

# Path: tests/sample_html.py



# Path: tests/test_readhtml.py
import pytest
import collections
import eppy.results.readhtml as readhtml
from bs4 import BeautifulSoup
from .sample_html import sample_html as SAMPLE_HTML

    thedata = (
        (
            [
                ("Site and Source Energy", [["a", "2"], ["3", "4"]]),
                ("Site to Source Energy Conversion Factors", [["b", "6"], ["7", "8"]]),
                ("Custom Monthly Report", [["c", "16"], ["17", "18"]]),
                ("Custom Monthly Report", [["d", "26"], ["27", "28"]]),
            ],
            False,
        ),  # titlerows, tofloat
        (
            [
                ("Site and Source Energy", [["a", 2], [3, 4]]),
                ("Site to Source Energy Conversion Factors", [["b", 6], [7, 8]]),
                ("Custom Monthly Report", [["c", 16], [17, 18]]),
                ("Custom Monthly Report", [["d", 26], [27, 28]]),
            ],
            True,
        ),  # titlerows, tofloat
    )
    for titlerows, tofloat in thedata:
        result = readhtml.titletable(SAMPLE_HTML, tofloat=tofloat)
        for (title1, rows1), (title2, rows2) in zip(result, titlerows):
            assert title1 == title2
            assert rows1 == rows2
        assert result == titlerows


def test_has_name():
    """py.test for has_name"""

    soup = BeautifulSoup(SAMPLE_HTML, "lxml")