Skip to content

Commit

Permalink
test: improve test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaoblake committed Feb 18, 2024
1 parent 865fb04 commit 6c144d3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/resources/table.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@
<td>Crownlands</td>
<td>Dragonstone</td>
<td>Fire and Blood</td>
<td style="display: none">Invisible</td>
</tr>
<tr>
<td>Stark</td>
<td>North</td>
<td>Winterfell</td>
<td>Winter is Coming</td>
<td style="visibility: hidden">Hidden</td>
</tr>
<tr>
<td>Lannister</td>
Expand Down
6 changes: 6 additions & 0 deletions tests/test_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ def test_parse_standard_table():
assert table[2][2].text == "Casterly Rock"
assert table[3][3].text == "We Do Not Sow"

assert str(table) == ("House, Region, Seat, Words\n"
"Targaryen, Crownlands, Dragonstone, Fire and Blood\n"
"Stark, North, Winterfell, Winter is Coming\n"
"Lannister, Westerlands, Casterly Rock, Hear Me Roar\n"
"Greyjoy, Iron Islands, Pyke, We Do Not Sow")


def test_ignore_invisible_rows():
table_parser = TableParser(ignore_invisible_rows=False)
Expand Down

0 comments on commit 6c144d3

Please sign in to comment.