예제 #1
0
def test_make_ntgrid():
    """py.test make_ntgrid"""
    grid = [
    ["",  "a b", "b c", "c d"],
    ["x y", 1,     2,     3 ],
    ["y z", 4,     5,     6 ],
    ["z z", 7,     8,     9 ],]
    result = readhtml._make_ntgrid(grid)
    ntcol = collections.namedtuple('ntcol', "x_y y_z z_z")
    ntrow = collections.namedtuple('ntrow', "a_b b_c c_d")
    assert result == ntcol(
        x_y=ntrow(a_b=1, b_c=2, c_d=3),
        y_z=ntrow(a_b=4, b_c=5, c_d=6),
        z_z=ntrow(a_b=7, b_c=8, c_d=9))
예제 #2
0
def test_make_ntgrid():
    """py.test make_ntgrid"""
    grid = [
        ["", "a b", "b c", "c d"],
        ["x y", 1, 2, 3],
        ["y z", 4, 5, 6],
        ["z z", 7, 8, 9],
    ]
    result = readhtml._make_ntgrid(grid)
    ntcol = collections.namedtuple('ntcol', "x_y y_z z_z")
    ntrow = collections.namedtuple('ntrow', "a_b b_c c_d")
    assert result == ntcol(x_y=ntrow(a_b=1, b_c=2, c_d=3),
                           y_z=ntrow(a_b=4, b_c=5, c_d=6),
                           z_z=ntrow(a_b=7, b_c=8, c_d=9))